From patchwork Tue Jan 9 13:22:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123941 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4018532qgn; Tue, 9 Jan 2018 05:24:24 -0800 (PST) X-Google-Smtp-Source: ACJfBostiHruIz64RSvSnlEhkPOaScLrjRqHF+nATk3y0iQRypxkC1JDtl7nvT/pRn3rJpxQa2wX X-Received: by 10.28.74.72 with SMTP id x69mr12651663wma.126.1515504264366; Tue, 09 Jan 2018 05:24:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504264; cv=none; d=google.com; s=arc-20160816; b=SNr/XGDyk3eOYS+nCkikH2jY8dOVABDplRATLrznK11uSTdgzShgTifv9coKJpmnsi VDL+PO6w/VOtvznkIqxtk98Zh/vQHC3kn9p/HD3ge/K47BvOnWpnVW+Hzf3QThyctEW+ CRX6zqICsLhzS5DcfUZHUS3Ia2qjSFytibLMZ3mNWBVyo/f9xb+Vz+hLD2ONysPgnQD/ S3a52JKfYgPRscx/wmuGqZsYRkxVnAfFkHzuvMybeoGDhRX+QP0W1xYq2ao4RWuzt8KC wNTJH6gfx25KchOiJOIAT7v4AAS00FG5TceY4XOWMpj7ib/+cDB+dopVS1BoW3pNoAbz V4+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=eD63WN6Q23D5N3XugzFxqy4zcViEErSzOk5jxwOGZfc=; b=VHGvTlaGJkFBtwKWeUSPHPsZvyUk+CiNxvrqe2Bs1kgrTSeL9QnmbpfYa0Z15vjjCa D5jcy4d74cFQ18HSxYJ+QBFKfKv13QSbFjz/MKvEMrzszSdVfSDCIFrAWb7g+6qywlSo GpdrUdrr+hCbhcEcep/igSWs8tCC0pyAhtHqyrcRABtb1NEEqi9IMl6QEETxwm03YR0G tOlaPlOVZsFp/G6tTysrHaXg4HB93jy1BNNwBE7iZgOSrPYEgtnH8rDelfuTllivvyNh 8bbzDzBPSxtn0i5s38ABX5kOtmK0zhiquKUJB9/MLxWPU3+olb88VUO+zA/1jwIsnvkw htcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id j7si9496676wmg.73.2018.01.09.05.24.24; Tue, 09 Jan 2018 05:24:24 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A155B1B1C4; Tue, 9 Jan 2018 14:24:19 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0074.outbound.protection.outlook.com [104.47.34.74]) by dpdk.org (Postfix) with ESMTP id D3B051B1BF; Tue, 9 Jan 2018 14:24:17 +0100 (CET) Received: from CY4PR03CA0085.namprd03.prod.outlook.com (10.171.242.154) by BN6PR03MB2691.namprd03.prod.outlook.com (10.173.144.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Tue, 9 Jan 2018 13:24:16 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::116) by CY4PR03CA0085.outlook.office365.com (2603:10b6:910:4d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:16 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:45 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVj017638; Tue, 9 Jan 2018 06:24:13 -0700 From: Hemant Agrawal To: CC: , , Ashish Jain , Date: Tue, 9 Jan 2018 18:52:49 +0530 Message-ID: <1515504186-13587-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778255172327; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(51416003)(81156014)(86362001)(105606002)(498600001)(106466001)(50466002)(2351001)(4326008)(8676002)(5660300001)(47776003)(50226002)(36756003)(97736004)(16586007)(53936002)(6916009)(2950100002)(8936002)(54906003)(8656006)(6666003)(356003)(104016004)(305945005)(2906002)(48376002)(81166006)(76176011)(77096006)(68736007)(85426001)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2691; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD028; 1:F0j/sHyyNJxsbP2xADVPvW2R8IqrV/q4gWx1cPCwFEQxbGaiaAEAVdFnBWk1iqJz2nvWh7aHyM6vU5CsmmhWFfQhW6uGQkk34PSc7T+eKigsKBQ5AszVHdnpi4PfxDwU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fcb3f31-e708-42e1-72e7-08d5576435e2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2691; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 3:HATEmT63I+KYeyjcjzxLOhnMsLW817wgUAvZ4JpOJAgtRLXQzd2myJOKelbeHpMNesLKVuSDIOD05HqBFzVOJuU+x1VAsiPyESlN7VNGeqlX4z0XNCUA17eqKMdsIqaSb/iOhljnLPJs5Twm+dDP00UXXG0DVMepeuFWAxPsLD5tA6+e7hRhC6C2O/SywBfa3EuC46n011wrrDWdofMW7zwQvphXrfPU1mXqArqvu/K65rFLkbSQ4BxIb29f6/KW8cOeILbzw1fVMyGi8r7NiPMlr4vw9SVZIWS5Zk6UQi/M/ZHZ8ocl2To/7l4NiXvqv1W+/Y75noao7OcWgDf7LZuBdIIgQgRtTG7HTrCMl84=; 25:KK0yCaNUKDzYfoGU/XRm/EjEE6qVGUuX6P23Z1XTqEHNxmpaWqsQt/5MESCdH4XgbWl3+ddV5B5pDiKsy7aEETywvETxhUlCff8WhW1C9UoHN36Bww5QlKyZwWnME5bgpJ7R2DekABM24XB7qkTgFOao5NDIWQGLiluiEiUzx1oiqTX8TcCvqpYoFvgEim+MgKK3ZwVsAMi0AaydBm6du5AoY+O7Kdnw/Q3SMaPQ98cg0bdTddbWU0uK29v/wQAS0t9csC5WSKpmuoEt4fZyZbuGTxxc+2pAxIDjSzc3g/Y1wvoGKBZAb2wv7azs+quBswPcCQHRU2WHwvc1HCmENg== X-MS-TrafficTypeDiagnostic: BN6PR03MB2691: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 31:DfongGgY1gY3O9pq7gQ6kNEVulsv/OMFjhcoDu8Tg7qzLTNnLXXrZNBsV+PfJM9cmkmJ+CGkN9VEA1s/wC+rMw1zh5tPxS8mqU7Kb6uNmE+QkSCXlgdsxap21WXZFIqwTTtsnyErOuI7VUdtuuA7ILEgGCnmR1Oly5d+vpnzXqgx1g58nBl8JEMMM/JBtw8sX2NsMlxKxN2Q6uSEbedKbeT4AgsuCeWulph0DXATOZI=; 4:DVsLdmDzTfblQOYe073WpQvES5yq0lhRX7p6e2aWkpMf1WO7eFSjGGFR/2xCW8Gx+6qM8b2sItGJHG2hH5tkFtO+wYlgDEqmi64r2XzsI2K4G6ziw0Xy/T2WwVz5rAl2g8Z22ettRpcZTuHY/5rwWK7mK0hkzy0RO/MDZddjJTV0WI71rLHqDAmwEVQ26k2vtt+SavIQ3iKpdcp0O/uUP7FYtfhncdEqbtDsNBVWCiNyfl1ponNZOp+Gh0xvvfBj7H7eux+ycmIbzYdgZ85DWxfW4GKRLBkMiXBWJ6+dJ/H+FMWQb7z012j0lGqba4mK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(944501110)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123561025)(20161123565025)(20161123559100)(201708071742011); SRVR:BN6PR03MB2691; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2691; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2691; 23:lrAK5Tvyoo1yROqZqR6TlUe65a8O8Vi4gyXkiNid+?= 6Bh2whRRkCUPMjhi97aNxCOLnGZszXqHnh3jSeYWrpH4+nEZCdrl99drxmejTg9aagCD9aybn+gkXoD3qyMiOyWksCO3pn7ZdC3TG+VilMJUMaBpJyxxmcpav/W10Tfv+GmglPOZPvmO70ACM6Fi3omCva1Ki4Mp1ieqKXFOY9zeJ8In/GfaqVoIJk96jrdbQHWhTsHchqBRhJOBLFyIshplqR3Z8vW+CFOL64qjHhBx4NLYwZmF1XD+9YXeJgesKtThsukr0VuVZky4mLZ9dtEl7T9hikfP0NqQtMmL3xnvxj1RPAyiRviauxZpw3jVxdphRMhld4MqFt+0L7F44H4DkZ1iV/OHDb1B71MfCHZmGei72veGNi/6LaPG8V4KZlO0/PSoPpLvR9xHetxsSoLGfOUcN/FdfYWZ/DRAZsNNo9pykZ02SokD29jhwczOsURfnSMPAX5s5hRS417mLFLRuqLSIhH2Kadj3KLFIyRTXTNt6Efk5dD0Cf7tWrbkhAaDSYucxwAlP7nR7uA5WnQ+8x2Jhayxhq5HmevjTraUBgR6vMszSVAmwSgxK4FIBixzP4hEWGp67AWqpXO84yKff3y+FMFFgJnuk942dDGHrBvzqZGSyob49J7HvRMJZgQwcAj1+Pz7ViyyAPsBRu3cOgnKMFNGXZecKAafq+UB8EMlXWWbl6l5fDOljjy75V9y/KSOt0XuUF+txDnnZm1oWZlu8yBb8OSxNpdnObKPJXMVnwkacoM+6ID3TB97zoqJOXUHWfB6BHQo/4jp/tXQ7DkmpXrVe0Lp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Grr7qJDdu20BP+LWRTFMCtB30qk+23eNL6H3BIvUbv4IZo+hPvujYuY5XyfPuwHF1qXIfIZ/2PdGAz6/YLi4JSh9o5B+DZZgxLstSyXHTLUsKJSbHBUVN6MrqRMX/J37u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:45.3144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fcb3f31-e708-42e1-72e7-08d5576435e2 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2691 Subject: [dpdk-dev] [PATCH v2 01/18] net/dpaa: fix the mbuf packet type if zero X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ashish Jain Populate the mbuf field packet_type which is required for calculating checksum while transmitting frames Fixes: 8cffdcbe85aa ("net/dpaa: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Ashish Jain Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index c3a0920..630d7a5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" @@ -478,6 +479,15 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, fd->opaque_addr = 0; if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (temp->data_off < DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t)) temp->data_off = DEFAULT_TX_ICEOF @@ -585,6 +595,15 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, } if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } if (mbuf->data_off < (DEFAULT_TX_ICEOF + sizeof(struct dpaa_eth_parse_results_t))) { DPAA_DP_LOG(DEBUG, "Checksum offload Err: " From patchwork Tue Jan 9 13:22:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123955 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4021938qgn; Tue, 9 Jan 2018 05:27:43 -0800 (PST) X-Google-Smtp-Source: ACJfBotMy9KxgP1JTb0L/k8uKB4ldSs8StjkTgK7F7obpLqhenwM56rwMSf9HaKwQpu1ix4M2riW X-Received: by 10.28.7.144 with SMTP id 138mr10936573wmh.128.1515504463283; Tue, 09 Jan 2018 05:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504463; cv=none; d=google.com; s=arc-20160816; b=eneba5bN6i/z/KMrjhZQ4t88qogeVM15/PnPw7WdHcGkpLc4BPNhs7kxAUlrWrxanh 0CIsfqXSdYPVtZ8lAGbz2NcP2PkHPQCIGrSc2wh2geWHnlKhRZ8CnMbQdh4RaGe4E6vu cG0roswB9dlcDqwddraUTwMvTZZ6i9APzTztm+vi8YqTZ3eB5IXEIcS/FRYYUACT6dqL 7PJw/1Jtu2b4/l342Y067mplk2tvabVvAq6g80qVuPJG82A8hj/0MtuwKuobQahYeFiW eozqGevokFxQIPL6l59EnRaxfHtj/a1dae2YJCaLkLmj1ZJ7kQZAjiNMJb8lkVb83S0s +uFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Jwr26lLFblI0f3M1bBrEH3DyhmqIKFiczEXpJ+STi2s=; b=Wxh4+HLRIc48nMCmZPp68n8h8TmK3VFLznCFR+cf1J9YOfO/u5V0UvtD3iWud6f/Ng 2e/PJflFLfh4TlCfe1eCLJT1o+s1mo6ukYcFg3b1eWNj94sjgZllYR1AzEzjvoFTMT0Y 52vbqUXDLmnwMAjBwlg9KzAf923hNJGbOi8hofNDCJFzjk5ru8A7A1rWoQhNZhgnS1Z9 jDtFoZLHljTXslJxpHzG0ItboYhELJYhrb+HkDkURJK4Qwdii/H2VeSmknKy+WmBa2QO w81jkYo8ct7FP0B4zb1A29ToePJK4lwKmcYDE65Kzn/4b+WoYEs3ve3Ak4XvDY4sOj4s XCDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 52si10830694wrt.460.2018.01.09.05.27.43; Tue, 09 Jan 2018 05:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BD701B23B; Tue, 9 Jan 2018 14:24:54 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0044.outbound.protection.outlook.com [104.47.42.44]) by dpdk.org (Postfix) with ESMTP id 3162A1B235; Tue, 9 Jan 2018 14:24:51 +0100 (CET) Received: from MWHPR03CA0012.namprd03.prod.outlook.com (10.175.133.150) by BY2PR0301MB0727.namprd03.prod.outlook.com (10.160.63.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:18 +0000 Received: from BY2FFO11FD042.protection.gbl (2a01:111:f400:7c0c::169) by MWHPR03CA0012.outlook.office365.com (2603:10b6:300:117::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 9 Jan 2018 13:24:18 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD042.mail.protection.outlook.com (10.1.14.227) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:47 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVk017638; Tue, 9 Jan 2018 06:24:15 -0700 From: Hemant Agrawal To: CC: , , Date: Tue, 9 Jan 2018 18:52:50 +0530 Message-ID: <1515504186-13587-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778279230706; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(376002)(396003)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(105606002)(106466001)(104016004)(50226002)(53936002)(8676002)(8936002)(5660300001)(4326008)(8656006)(2906002)(16586007)(54906003)(2351001)(51416003)(76176011)(97736004)(86362001)(305945005)(50466002)(81166006)(36756003)(356003)(81156014)(68736007)(316002)(575784001)(2950100002)(296002)(498600001)(6916009)(48376002)(77096006)(85426001)(47776003)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0727; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD042; 1:23myyHaIgL3R3V8l5pqg6VQtsSjO5BAcKeBKL7RryrvxbMzutu+3O3uzUqJQlcvuAvYUIbK3CJG3cugpOtJcYrx9sK14Smijoc7ZNSq2WAxKKVtBqvxs5Fz871SdkODD MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30e51908-7327-40c6-8cf2-08d557643751 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BY2PR0301MB0727; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 3:H8J4o+t4bGzeVhyqBDJKMgrj7CaIaCWSIi9c51Tk8z7SF3frSA5viA4wfmEFqP1zYjhYCLVno4xs+M1VxQ8in729y2aQI8QLCuRXzMCH/Zx2WGr/BplBgZWW5WPwtkRCgKbrgCZvZhGKV9xDgL/M1w8zjbFtb+oHUUiP6klp3rIO81yc/cA2c1USTByCh4nEUrzLPH28heqcBg0GZNiA53foE58XHSZJniXVPwLAyMtWngf/dDRd14Ax+tSc94cf3+Em/xScXVLr8ns7G60+s27gcs+p/MiVIL8SErGOU9by10akriGUfq+OMACXB0DJto40JfdIoKJ05N8uDj2FCOni98L2NU5Koy8de1ocJd4=; 25:LRsD+SrA/j3OInYCkGld7BQApa299z7g2Q1UIoZIp14m4hd91qRPTquwrZVQ1hR/k8xHRDKMGcjRpj/E/fTviFzifhJ0bPxaV36zbT/rYtI59dWldZh4bJYJSjiSHhqK5N6Wr0Ff50MmlmlwUPMgDM6mo/KzfEMNCLARpZAFtqqZidXpJZKiXZQvFXXVj4WxiVjWp8p7s36qkjYiRQm3hYX+mWfGOOF46Wn2ZUmBs+ajOB4HCmPTAH8LMs9qFNc1Coagms5gCglUSTQTs9B2lj2lYazESPOZxHFZZzxcEfGA4hFKJ6lTHW3J93m+/a+6n7NlEPGnZH1XCezePxoUgQ== X-MS-TrafficTypeDiagnostic: BY2PR0301MB0727: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0727; 31:B9LMiEL9YfJpnUMV/GbJ92PrCAKxmH+U5YDhhK5Y834+wehr+Rjacr5WX3/V8WlY/uFrQnykYOOb7AXkhNFseLFN/ffXpkI/TTc2UPoHwkaz8maBdetRy97SD56WhtD2N4V6wdknd5u2XJGWzBBEUQXZ0tA9E1pN/pUGSblrHyrxXpJYtD0fch7nvmYTiHYWe2TD4HJPpMPXKzt7osxk525i+ojNRg9vQFhkw48OPtw=; 4:6/1/p+pP6KUEaTrea2haMq+iQHzx8o2g0Ggk/wEUWWRKgmM9LhEpi8AsACl0i/A+0I6Y1wlY41UzLt2FQyQVsGiS+uO6SWjlJoGzBCQKHuTuijEpqTkUix3BrpBnQKJyCbZH3du6yvHl9ES1S1a+bAeGW31D4Rx+Xa61kfoxxPhszB6MXLTA9WizaMYAAbDjQ1ZrDiecXTS9xa03MHzHGJMHWKUBPVALsLiE1D3yCZ6QTSiP1N+W0SUTdSt3XHpXvv7EdQLLATXdI3gN05De+sZf3bI/qWpLV44mVgdscgHhnbRIC45v5HJbAf6HTdfb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123559100)(201708071742011); SRVR:BY2PR0301MB0727; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BY2PR0301MB0727; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0727; 23:Un1NXE6eO+4QmydQDs+XqC1vGd3+tMTeF9FDkig?= uUUF/9z4p9GbrAAQBMEl1qZjMvCPwYqlOgOoJZrKqzIV2GdoNTD6ZiX7dEwxYGXhFZ3rlYWf/+hLCFXxFEJ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nt2G+x7qlXnvDaW329+QAwS3kr1LfhsSfujVsghWm+KmzVuM8s4j/RWupvDs/MZctyKAMP1mICHQZrTmac3L+CHhVK9S7btQymBfTOKqmCDP+olzZ5RYLiqhlw2gH7ZkvzUyBBYkaA5bu5Hu0JiRe6XJt1+EVrON6fOn2tgqUvE5dY+AwHNKVW+Sq/Sa1GV+BixHQx0FSHeEOOXE8ijYfijTo8SvwrSna+JZNDapRdJ4N5NHazAkxKbiKAT8CvP/TgupqRa6tY7yqsPpM2PfBJUIy7J8Yb0DWh+kl8OqqE6l/rYxB5eVgaI=; 5:mYa5jKhClobrs5a10rT8NIedoDzWgo0TlJ5RKxLhEgjdjGru1shUs2eBJ+Bw0qdYC4SgR3H0yQp4z3QZi1MS4+YOJSfhV1a6TMaiiIbaWmAATz1OjXSmEZwePtidXx03W2JdEzwMj48jHmYBraG1L2+IfDorNYR4To+rkrZcO/A=; 24:b/I5Wqzo/CfOmDyJNUcvxzbJF58xdldCA5MB3NGpol31IZ7IMVC6U0+gj7L1yGGybqaxuKKNVmfBiettzT9uTQpMefqfn8Xc2JAeKPY1bXU=; 7:xzKnOg7QeqWTAFqjNtlgD7fxlpPnCq7oKpnF07G1VgopKfCVlFCOVFCZdOytJCOtc/occz5VdVO9OocDEf72FDDPEyjGihxt/McrhuoID5XNDhRboXPkl3IEJ3VQpIhQ8i2ncwqQLyY0aKNYhoNlyn2MjP7ckJ8wvZPRQN2LgaOmoku1GH3nzygllviMeZY98DWylne09NJntJRnjf4E7FqZ69mZfaDpioEnlm2GlTFPbhyI6JIVXrHQWfDMDoFY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:47.7358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30e51908-7327-40c6-8cf2-08d557643751 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0727 Subject: [dpdk-dev] [PATCH v2 02/18] net/dpaa: fix FW version code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" fix the soc id path and missing fclose Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 14 +++++--------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 7b4a6f1..db6574f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,19 +186,15 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - - ret = fscanf(svr_file, "svr:%x", &svr_ver); - if (ret <= 0) { + if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) DPAA_PMD_ERR("Unable to read SoC device"); - return -ENOTSUP; /* Not supported on this infra */ - } - ret = snprintf(fw_version, fw_size, - "svr:%x-fman-v%x", - svr_ver, - fman_ip_rev); + fclose(svr_file); + ret = snprintf(fw_version, fw_size, "SVR:%x-fman-v%x", + svr_ver, fman_ip_rev); ret += 1; /* add the size of '\0' */ + if (fw_size < (uint32_t)ret) return ret; else diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index bd63ee0..254fca2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -20,7 +20,7 @@ /* DPAA SoC identifier; If this is not available, it can be concluded * that board is non-DPAA. Single slot is currently supported. */ -#define DPAA_SOC_ID_FILE "sys/devices/soc0/soc_id" +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 From patchwork Tue Jan 9 13:22:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123942 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4018732qgn; Tue, 9 Jan 2018 05:24:35 -0800 (PST) X-Google-Smtp-Source: ACJfBotyMDbA6iIcEKtf/WFH0xY9geKcVuQip9xEy/e6uZNz9nzcUX4yN+S73QpYJ3mmlfSCNpzR X-Received: by 10.28.216.79 with SMTP id p76mr11557968wmg.44.1515504275651; Tue, 09 Jan 2018 05:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504275; cv=none; d=google.com; s=arc-20160816; b=py4F3LAmCY6IlZGJON/EXc3O/M8i06dt9GhFunLo1v9HMOHRKEXjJIjkBHOz1c0Ieg AYNxevJUusJV81ad63xq5icrVXGJ6XpspxqLSJ/DP2LW8jlM62JFQ5puZUKktPBgGAW9 sgoCuhdgsXr6AONX6aejcLECgV/92lGsulXC2Gu/Wwqe4cTWMmEcas5NiLYYGFuOE326 yGJ5JD+mGIHX+L1d6c7NrSSx3M+genZlN76SODBqsZSkKqo6HiiFIOBkCAU1UUQZUKYd dUJMxR3jp30Di5jxBn0G7Sef09H++DQLh2g9ry9vLZ+Nq92GAJPp3VGQqs1t+P7fBMak 0j8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=9VAaNw+7iOKxn+tru7rzecSM7NehH2Eleeg+UklGx1k=; b=jeGxLQ6b1lFywCiTjKBYllxesMf+tG9LmcrQLI01ExqzUhtir+Jp1FSWtzUrKYZLoZ aaW/5ktetS5jjVO7UzKlBn314DU3r564nKFoOs0cSkYbvM2fGY/1kHAUs/JFL6je4wTM HSvqjb0mZcUpdhVZVYMkTwj52YU1yzZ7pcnjQzQHTXARb+BJLOAf8XaroFw2eFUun1hL Fy6Kr7bJjoekd16JQH0abntrCqzRaCig2B0FhxDvj5Iu/fgdqhxX3QlwrMENnbl8aEX9 q4QSEqAnsS0MAKrM6H9cuhNgbuOY06CrO2ZDWQxFDmrZwKYKCE0hzcxqphvFquNmXZfM SMLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 8si10941657wrz.280.2018.01.09.05.24.35; Tue, 09 Jan 2018 05:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96B2D1B1C9; Tue, 9 Jan 2018 14:24:24 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) by dpdk.org (Postfix) with ESMTP id 756961B1A7 for ; Tue, 9 Jan 2018 14:24:22 +0100 (CET) Received: from MWHPR03CA0027.namprd03.prod.outlook.com (10.174.173.144) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:21 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::199) by MWHPR03CA0027.outlook.office365.com (2603:10b6:301:3b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:50 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVl017638; Tue, 9 Jan 2018 06:24:18 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:52:51 +0530 Message-ID: <1515504186-13587-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778302030447; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(50226002)(316002)(48376002)(54906003)(81156014)(8656006)(4326008)(8936002)(105606002)(16586007)(106466001)(81166006)(8676002)(51416003)(76176011)(59450400001)(104016004)(15650500001)(498600001)(86362001)(296002)(2351001)(50466002)(53936002)(5660300001)(97736004)(47776003)(77096006)(6916009)(2950100002)(68736007)(356003)(2906002)(305945005)(6666003)(36756003)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:XxJMeLDZ3tHobwJ+sQyb92tSxyOzEnR78Ra9qyYEy1b8yYXS6d13gEvm+7gfzgkz/KY/7Kd8n+FUkyWUHzrkA02nHHtSq5/QKp6fGCz+Jrpy5/l6BfDwxDuoQ2Aoplk+ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e37558a-fce9-442d-726f-08d5576438ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:erEuXHlcy2Ng6exZFKauZ0q/V6f/Z61fboLkZgGoSVvgxmvF7KTfvcf8KYL46F6QfTKgxGHnKT9+SXfBWVa6F5qiwLE91uapCCgCpAU7p9kY0VGBPwU233ahJbnGS1FSrW5B/NR8lfUsVWD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9SN67ljj890mJY8QeAWnuXX07rDkPvaKgSjcvWQYFMWwrk5dvNaI21sEIcKQgT1niakkbGoIsA674rpFfo7aGJtkZKuvfO6ccLNYxjUNIs6NSntTbsAFhT1jd9f+ZCWr+GAtKygP6wrFukLYb8o9aYY1P2F1NtHwfwrTwBM1JLFYOf9E0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123561025)(20161123559100)(201708071742011); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2692; 23:S5afuGJLTblokFzM7OsmVPqMWQA6mzXUQskatschz?= BU/V7EsaXlNDvUXrgzxlmAoRIulIuYa3BXsq6R+sncBMkpWtgyyxx/G7Rm5iBS+BwuTSrd8LlzSWz3oOHxXFDh4qo5kN8ewA0emFJm6Rg5oZHvOo7CMJffOyTrm3DgDtPmftS5ihROaXSF6W4FxKwLgMT0K35acLEOpZWS1A8dF5ndSdobrIFQTmo4O0nSCScFDgFoGBDsrdyFsGlAFv/jJEK7Af08H5hSFHvCKv2sono9GuZzkn1YwIwbgoV6poG69pU5QBHvNW+OVE1o2Dw5/P8KGEw7mb4rDXsVN2EiGYZezs0aS7rfeXI3MkLHbwL4ykhMjWwIXKodblhVD3SuDc0smXOC+SWgXHnWZn4TeE5MjLOrzo911zKBiasaG+8U+hJMMd4k21KtFLO4RNGD7JRCoKlsgzYOULFUqdZbKMgXld6ewI7iSIx5OIc2QQ4mZCfeqV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W7tKP0bwcUmcoFJEkyU7CpA9cMg72w3wXDjjQV7UyfdjOFS4ybHJrgrJY8ibjLCqxOaLJ7Ap2MMSvOE2HGepqyTbjKVE1TnNHB3PoX9zhn4LFJikFZ5TEL5BR3VJ04TiA0ZW7PrE3FJ6p7mWTn7TSdfD9llz64rcIphXbM=; 24:hn+ALZRk6MWMh/5xGt/mEZmvUk/WTUa5TyXZSFGo0O+/wqlEr3MeZQEBDDTRRQMNUgXoA1a/8BVAYURVE+HgAH6KX1S9DQfAlHQVC57dHRQ=; 7:je82IvwBkB5DXV27eqBkQCqk/lyHdhgq3PXxmgqODbTzl2ttZEwVpPvcukIRYCqr4QLob04zez4eW7OFvGAYU4lFPaQ1ZEygD0qdK81p3eZcTDsuDQ+ukYZjTwGMp3nS7fn6xSAy8VjZiPqgLPlwVl2RYOBdabk4IB3eAkpLgE1hDGhMJeftNPDgrcpiBS5wI040MpS5xlBWcD1ah/CItiQI14vM9jmIAzVzFMy8BqbAmJbiD/JvNfB4NAkhp88s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:50.0158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e37558a-fce9-442d-726f-08d5576438ad X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2692 Subject: [dpdk-dev] [PATCH v2 03/18] bus/dpaa: update platform soc value register routines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch update the logic and expose the soc value register, so that it can be used by other modules as well. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 12 ++++++++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 ++++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 11 +++++++++++ drivers/net/dpaa/dpaa_ethdev.c | 4 +++- drivers/net/dpaa/dpaa_ethdev.h | 5 ----- 5 files changed, 34 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 79f4858..a7c05b3 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -51,6 +51,8 @@ struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ pthread_key_t dpaa_portal_key; +unsigned int dpaa_svr_family; + RTE_DEFINE_PER_LCORE(bool, _dpaa_io); static inline void @@ -417,6 +419,8 @@ rte_dpaa_bus_probe(void) int ret = -1; struct rte_dpaa_device *dev; struct rte_dpaa_driver *drv; + FILE *svr_file = NULL; + unsigned int svr_ver; BUS_INIT_FUNC_TRACE(); @@ -436,6 +440,14 @@ rte_dpaa_bus_probe(void) break; } } + + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + return 0; } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index fb9d532..eeeb458 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -64,3 +64,11 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + dpaa_svr_family; + + local: *; +} DPDK_17.11; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 5758274..d9e8c84 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -20,6 +20,17 @@ #define DEV_TO_DPAA_DEVICE(ptr) \ container_of(ptr, struct rte_dpaa_device, device) +/* DPAA SoC identifier; If this is not available, it can be concluded + * that board is non-DPAA. Single slot is currently supported. + */ +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" + +#define SVR_LS1043A_FAMILY 0x87920000 +#define SVR_LS1046A_FAMILY 0x87070000 +#define SVR_MASK 0xffff0000 + +extern unsigned int dpaa_svr_family; + struct rte_dpaa_device; struct rte_dpaa_driver; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index db6574f..24943ef 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,7 +186,9 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + else DPAA_PMD_ERR("Unable to read SoC device"); fclose(svr_file); diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 254fca2..9c3b42c 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -17,11 +17,6 @@ #include #include -/* DPAA SoC identifier; If this is not available, it can be concluded - * that board is non-DPAA. Single slot is currently supported. - */ -#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" - #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 From patchwork Tue Jan 9 13:22:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123945 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4019462qgn; Tue, 9 Jan 2018 05:25:17 -0800 (PST) X-Google-Smtp-Source: ACJfBotMxaOOwniWp/8jA0IIj6nGaejoyq+CKaaN345MZkuJPhBMw1aCdZ584gqcxOvc7KLl1mKF X-Received: by 10.28.134.193 with SMTP id i184mr1458269wmd.57.1515504317559; Tue, 09 Jan 2018 05:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504317; cv=none; d=google.com; s=arc-20160816; b=RZ2g3cyu1EFMIlgAbB4bOVMJzfR7HjMUT9+JyOImWxOOf6nBPh5LPX2UDcLYF+oDKl 6spQ8c73xQXcb+18RhJyb6tT5pF86NXSUzeHeRTN/HVCN6MVfmhvzd5WWnwMB4ak/xI+ 3avXjnLN7AZ0Gh37hWAG0mwa+hzyZ+7GdWZHjEz8LPXlDBmrFmBPwx3D1tm5SLbRNSd6 OgTi/z/bB5j0PVUrkSHmukdnnTU2qlTLo9js9uSn3RhLvOQLpHl9uYPmPTV5Gg4pdFdj A3lZCj+HzV6Q0gykCcJiNqPvkL8ttFBtnje5++qydzrfVMiqhScioR3XbbG1mlMkxwYe yyBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=CtElO0gBWn2gqpB+l76kxxBLWJyBChQUyKCirl/Mkjk=; b=ATYCpdm+AUl4IE4jPuZs9oxRRyd5A9pcu0IyoU8p8MoaGcdexzVyok1qFhdQR0VUpX /UQ5883xi1glstiZb8X9D7IVnWyw1V5XCxZQXTJPU/5r+aM86AeNIQqnYB5N+i9p3XvJ 5/e8bRS3LaxLWI1JHpxXMaO1WxwMinwPnwaGOfLsTRg164PmlcCGAyYiWutZb4ZXUOOB R9OiO/olNw6LTf4MO7c0XIdJU0OPzNJhLVv2JlQ4TlE+oJOu2KsNaIJechoEKWRRRF3f bHRKA1WtoUXMSZulG/Ta9yeGLB6PXED1mxL6cUgJLaQtcCLrpSe2YBH/1mZwfzrsWpzy gTaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id u9si9527920wmb.20.2018.01.09.05.25.17; Tue, 09 Jan 2018 05:25:17 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BDBDD1B1DB; Tue, 9 Jan 2018 14:24:32 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 0733A1B1CD for ; Tue, 9 Jan 2018 14:24:29 +0100 (CET) Received: from BN6PR03CA0085.namprd03.prod.outlook.com (2603:10b6:405:6f::23) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:29 +0000 Received: from BY2FFO11FD025.protection.gbl (2a01:111:f400:7c0c::147) by BN6PR03CA0085.outlook.office365.com (2603:10b6:405:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD025.mail.protection.outlook.com (10.1.15.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:52 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVm017638; Tue, 9 Jan 2018 06:24:20 -0700 From: Hemant Agrawal To: CC: , , Ashish Jain Date: Tue, 9 Jan 2018 18:52:52 +0530 Message-ID: <1515504186-13587-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778324079417; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(396003)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(86362001)(36756003)(6666003)(81166006)(8676002)(5660300001)(6916009)(2950100002)(81156014)(97736004)(4326008)(498600001)(51416003)(76176011)(48376002)(53936002)(85426001)(104016004)(8936002)(2351001)(305945005)(47776003)(54906003)(106466001)(77096006)(50466002)(50226002)(16586007)(356003)(8656006)(68736007)(2906002)(105606002)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD025; 1:MfxzSD3F2zs9LmWOJ38eWuEKn7JxytD1xvX5ZnqoVm9xdKgye0QSeLk8NL/uKoMojPNA9tlsatSElyCfUTkjLMBc/kCbuzs9tnexTVYNlR2kZF/7ENc42+9CxbUybWQY MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ea4fc2f-a2bd-4bab-e339-08d5576439fd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:bkRVwJVOEaXpFxsV1V62LmLX6pZcaJLxExp0Afvxh0o1UVFj0KYAn9dAr8vJ00SYB0fwKtH7Mdwa+iE3doxpbasiWtOPA+66/OEQ3WFyYOSTO3qwcoJ7jdctdqmIOnS9jLZ2VHKIn6mFrte29KRZA1/UejEfX7NVAAImIyguRNLbYihXvbDzeijWkBIZBwyTibTdqhUSAAM092sAW/eLWxLEovMXfHpErkMy+mVx/EIFsDiCx4DJma804Ai3lI5sK9kfxqp3iF4BRkZl9UE5sNLBmT5iVpw1CuBjz7T/r+Ddk0ldjf+7txzpR99V++N8t/O1p6smae50f3TeiLHABQ++iFamJ3SgaGwBjDWR+E8=; 25:q1NhgOwkdi9gwj52N/90RO23GsQUHv9EN1t3IJwhWTFgyFCAyMHy53HoDzy64s60skNM1EmN18dSHW3A8H4We5XaB00xvtRqKfsLG/S2kjVQElXvjou4v1jmWLhmdyt3bjILNkOi9jNKSNlsGLDZawIohLERuOkarKehSnpBObWkI3sRYzTIZykjSgAOkv8D4WuHehE1dlgGUC1k9ORxBvwkGcWt4FKFBAhwS1BN/fdryw9EdZ9YYcZji89l+rUF6tWgMtnSqztKwL8S0OCDdJYnCGAXddIFxxTkCoSXrdqawQI3mJPbomR0CeGEHafCtM1GhLOFaAf6YYd8d4RjnA== X-MS-TrafficTypeDiagnostic: SN2PR03MB2365: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 31:pgWFd7+Lho9yKIypUFXXbQ8RDDoqoVW9/f4ids1VPQLpzJsGG2Xlr4EsNOLGpsiz29s8nBZOOTyDic2Wluj6iVPoyu1jGHloKHylQ/FIBjAJHs8GUM2PWwvRTPDT+o+AV7HJFbnMQNLqzZp6NIKvKST1Sb0/OvRH516WlROok6pL7aUtgPcsUUeto++kL6WcDnxcx46t5vMBd2dirhLz/rVnazG7pjgDalEZ70FJk4E=; 4:XjCMmBf1RYCVBLiECpoW8dE7eh8hL1T+dvvGQUKkn3wXO8L5TFLxC6yZ2wVDF9f19W4F9XhRi9C085/E/ZwZqVFMXpJyCZH3+GzcyS3264bSQ/b8zJquzhuXPDy0pSAD4gGbqapHL4dS5uFfYqsh+Wgepvj1xPuRkhsxYQH8B5OuuC6WdZymNR44EvKyZlIcIsFQqbNp2yeoNrx7o191Qqb+cg9/2qn1bH4N4daOX5nq8uyNkzxDzcOzOEyjRZvOtZlqD5s8VOnM5n81nCFH37fBQ2hHq+AgqvuoyJmiaZ5cJLYWrTNQcUMsIqMSoQjj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:+g4DXC1DLlspetZhFrx5zSnybPS8iYTNxxO++ggB/?= 9UYF+QzE1nw7K8UiB8wceiB5jYDaUyRQiJZYaoQBdUCzP02LHDZtkpc7XNAW/kujnMUUBDgKfVWsNJVKc7jS1h+j5NLDV5KAOAF/RcxvRvxI5Lxy33lsPGww1y0t7yBwolFm1or+75A0fSq6yAHE1xNXIuJkYXd8keQc6lqfwdDewMn3/A9UxOajhvxW0bi33I39WBcqmqcidkKn4+5PsYx7na3iNqgpS0CXg4ui2ThYZg6m55YuZwrNm0ijVwuct2F4jQ4pbVxZevV/xThaGEgZotZSg6YiwzJ7LEGOlY+exBSJ36gjNsHOGu4NYaoDOEtMyDmpn/kj5yQ/561g/VamB6hqi8Ru5EXgUNu5NKqCULq38bThdQymkG2/hzalX1mKjWDTHDtQf9bbyQrmscEGr8yvfXdpIjRT9DbowofP0J30treifLrseKSxB3uD8XYrIGO96x0IZYi73R9VYUNtI/acp/T8DDQD3h+3ZbN/Xjv8jUhDZ2HyVsxlAG6RDLhBxWnbiNauTK99xP3SwBIDRKkVZhhLmxikRet4JHWh7bSnkwxwuwBVJgx3iM0H51qoeQf+U0vja99YCC4kWZP7BXeXXE/E8azWFg3XkLA94voj538IvHArnmT4fIeXWVNpypu5l1Pta2zvBsy9xK3KWyXlyJXPqDji3/07ik8u0mHHyE4y99pqQKvnjgKCZjhmenYnYJ76BXjA03Jsn3Z4hbcaqS9bsz11NgYd17x02c//SksTos/sFeh8f1GnNIYSgNcW7o3oq/cXTXvAPePY1JpEefSgSMZyPIRMZXYcGcrZdMMPIvDbgXBCVWKddsbsQpXLVvUrj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1j0cH71aBHY3EDfYBUqt0p2A/oMZVp0YKAhEWkb1GHNmAdAnI85dqSlOMDE/EhQndS5AD4sao/wQmFdPS2IB+2Ih4j SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:52.1895 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ea4fc2f-a2bd-4bab-e339-08d5576439fd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v2 04/18] net/dpaa: set the correct frame size in device MTU X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ashish Jain Setting correct frame size in dpaa_dev_mtu_set api call. Also setting correct max frame size in hardware in dev_configure for jumbo frames Signed-off-by: Ashish Jain Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++------- drivers/net/dpaa/dpaa_ethdev.h | 4 ++++ 2 files changed, 17 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 24943ef..5a2ea4f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -85,19 +85,21 @@ static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + + VLAN_TAG_SIZE; PMD_INIT_FUNC_TRACE(); - if (mtu < ETHER_MIN_MTU) + if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN) return -EINVAL; - if (mtu > ETHER_MAX_LEN) + if (frame_size > ETHER_MAX_LEN) dev->data->dev_conf.rxmode.jumbo_frame = 1; else dev->data->dev_conf.rxmode.jumbo_frame = 0; - dev->data->dev_conf.rxmode.max_rx_pkt_len = mtu; + dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size; - fman_if_set_maxfrm(dpaa_intf->fif, mtu); + fman_if_set_maxfrm(dpaa_intf->fif, frame_size); return 0; } @@ -105,15 +107,19 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { + struct dpaa_if *dpaa_intf = dev->data->dev_private; + PMD_INIT_FUNC_TRACE(); if (dev->data->dev_conf.rxmode.jumbo_frame == 1) { if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= - DPAA_MAX_RX_PKT_LEN) - return dpaa_mtu_set(dev, + DPAA_MAX_RX_PKT_LEN) { + fman_if_set_maxfrm(dpaa_intf->fif, dev->data->dev_conf.rxmode.max_rx_pkt_len); - else + return 0; + } else { return -1; + } } return 0; } diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 9c3b42c..548ccff 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -45,6 +45,10 @@ /*Maximum number of slots available in TX ring*/ #define MAX_TX_RING_SLOTS 8 +#ifndef VLAN_TAG_SIZE +#define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ +#endif + /* PCD frame queues */ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100 From patchwork Tue Jan 9 13:22:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123944 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4019212qgn; Tue, 9 Jan 2018 05:25:03 -0800 (PST) X-Google-Smtp-Source: ACJfBou/6oc5W6kr1ZQSuCJPMyNSrXayYJ8k5BKAkIXJyKISdogdBaGpBq+bnkNHaUXY82Yxjzqp X-Received: by 10.223.141.206 with SMTP id o72mr4960116wrb.0.1515504303440; Tue, 09 Jan 2018 05:25:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504303; cv=none; d=google.com; s=arc-20160816; b=GqM61UDFDIL1bWRS+DGCL53gynEhUo9FSZiECX5fdVZq9DdJkTDxj7GRCDwwvUobqx rPxMfSi42/hVAP6+vmLxzfX2kamJSrqzXkoTAb+zVucnsbC9GnB1pQMW5PamVG0fFxDz coPz3DJzHf7tRDb6q5uBrEyomLneyL4cJAajiXqRZDpddr3DtOSpxBZ3sFSQEGI2TbPv bFpz/RuE6GuuWMzBv2D0M3HBhRXvKJSFw3cY9Uy8D7+9VeRZ2VmYhzmjIbDxuX+eq6Q7 +67ZVoNu+OA5jsYS/wsgeXzYGZWNUGmjC1n2snDcuVhsKb+B1k0CCeJk9hs6CIk56rDg opkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=BSL9h33nNjMyt/qHpLIJSgzSuHgnVrFXDYDeDD1WQ0o=; b=nejaxaZjk9icBSGc62A0r/Uaa/k6pNESHDv2P43NeIRcucZQxP8lwTtib/s+kJ6a5x QthyTJFa8v7xkIGe4dYteMv3MmVL0KmkbR3hFbRvMgjlCY3zPvXysgcauLapdL//ifD0 dDVmVjvvflVWKygEszBuSKvYTTeeCP6VrZCP5rJ5mWZ0oUJy0999PfVsXMMBgB4IXYxz lJvtslNQYTkacsESsdymPkBpGyLjvRxyTPUmvOMyj+8De+EgWU87WQwyV2USZT0Z90Ac S02EkbFQO8i5ZnRaGSJf8orBG4lSJJwp3KkhWnDCD02NyPchH2Wox1/J3CSVOP/N8YGC VkpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 89si10668965wrg.320.2018.01.09.05.25.03; Tue, 09 Jan 2018 05:25:03 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9CDB31B1D6; Tue, 9 Jan 2018 14:24:31 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 39A451B1C3 for ; Tue, 9 Jan 2018 14:24:28 +0100 (CET) Received: from CY1PR03CA0016.namprd03.prod.outlook.com (10.174.128.26) by CO2PR03MB2358.namprd03.prod.outlook.com (10.166.93.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:27 +0000 Received: from BN1AFFO11FD040.protection.gbl (2a01:111:f400:7c10::112) by CY1PR03CA0016.outlook.office365.com (2603:10b6:600::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:27 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD040.mail.protection.outlook.com (10.58.52.251) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:54 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVn017638; Tue, 9 Jan 2018 06:24:22 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:52:53 +0530 Message-ID: <1515504186-13587-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778359801265; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(346002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(85426001)(50226002)(8676002)(81156014)(81166006)(8936002)(296002)(16586007)(54906003)(104016004)(316002)(2906002)(8656006)(6916009)(4326008)(6666003)(2950100002)(86362001)(106466001)(105606002)(2351001)(53936002)(5660300001)(77096006)(68736007)(97736004)(36756003)(51416003)(305945005)(50466002)(59450400001)(356003)(48376002)(47776003)(498600001)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2358; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD040; 1:f/qO+pdilLJZYZx/0hAdt3N31Yjv9dnE7ALyUGnw/x4W8jj/wZuduGJVQsRPmIieFKCGzLoOdqtIQxh+OKtZlu5VoGZQlEYGrpYTRpNTJKeZPN7MHHfomQQpCRgZhdlj MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7123d2bb-b595-46eb-f5b1-08d557643c1e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CO2PR03MB2358; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2358; 3:tte5kcksg1TJrzWGfpAL/Wc/UGr8oBrnAHQbvZUgS1cJpPNH+rQOGOpOjaEJFBJdPA7+Cpaumkhtp39KbSjcCvESZcwMSCXIcrWNru/9es6iMMksnnxVUlEQ1ECsEGGhcW6v3YoJMKqEZFHtUo8D2kuOwKRVMnb8zj3fvJISxu0l/dY3qI400xdr50v23qr2702jDwXeAncHiQt6NYLXPw7fOfbDC3p9B/DNhRDpRffK8mSPLOcWQyl4NMZWI6AZfan3YxqW1vzLplk3QN5p1iH8nMoDwQsOs/s2KR2XumXW+ztB67S80VB2CEdGY6WEdGuRx+Ks9+XWOCuzWxBq20P0pKNdzk+xkY5YccC07vc=; 25:7MusNW96cjuHBBS1MmiAstxIws5J3U3zMCcLjbQieatkqms5rDefa32Cs3Lq6EoKTufvJfSf1XcypQCTSmv2of7B0QyT8472PZQK4WZiuF3poXyvMnQRG3G2Tcpd2YE5hDlBxlaV5h6Fub6PuJW9s/Df7jYiC7fZJGZc4bXMh0Z2oAOy8YolVwRnbdVE0NWEZvCfcv4gNs5xRBoEVaKigXtjVtnv38oVQQRySI1iNL+3J30s7BRbsQJYbKQQgiGVdQKdQkekdZyjPDJqaD4kf78eEmuw0FUhc3vmKVQDVf1x9oM4dH7kKSS9cLjgm2bqxGpjgnSSU641j1tiSofJZA== X-MS-TrafficTypeDiagnostic: CO2PR03MB2358: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2358; 31:ApAvXFrfn4c4ipMuth2hviKpKE+Hc4o+gVPMvPDQD4vQYoJS5BSH0LlvGulAPMGl9jr51jL1rI4bABjrQ3TT6UrDJ/1GnyQL5lk1P4p5nN9xh2LpP0AKVFgevTkrecwC8uiaZaCugirHnxl+3c++2yoo/XWdFlk30+bdRGIo3C6SbzyLd+hOSCB0E6KbtTMYW6mNWjfeF+KZ6TKcr7ILDRANC2mqG2m1Up6SvYBE7DQ=; 4:Kd7g3kZpvszBlhIPTCpw+75G1yFBlDr35Unf+/oMaadfueujkX5j5XmH6EiVUV0GIMVMwKNsR8C7+yz5G4RJP69/Yk222V+YJ1KMBBAIKnVHTE0L1qQ1i7zl1O3gWJQ9bC7kceVtNYUhcUW14kucWmL6bGDqVqcCQIUQtvTBfszv7Un0qT38lWn1qBEUhHeBNYP+LLENtBQytyzqonaFOpd+THSnrpV4EDlJzGHx6lFClZThRm8cak5r3CJb/6MZuqRRCUnzf2dI5mYVYBr+5aoHEj5/k6cYLD89gf7FtZ5fJTIoPb3dg14qdmjvZxWxkaKW60jy/y5cT9glKKXLdw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(6055026)(6096035)(20161123565025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123563025)(20161123559100)(201708071742011); SRVR:CO2PR03MB2358; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CO2PR03MB2358; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2358; 23:B/fNUZOPCvOLCqOK1a8GoI6jVOIGB15qb3BNcxTGr?= Bl8o7lVBQbGLJdV6r+IYzWIQse9VE65o1/E9oLa/onGdVuMZfs5wVIS96mah6C2C5DvSiix4ek7sEQeZyOHVte6TN6aIfJGEMh6ctbXrkxknGebP+DOK4YkyvgDztL3PnIaF9pVkFhEK1OX+JzIU0hLEO4gcUltMexex/MO7d22TxncqX9cPoOinE57y/ggn+4Clhn/7UTnkymReRoUe5zOyFx7PBQpjZM0GTqRzdDwkB3xp+14zf8BJ4YfwsXrm/KsZj55GbSsnNe0eQJ1vWqGE/UtODYlNCICCYOYmCf6nvLV/Rh4zvdGrNHbtCZEdsjBT4En+CBdKnJUnRu5ygz35rzBRr70vzvaC5Ukr5iw/WXY4kd9q6Vx6zyfFolYbJIGedS6jioleTsCrfAlIE2P37pzfRLQIq2iHkY2kn16OOGOGPXntNn46Ghk6bhxM4NpGXnZ85FoVlwsRKOju73voTOcLJRCO0G4S6j8Jqx/B2ObasEqDOf68+cn25LY2Gi+pzEp9nwQiGtX+Sb4rU5MzIeDoSomXGcVbzXX19nhRiayGvdZ2pCbs/K+rUOHUYdP+jYuRkc05z+3euWObupzGZOx3hE4KALE5W/tWvFTNaZnUcZ+XnHbJPoE0c3kzIy5RYugg7dsYor/nncHuVMG4Etna0E8Ibazu5hMACy78Qiva7/00JYTv7bLpS2X6lpkV+REabbJmQyeSNlkoR01kqZMevcrQhmbueazzyBaELWOeE7SFt7snQffYVsrTwdzE6rrZGLD8nXJsYUuCV4ZzOlBpZXPjeZyjk6nEtHi9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XDb6VkpVtJyD/YiE0n4tAjLTShU6OvNt3RqmN/tIRsfnEw5GHTz9hJ8a8II9tpX1diSOQIPEv2enFPQLI0pGMT0eJIqPFSvbrcCp3L6EpzMsQSIVnZecor9tqMeqiMgAQ/AOvxuyyqaYt7m4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:54.4357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7123d2bb-b595-46eb-f5b1-08d557643c1e X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2358 Subject: [dpdk-dev] [PATCH v2 05/18] net/dpaa: add frame count based tail drop with CGR X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Replace the byte based tail queue congestion support with frame count based congestion groups. It can easily map to number of RX descriptors for a queue. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/rte_bus_dpaa_version.map | 5 ++ drivers/net/dpaa/dpaa_ethdev.c | 98 +++++++++++++++++++++++++++---- drivers/net/dpaa/dpaa_ethdev.h | 8 +-- 3 files changed, 97 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index eeeb458..f412362 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -69,6 +69,11 @@ DPDK_18.02 { global: dpaa_svr_family; + qman_alloc_cgrid_range; + qman_create_cgr; + qman_delete_cgr; + qman_modify_cgr; + qman_release_cgrid_range; local: *; } DPDK_17.11; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 5a2ea4f..5d94af5 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,6 +47,9 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +/* Per FQ Taildrop in frame count */ +static unsigned int td_threshold = CGR_RX_PERFQ_THRESH; + struct rte_dpaa_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; uint32_t offset; @@ -421,12 +424,13 @@ static void dpaa_eth_multicast_disable(struct rte_eth_dev *dev) static int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, - uint16_t nb_desc __rte_unused, + uint16_t nb_desc, unsigned int socket_id __rte_unused, const struct rte_eth_rxconf *rx_conf __rte_unused, struct rte_mempool *mp) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; PMD_INIT_FUNC_TRACE(); @@ -462,7 +466,23 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dpaa_intf->name, fd_offset, fman_if_get_fdoff(dpaa_intf->fif)); } - dev->data->rx_queues[queue_idx] = &dpaa_intf->rx_queues[queue_idx]; + + dev->data->rx_queues[queue_idx] = rxq; + + /* configure the CGR size as per the desc size */ + if (dpaa_intf->cgr_rx) { + struct qm_mcc_initcgr cgr_opts = {0}; + int ret; + + /* Enable tail drop with cgr on this queue */ + qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, nb_desc, 0); + ret = qman_modify_cgr(dpaa_intf->cgr_rx, 0, &cgr_opts); + if (ret) { + DPAA_PMD_WARN( + "rx taildrop modify fail on fqid %d (ret=%d)", + rxq->fqid, ret); + } + } return 0; } @@ -698,11 +718,21 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) } /* Initialise an Rx FQ */ -static int dpaa_rx_queue_init(struct qman_fq *fq, +static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, uint32_t fqid) { struct qm_mcc_initfq opts = {0}; int ret; + u32 flags = 0; + struct qm_mcc_initcgr cgr_opts = { + .we_mask = QM_CGR_WE_CS_THRES | + QM_CGR_WE_CSTD_EN | + QM_CGR_WE_MODE, + .cgr = { + .cstd_en = QM_CGR_EN, + .mode = QMAN_CGR_MODE_FRAME + } + }; PMD_INIT_FUNC_TRACE(); @@ -732,12 +762,24 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, opts.fqd.context_a.stashing.data_cl = DPAA_IF_RX_DATA_STASH; opts.fqd.context_a.stashing.context_cl = DPAA_IF_RX_CONTEXT_STASH; - /*Enable tail drop */ - opts.we_mask = opts.we_mask | QM_INITFQ_WE_TDTHRESH; - opts.fqd.fq_ctrl = opts.fqd.fq_ctrl | QM_FQCTRL_TDE; - qm_fqd_taildrop_set(&opts.fqd.td, CONG_THRESHOLD_RX_Q, 1); - - ret = qman_init_fq(fq, 0, &opts); + if (cgr_rx) { + /* Enable tail drop with cgr on this queue */ + qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, td_threshold, 0); + cgr_rx->cb = NULL; + ret = qman_create_cgr(cgr_rx, QMAN_CGR_FLAG_USE_INIT, + &cgr_opts); + if (ret) { + DPAA_PMD_WARN( + "rx taildrop init fail on rx fqid %d (ret=%d)", + fqid, ret); + goto without_cgr; + } + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = cgr_rx->cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } +without_cgr: + ret = qman_init_fq(fq, flags, &opts); if (ret) DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); return ret; @@ -819,6 +861,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) struct fm_eth_port_cfg *cfg; struct fman_if *fman_intf; struct fman_if_bpool *bp, *tmp_bp; + uint32_t cgrid[DPAA_MAX_NUM_PCD_QUEUES]; PMD_INIT_FUNC_TRACE(); @@ -855,10 +898,31 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->rx_queues = rte_zmalloc(NULL, sizeof(struct qman_fq) * num_rx_fqs, MAX_CACHELINE); + + /* If congestion control is enabled globally*/ + if (td_threshold) { + dpaa_intf->cgr_rx = rte_zmalloc(NULL, + sizeof(struct qman_cgr) * num_rx_fqs, MAX_CACHELINE); + + ret = qman_alloc_cgrid_range(&cgrid[0], num_rx_fqs, 1, 0); + if (ret != num_rx_fqs) { + DPAA_PMD_WARN("insufficient CGRIDs available"); + return -EINVAL; + } + } else { + dpaa_intf->cgr_rx = NULL; + } + for (loop = 0; loop < num_rx_fqs; loop++) { fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * DPAA_PCD_FQID_MULTIPLIER + loop; - ret = dpaa_rx_queue_init(&dpaa_intf->rx_queues[loop], fqid); + + if (dpaa_intf->cgr_rx) + dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; + + ret = dpaa_rx_queue_init(&dpaa_intf->rx_queues[loop], + dpaa_intf->cgr_rx ? &dpaa_intf->cgr_rx[loop] : NULL, + fqid); if (ret) return ret; dpaa_intf->rx_queues[loop].dpaa_intf = dpaa_intf; @@ -913,6 +977,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) DPAA_PMD_ERR("Failed to allocate %d bytes needed to " "store MAC addresses", ETHER_ADDR_LEN * DPAA_MAX_MAC_FILTER); + rte_free(dpaa_intf->cgr_rx); rte_free(dpaa_intf->rx_queues); rte_free(dpaa_intf->tx_queues); dpaa_intf->rx_queues = NULL; @@ -951,6 +1016,7 @@ static int dpaa_dev_uninit(struct rte_eth_dev *dev) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + int loop; PMD_INIT_FUNC_TRACE(); @@ -968,6 +1034,18 @@ dpaa_dev_uninit(struct rte_eth_dev *dev) if (dpaa_intf->fc_conf) rte_free(dpaa_intf->fc_conf); + /* Release RX congestion Groups */ + if (dpaa_intf->cgr_rx) { + for (loop = 0; loop < dpaa_intf->nb_rx_queues; loop++) + qman_delete_cgr(&dpaa_intf->cgr_rx[loop]); + + qman_release_cgrid_range(dpaa_intf->cgr_rx[loop].cgrid, + dpaa_intf->nb_rx_queues); + } + + rte_free(dpaa_intf->cgr_rx); + dpaa_intf->cgr_rx = NULL; + rte_free(dpaa_intf->rx_queues); dpaa_intf->rx_queues = NULL; diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 548ccff..f00a77a 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -34,10 +34,8 @@ #define DPAA_MIN_RX_BUF_SIZE 512 #define DPAA_MAX_RX_PKT_LEN 10240 -/* RX queue tail drop threshold - * currently considering 32 KB packets. - */ -#define CONG_THRESHOLD_RX_Q (32 * 1024) +/* RX queue tail drop threshold (CGR Based) in frame count */ +#define CGR_RX_PERFQ_THRESH 256 /*max mac filter for memac(8) including primary mac addr*/ #define DPAA_MAX_MAC_FILTER (MEMAC_NUM_OF_PADDRS + 1) @@ -53,6 +51,7 @@ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100 #define DPAA_DEFAULT_NUM_PCD_QUEUES 1 +#define DPAA_MAX_NUM_PCD_QUEUES 32 #define DPAA_IF_TX_PRIORITY 3 #define DPAA_IF_RX_PRIORITY 4 @@ -102,6 +101,7 @@ struct dpaa_if { char *name; const struct fm_eth_port_cfg *cfg; struct qman_fq *rx_queues; + struct qman_cgr *cgr_rx; struct qman_fq *tx_queues; struct qman_fq debug_queues[2]; uint16_t nb_rx_queues; From patchwork Tue Jan 9 13:22:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123943 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4018986qgn; Tue, 9 Jan 2018 05:24:50 -0800 (PST) X-Google-Smtp-Source: ACJfBosl5ISlT4OKy05m0I5fumq/cTPF3f31vyj2c2bM6HVkTg++QYv6ilvpr5rQWAWfobTm+m/z X-Received: by 10.28.65.135 with SMTP id o129mr13086291wma.94.1515504290344; Tue, 09 Jan 2018 05:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504290; cv=none; d=google.com; s=arc-20160816; b=YsqpgkO76UNKC5Gt53JXv7eaYP4Z47rcsKka6jQcfmN2m8oG7snx9Kxvx4vFBOVKCS vzsKSYQmIVkY8AlopzB60OKpSS9FWp/yv2IKllhBaZwEmOSb7I7gfO4n3kAIj5tMibzX 0e3kQZZvYh0QFtBFf+5nQ85bZG9hQPURhYkmIIvCnSSBuzSQQuZX0BnkWQpKVigqSzTG AvdOItqLd+EIX6jMJsRfpO8Yi/72160wn4O30hddj20eSJ7AQC4XuW7mFVKr2aQf7v4I ZupvCrMnzOrDaDNjAzNmUU3iWg6ruoXbSTTmZDo0KPGFnPLit68mCp/Uh1imf+vl6Jln PZBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=KDo8HpaKFQ9EuKjDn8IAJ6VOMjpWqV78mSlLCSDCkGE=; b=QQTXg38klY6a31HFmoTyKEZEr+iyiW/IxTYX8iNWB+Te2ILsw9LbgGitTjacTkXPFL 4RsR3PHPrkFCupqSewsuBdUaqgvbbQKvZqVYv3DJXG3hPzg47Qnt0ukDVmE0oE4BQf4a 6DvpL0AFu0Yc8GwpvqLMmti2oNO73StWrRpf5ucBaRgTjvPfQXfitUfh0RON801MS5rG 2yaiGtKSpFqyZh1569PJ+HwKOvhd60BL1i/K/ySAjwnpKET3+Trz+wNRlqAQkxNL5YTi IaUpi/mhcYHRE7goFxWuayjQj7OCBgPr+TbsUgHFHOAZlHL+QvgvBR7e5vAZCW6lKwnu OObw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id t3si10937222wrg.533.2018.01.09.05.24.49; Tue, 09 Jan 2018 05:24:50 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C89A71B1D1; Tue, 9 Jan 2018 14:24:30 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0040.outbound.protection.outlook.com [104.47.38.40]) by dpdk.org (Postfix) with ESMTP id BFAA71B1C3 for ; Tue, 9 Jan 2018 14:24:28 +0100 (CET) Received: from BN6PR03CA0023.namprd03.prod.outlook.com (10.168.230.161) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:27 +0000 Received: from BL2FFO11FD026.protection.gbl (2a01:111:f400:7c09::131) by BN6PR03CA0023.outlook.office365.com (2603:10b6:404:23::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:27 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD026.mail.protection.outlook.com (10.173.161.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:56 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVo017638; Tue, 9 Jan 2018 06:24:24 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:54 +0530 Message-ID: <1515504186-13587-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778367457518; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(39860400002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(77096006)(81166006)(16586007)(2906002)(97736004)(48376002)(51416003)(296002)(356003)(54906003)(316002)(305945005)(8676002)(81156014)(85426001)(50466002)(8656006)(86362001)(6666003)(5660300001)(4326008)(68736007)(6916009)(2351001)(104016004)(47776003)(36756003)(106466001)(50226002)(53936002)(105606002)(2950100002)(76176011)(8936002)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD026; 1:uIJPiSOSEgSrn5OeSLkIDwbazDV2bIXqf8SAXnTEgvbuCyybHwK/WutHsbtQ/VEArzRCssmJlYORgHM9QgfOvxAvL/hHwoNUvoqUvzGMKV5Mc8DdVW5bsElvlTNK7ssJ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d00093f5-5341-43e9-c8ee-08d557643c93 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:1Cp/rfTMb/IuEhWSyyO4rXChXnekHJpHfZ8C7QgduzWGvrwME5B1RoPhyDoiKI+EIANbTth+LaXWs1Ivr3mKLMQ3AqH5kX/ZpU4q4hvZp6ybqxCvYsKRA980wq2kW+iLfNi3meNyyLfm9kQ5fzYc52mOYZI4vnMsE6/OiLzPeB/5wwPns3o34F51rtu1vUCPHlE/gedmVHhEyXNUKU1iBgYIZzIKjhkYCi13nq8+RxosxkGt/7X2Z+cPRCExr0LFYbym/QVEGT+j3N01yqnzpiUlpCURxbIocuHZJdMkyCuoPexovfmmmxCYxiIx75fdoCBHkHt6mmwt9M0pcsHkEzjI6a9plQ8awTY+Yq9HQFE=; 25:2xBgMIs6umK0gDTiR/dAoQOliTiSx0kaf3LXf8GQtMhWI+sbRgaV/AvlMAt5gK05y2kx2h72S5UnnTr7+eb8ftQmQvPBAsHTftaxVPbgld6sL/bls5L2J7vzEaiWi2b4WfHYz/aZjtV57xlkzYMu2+Oh9CJ3GlmkrXoVgcnaNpOgO4BKkBMKVKZH6b8fog9LOc6aM6hjmkjfx/nL4fwRuc7vONjeEZWswZXMtHhvAR3W9FK1fIMs+2vAAGk/Xlm+neVuv1SvDNIVans5HbPdmulOrpJRiR/uoiREPhbcy/wEgefkq+/3AxMvuvoqq8ftQeN62svdJ65Sz0WkIC4/yg== X-MS-TrafficTypeDiagnostic: BN6PR03MB2689: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 31:Ns90HDGTm2cmvO25RZht+vp8Ijc5JWPcN3dxSyOjO1Gp1Ryue3AkRbV2zDjcQa/8+M4kboNcprPpCOtzcF5+KT16m9lrVwEAKx14qzHcAByWEhhWpKcJVoq/dO4VZ8Renbs213bAADSsQTvtLt+hRcnD5bI8LwIc5rtG7lKb9/45EvTNGe2tyt+Jp9hg0iwM5+3W8Jh4ieqEFL2ZKznFrJi00P9r/ViUtMUNNDYmjTY=; 4:7pE0mj45EPM5XaMtOZVng6u18/JqKX7k9VnmNr664TsZ6YHoLrBNE+xSpt/XVsvNSN25zgYfFf6a6mpzPqfNBj6mjC2oVwFBX6NVw27BkH+X7dDMt2s1RouN1tUXObttLd/jEBq9yP2L6tBwSeE8ucFJC9+FwQ8eIM1ijNZk1VpAvqeAAn5TB80xqxok80c0Zta2I6tJ/IEu/eCNIvIPqr3fJO3GMivDdEN5PQjbHFgCIVeFWNlfrgA0ZMo+tKA/ew1sSFJNr1LvqKjgdWV9dfzRk+4lGkN22P86BoUi9UGYwIcY7daXcV+mtUafxFOcgbXeRpkEsXdhtLP412hQbkAKrFamSHHN4RIYaxe5jxM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:p7K9lRkn99NZBctBlwuflvowdmxBfNXpv9BR8WPiy?= UlfTsFw1GwA2iFKGr2bA3dwb6htM7oeqIUZack91vU4BGnl1Z28lXMgdRKUAArwOzxMPoDm61MsVCRXsUbm/jHAP/KLm/2o10mv9n8KPp0FrPM5JqdLKfrlNAKtJwBjCRLZN84g8/lV3oJrf5A5fj+sX7P5bdlZ8BgK231oSNINO83J1wkfKuJSuVUKgtMqlSxKdgDYHmE97pGlGf/V8h/Z3PX2qrFctPFdS3JQDjsK+hSSKYhlTKVzvPy1qh3r1aa7ETXKLq9+MNIjljw5rohKQ0Du90oBnKHCaJ5Ll60oRJ70VJFaXf99YX9KSOQ+9nIel10Nh960/keI0Gcin8xih7pjSDXbBqRxjLzZkWEeyv+X2+aIVtAooz60iULn/Lcl7yggxPnlqJQAyHt8h4k1RcdIDDef/7zfujz5QcHxYrA62sD6UgLCYqCHrPvPvVkX+EqDmWUEyenRr2ugXsby2l9kGBtiqmRqsLnX5XMgqY9rN4w+swi/eNlFD0LX7kEwHsLD0KnBgLdA1K536jH22Rap5T11iRYSxsESs7KISvAQgV2xJda/w7Nkk1AxjRwvpzP/qb2wWMx25urN67F3Q5BbiMYnVS+vdCMDtp2avKr5/JH/3Tfhr1yehIEaCrZOo1HKYpdze3/IT0IxSA1uFW7m7FeY40ou0j0mx9rIwv2gf7ztrNrwPbq6iE528LQ26O9CvE5lHM1nSY2FhJwDxacVlkCVgIds3AupfNkXUiXIoQuLcTVirX2pN2cv//MuCN4relM4rhPUauq1q7LM9UiVJe47oF2x1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Fdqg+4j5YLi0e0GCQsmh5Odg5QS32Oig4SncrUVjIIGLEC+/FMCvGRcC4QtMV0+7+L8Ybkq0oEcoV9Yf9sfZ2VFbiYnwaxa8H8/cTyewp7GIAd6Rl5D8mhCAE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:56.5897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d00093f5-5341-43e9-c8ee-08d557643c93 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH v2 06/18] bus/dpaa: optimize the qman HW stashing settings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta The settings are tuned for performance. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index a53459f..49bc317 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -7,6 +7,7 @@ #include "qman.h" #include +#include /* Compilation constants */ #define DQRR_MAXFILL 15 @@ -503,7 +504,12 @@ struct qman_portal *qman_create_portal( p = &portal->p; - portal->use_eqcr_ci_stashing = ((qman_ip_rev >= QMAN_REV30) ? 1 : 0); + if (dpaa_svr_family == SVR_LS1043A_FAMILY) + portal->use_eqcr_ci_stashing = 3; + else + portal->use_eqcr_ci_stashing = + ((qman_ip_rev >= QMAN_REV30) ? 1 : 0); + /* * prep the low-level portal struct with the mapped addresses from the * config, everything that follows depends on it and "config" is more @@ -516,7 +522,7 @@ struct qman_portal *qman_create_portal( * and stash with high-than-DQRR priority. */ if (qm_eqcr_init(p, qm_eqcr_pvb, - portal->use_eqcr_ci_stashing ? 3 : 0, 1)) { + portal->use_eqcr_ci_stashing, 1)) { pr_err("Qman EQCR initialisation failed\n"); goto fail_eqcr; } From patchwork Tue Jan 9 13:22:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123946 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4019706qgn; Tue, 9 Jan 2018 05:25:31 -0800 (PST) X-Google-Smtp-Source: ACJfBovaZopcwDZ6DkM/CY3KGphhTMmrSU6h7NWiN1hccGGUuj28vf2bowoTKNPutQwXtWgT3UBV X-Received: by 10.223.151.41 with SMTP id r38mr4463875wrb.133.1515504330986; Tue, 09 Jan 2018 05:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504330; cv=none; d=google.com; s=arc-20160816; b=UpoLTBVKO/6SHeEST0EVPbXNpwOf+t+pOTPWikYndHi0Bs82KIrClgfPuwl0e4ye9Y GJhpeMLprZOCnbBMjsEiKQapdZHfEvCVrX0SExbVzMKSGV0EiD90YdY0EdWQFFjYI4J1 xjAuh3fjal5dWJUJJJTzhko3gTqPyV8koc74uY01NIvDTv61unQIRHHWtZo8w+nzXVUb 7+wBGlpjvtDEXfPVDLGCXy6hnqFS7UhM5YNngMXpzmQ+TDLyOSfydD3Rh8MJNrx0wlTq 4Ykj7buN7ZmUo2NeLIdkdG0B62P+nDNCx7H2w7IpkTClnh39jOsHcgDjze44y1UEhkez Rd0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=XPq1GzVkilHW3M0UKivqGgujNvD4mV6NDRerPZ7bmtU=; b=o25ekw14YsBZzJ2pPiUnUv9VeQtn02RYwXoE0hSAL72XS7JAlf1tl1d69yjEQVZCGL bQPtNTNHO3desYrbQVFfCMlhm2jxvrZwLK082OLe+zxSFvR4YCTjgYowcLRQm1dkw29K P6VPvo7DpfCAr2WM2brkEknNQ8Kb4jdEBsWKOO22aZCCn8aMoStbRQ9VU1QMvifmLdxI yCLIiSizP4//X6syIWqECd0ObySjQaaQ4fuMMJn1tdXEgq0XaigpOvE+yfCJ8rlsi658 S9vEYu/4u78be90HNQI2BH2vqYHd9CgARNcE2fUiU/bZr1Zg/bWIFp+EMvKYuEsdisoj oLCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 18si11070648wrv.418.2018.01.09.05.25.30; Tue, 09 Jan 2018 05:25:30 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 695211B1E3; Tue, 9 Jan 2018 14:24:34 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 70DE01B1AB for ; Tue, 9 Jan 2018 14:24:30 +0100 (CET) Received: from CY1PR03CA0001.namprd03.prod.outlook.com (2603:10b6:600::11) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:29 +0000 Received: from BL2FFO11OLC004.protection.gbl (2a01:111:f400:7c09::124) by CY1PR03CA0001.outlook.office365.com (2603:10b6:600::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC004.mail.protection.outlook.com (10.173.161.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:58 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVp017638; Tue, 9 Jan 2018 06:24:26 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:55 +0530 Message-ID: <1515504186-13587-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778390729436; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(396003)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(86362001)(36756003)(6666003)(81166006)(8676002)(5660300001)(6916009)(2950100002)(81156014)(97736004)(4326008)(498600001)(51416003)(76176011)(48376002)(53936002)(85426001)(104016004)(8936002)(2351001)(305945005)(47776003)(54906003)(106466001)(77096006)(50466002)(50226002)(16586007)(356003)(8656006)(59450400001)(68736007)(2906002)(105606002)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC004; 1:skt4KRFRE7BuUdK8rPfZqxvg+EfuuMf1yXmgvo9czdWp3w4v8tI+yaCBvyJ2QgESIsrRA2rg+RrXln1pjyD/Aw17g0e1GR0U99NHGNWJcW+sNHfh39ynN1AQ+1gCjdqK MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ab4e2eb-a06b-4d85-8181-08d557643df4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:DQA1yVbFaHZpE/YBq+xt5TP9Zr8RuCyFk+46vgm59BtYiEnsvoupxVMlg4Sk6/7Qcy+aZ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0ZcS0o9qvDTs6otseSoPwA95NE9OLrt4oXHnE4wsE2DCkV/90K6T9n/dasUKwd3fq4YMSjzDCZXDeAqrfjGoyL+OMLPGOGSNquL5YhzrPoMSgVdBW0XYWFZym6zI3CX0i4+wzPJ4A6Yt9J1ngvte+miZC5wmBEmozouCS4j5JiYn1h3owWDXzDnUVEc7Pg4iv18TTV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:q3nN6BQw0RSD/2UMZscS2aFDLT1WcIrGSV1tg9mxg?= 2/rjGXmvXhb0PvL/6ogjDha7yGYqVAt6/Y7hQWKHJpXDCmKdkUvzvfgJUAgj6rY7DvUdWrfSdng73ASdhVHQttVB4ElmOX/hmPH/efPINJtsDGoFo2MHnpIw3cT8cjAI56ynkMXHZwFLV6VwFQtBQXYwMbK/BbnZGX7/Sn6sAG4W8rgL+AePeWIdGfSM/G0x9JJw0z9noe5rc07ti+NaAlt7bQqHI6xuARoegHa54VhX9WVqk3ug++WMbI60UBaYP67Hz2X0se6l/d+Kp5bdwpY4uFP8dteYZ0TgKrMC+XpqeE6PixK74AojqtQMu47v74Alu5eaZ+kUqOta98et/KS+TPph3i1VwMMYMDIVTyJP6ZVubbmhkkwzCgxdCRqRdD/XW82QZ3HcCEr68sfFSMDxxjN6SyO6ynTbizMLCE0gAsFyv5TP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kEEHtph9+nQWrOnXUAaw20WKIhxFGAfrjpZnDjDSKJgtFiFzN3cATmKcAlRMMhCwkKsTMTP4ASNIeS9Gdy4FXDNKPMmWiCg1ZzOUPUCXK8/xi6pAfcNltNKjxygYRerUc+CtnpvkIP7ffDVG6q7n0R2tt6lX/k6g=; 24:gLLd7pwnGudV3OupEJ55vRVoHanf1GzwWRb1elqFpZs6oQe8jPMI9zTChAM7FGIvfLsXZPKV1UA5+X1DtVOlI5gGxn+dqnv69bQ/s9IAHcA=; 7:s+TdIh+2jJLJ8Q248Z+2NaonrKktp03n6oi6JvBnrJ5r0zR67DRlFV/7vXTdNtJALanI5ou+GDb1YqNGn62odPE/WfOTovmCqm/5BK8Hruhm4ic7ZqeY1m9qUx98anbIkEfeeJbygTVzPEIqFUX64e1kRzEh67tsTWvWa2mT9ZvQHvKPE0ZaoiE6cfFLXhfH/rj3p/6wzcX6KsMpPfxhxr+bnFjLvEGV3DELwfrBYZy+mZ7uGxWuakHSxPbWcC0y SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:58.9013 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ab4e2eb-a06b-4d85-8181-08d557643df4 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v2 07/18] bus/dpaa: optimize the endianness conversions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 7 ++++--- drivers/bus/dpaa/include/fsl_qman.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 49bc317..b6fd40b 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -906,7 +906,7 @@ static inline unsigned int __poll_portal_fast(struct qman_portal *p, do { qm_dqrr_pvb_update(&p->p); dq = qm_dqrr_current(&p->p); - if (!dq) + if (unlikely(!dq)) break; #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ /* If running on an LE system the fields of the @@ -1165,6 +1165,7 @@ int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq) } spin_lock_init(&fq->fqlock); fq->fqid = fqid; + fq->fqid_le = cpu_to_be32(fqid); fq->flags = flags; fq->state = qman_fq_state_oos; fq->cgr_groupid = 0; @@ -1953,7 +1954,7 @@ int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags) int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, - int frames_to_send) + int frames_to_send) { struct qman_portal *p = get_affine_portal(); struct qm_portal *portal = &p->p; @@ -1975,7 +1976,7 @@ int qman_enqueue_multi(struct qman_fq *fq, /* try to send as many frames as possible */ while (eqcr->available && frames_to_send--) { - eq->fqid = cpu_to_be32(fq->fqid); + eq->fqid = fq->fqid_le; #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP eq->tag = cpu_to_be32(fq->key); #else diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 5830ad5..5027230 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1197,6 +1197,8 @@ struct qman_fq { */ spinlock_t fqlock; u32 fqid; + u32 fqid_le; + /* DPDK Interface */ void *dpaa_intf; From patchwork Tue Jan 9 13:22:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123947 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4019974qgn; Tue, 9 Jan 2018 05:25:46 -0800 (PST) X-Google-Smtp-Source: ACJfBosaiPnRLljdIUDCkXnHGI1dHN5O4ANxwN3Jy8PfvNlsy5yb7hDON3JSTKekNZh6p2XQFvby X-Received: by 10.28.139.5 with SMTP id n5mr11515628wmd.23.1515504346811; Tue, 09 Jan 2018 05:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504346; cv=none; d=google.com; s=arc-20160816; b=WRjJfVvV83oxv/JMuU0/aIhmvFRsmdmExvhldEtsvKLp6DDtbncVwEgiB8l/YNjYAp btNSXczXIWXgS8IsYpLlgcl2JJ69ShLwJlRz3a4+kgPSoXeBjXeEt3CuHmvzefVeSI92 yEsKMbNu8rnxR3BCGENVsM0Dbbb6tjz+M/BoMm1O+9TePZUOO+ql7vn5Q7Kj4c9hT6OE jpInmgK7CwMLd0vNfUhnx85zKai0NDNPMFEdUeUmAj8c9X26zpJzLdXA/UmlQ/4fczky pbpZYxbjw5AEtSAWv54kXxH8svdN7OdtWeF1bAO/+Xsn6rBQJGXc8piiybRTA4g7hJE7 yPnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=V7rp6wNF3NNatQqorQnGLtza0gxG9pkOL7ZByVMe1CQ=; b=mEqIzUDl4+YpiUW6BI5hmmTEevW528xdHHff7JL2U89/HFnJDE7XiN88kyS8v5HpT6 LWKebjJ+tEopv20bd7lvL4F6cz3K5S74AhlQpHK1y8FR/FepJ6ThrEzUf3rs8GxJIRA9 pVygO+2RGZwLF1QuU8YXU0g5Uqmnrm7XFDI26kqssV4ywwOjBfpYBKZd+88NC3IK0EAP 4WWm7Va9LLQg6SNq7rss/5zHPXlQmCPrDcVBeVa5iTGQ89quzTpOAsNvNitVbnld1sol Q62eylLYesOtUnGXhR4RFQzy9V1Rhmbnutp3x6D9Br6Ya0HHawpftJ42pNWym1nLCaCZ 22DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id f13si9453321wme.12.2018.01.09.05.25.46; Tue, 09 Jan 2018 05:25:46 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38B471B1DA; Tue, 9 Jan 2018 14:24:37 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0085.outbound.protection.outlook.com [104.47.42.85]) by dpdk.org (Postfix) with ESMTP id 7B21A1B1E4 for ; Tue, 9 Jan 2018 14:24:34 +0100 (CET) Received: from MWHPR03CA0038.namprd03.prod.outlook.com (10.174.173.155) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:32 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:174) by MWHPR03CA0038.outlook.office365.com (2603:10b6:301:3b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:00 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVq017638; Tue, 9 Jan 2018 06:24:29 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:52:56 +0530 Message-ID: <1515504186-13587-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778411114696; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(296002)(305945005)(68736007)(498600001)(4326008)(16586007)(8936002)(77096006)(316002)(356003)(50226002)(81166006)(59450400001)(86362001)(106466001)(81156014)(36756003)(105606002)(8676002)(47776003)(2351001)(104016004)(6666003)(2906002)(5660300001)(54906003)(53936002)(575784001)(8656006)(76176011)(2950100002)(50466002)(48376002)(6916009)(85426001)(97736004)(51416003)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:Hax4T7MQstKLcl2wxTkbTRXzR1PY346GjXaEN3L8BobFvMqp+Y59h6GsR3GEKV8cHNK5TVxBlZLCerN9UbAc/6K7kzrtQQ+trdB0mJ6cSQyylWzzSPqzT0g6yEa24lao MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 182629dc-4301-440f-f0c8-08d557643f2d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:rn6tbIXUsYmdMrbRbH9YX+7iqzs1gZxlIBXOXHUijU4iha7eOIjvfeJAXlgBN15Y2P3Y25WvqH7CH21gmG0n4nAG876igVX0mGkDziKE+KjyR8SUHQ7xSoICJX9VI15ZJm+UJzeS0GaCUhLrPap7ErkjWrxyu9xGLUtYTCAbxVrD1G8M7oPQdsp99MyqI7Vu8fUU2xCDYTiAoLSAZOQeKxvsIrh91z5yuiaGgrcXzw1XKf4b+o7fRYhBltwuRtGsY/hMZxYz1wrCs/RpF/JNqolad3mAVfPQFAMI+g4sUSwB2lTF6YnuaE+Z706z/8Th1EbuNEPGtPr6YzKcuXHJ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: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:V1P7Z0kKv/pkGNeh0eKNkSw/XZ3iHnkWAt/lePNCx?= g3iFAdGIKA6kzo7YM2nOIKvdkIo84drjDevRe+PAwN+wF94lFEkBuTzDLjbZ2At5FTQoIwKgEHQiw6vAo2bBdgHVI7DyR7967Qlbas0pdQXu7ErjzkS+qo9uSLA6LITEC38Im87nroqItmYPPctsUO3AWlgMRzeAD6TFSQLAaOqIMa/JjcOOpa3GJLaZXGAmbl0RMu707GSzIEvkKmsl9oLz9JXsJ32TIJDT9gXs6JgVo+6Oh8tqvyF2tYMO4KnWGR3t2DBiULVT58ti4sWQzsZwiaZL2m4UZb08LBnEQbvvM0NjqJ23lKOUfG1Tx1ZZztsdzr0D27DyoDQM7bcDYPRPvK6/Ft8UvD4YuecuyrJT33QfBFpT7Wtbyut4YoC+6pOhBl7BCugyi40q352WFnI0PewnQa0LK99rCOpnO470a1FiMaZKzFm0qHNs6u1NqoF6q5uVfzS9ka01HOPmnAK1dy0MN82G4uB6ROfsMxnHRCZBZkuuDO3mcQxCzhhUyOAotXPSIbfKY7qm6OI/trKi0eAnm9+u1eE+FV577zfbuqTrblq79jD7opfe/3372PFKfj0dPLDJZocYe6/Jyn93yKr6zAGOMLNE4gNxoF3i7bPM6fOZSfgw0tpnwVn+f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mKyevrCVI4sYus79w3XjAK6d0bf4Qv2bT83iszqy+ZmlLDraZil5N3M9270KVm/LDvwS3iKAx0GSIeKZX5Pkg7pTrT7RqJhWvG/eVQ=; 7:+c8XIPfej8Juv66th29xfWNhsLGft3qGxMSafE/3BjYB1HypYeVn+QTueYRvipg7cmDkVPDg2hqBuJmNVZ1DUJCbJzaPAFm6HZ/5yFmgL+k5MEwOj/0iiYtdtaDdnD/0zQ9mIWAGVMWM2Tb5mElHxP8uo+Vf95EYy9I5M8V05DViQuSx6wRN0LbJOH+y3DLtT5wje9v/yxHTC+m8XDU2Bsvyyaw6M+WdSrOwkiNVV4O2ERgtN7cg2HZp0iOQPFNp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:00.9398 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 182629dc-4301-440f-f0c8-08d557643f2d X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH v2 08/18] bus/dpaa: add support to create dynamic HW portal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" HW portal is a processing context in DPAA. This patch allow creation of a queue specific HW portal context. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 69 ++++++++++++-- drivers/bus/dpaa/base/qbman/qman_driver.c | 153 +++++++++++++++++++++++++----- drivers/bus/dpaa/base/qbman/qman_priv.h | 6 +- drivers/bus/dpaa/dpaa_bus.c | 31 +++++- drivers/bus/dpaa/include/fsl_qman.h | 25 ++--- drivers/bus/dpaa/include/fsl_usd.h | 4 + drivers/bus/dpaa/include/process.h | 11 ++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 + drivers/bus/dpaa/rte_dpaa_bus.h | 4 + 9 files changed, 252 insertions(+), 53 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index b6fd40b..d8fb25a 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -621,11 +621,52 @@ struct qman_portal *qman_create_portal( return NULL; } +#define MAX_GLOBAL_PORTALS 8 +static struct qman_portal global_portals[MAX_GLOBAL_PORTALS]; +static int global_portals_used[MAX_GLOBAL_PORTALS]; + +static struct qman_portal * +qman_alloc_global_portal(void) +{ + unsigned int i; + + for (i = 0; i < MAX_GLOBAL_PORTALS; i++) { + if (global_portals_used[i] == 0) { + global_portals_used[i] = 1; + return &global_portals[i]; + } + } + pr_err("No portal available (%x)\n", MAX_GLOBAL_PORTALS); + + return NULL; +} + +static int +qman_free_global_portal(struct qman_portal *portal) +{ + unsigned int i; + + for (i = 0; i < MAX_GLOBAL_PORTALS; i++) { + if (&global_portals[i] == portal) { + global_portals_used[i] = 0; + return 0; + } + } + return -1; +} + struct qman_portal *qman_create_affine_portal(const struct qm_portal_config *c, - const struct qman_cgrs *cgrs) + const struct qman_cgrs *cgrs, + int alloc) { struct qman_portal *res; - struct qman_portal *portal = get_affine_portal(); + struct qman_portal *portal; + + if (alloc) + portal = qman_alloc_global_portal(); + else + portal = get_affine_portal(); + /* A criteria for calling this function (from qman_driver.c) is that * we're already affine to the cpu and won't schedule onto another cpu. */ @@ -675,13 +716,18 @@ void qman_destroy_portal(struct qman_portal *qm) spin_lock_destroy(&qm->cgr_lock); } -const struct qm_portal_config *qman_destroy_affine_portal(void) +const struct qm_portal_config * +qman_destroy_affine_portal(struct qman_portal *qp) { /* We don't want to redirect if we're a slave, use "raw" */ - struct qman_portal *qm = get_affine_portal(); + struct qman_portal *qm; const struct qm_portal_config *pcfg; int cpu; + if (qp == NULL) + qm = get_affine_portal(); + else + qm = qp; pcfg = qm->config; cpu = pcfg->cpu; @@ -690,6 +736,9 @@ const struct qm_portal_config *qman_destroy_affine_portal(void) spin_lock(&affine_mask_lock); CPU_CLR(cpu, &affine_mask); spin_unlock(&affine_mask_lock); + + qman_free_global_portal(qm); + return pcfg; } @@ -1096,27 +1145,27 @@ void qman_start_dequeues(void) qm_dqrr_set_maxfill(&p->p, DQRR_MAXFILL); } -void qman_static_dequeue_add(u32 pools) +void qman_static_dequeue_add(u32 pools, struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); pools &= p->config->pools; p->sdqcr |= pools; qm_dqrr_sdqcr_set(&p->p, p->sdqcr); } -void qman_static_dequeue_del(u32 pools) +void qman_static_dequeue_del(u32 pools, struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); pools &= p->config->pools; p->sdqcr &= ~pools; qm_dqrr_sdqcr_set(&p->p, p->sdqcr); } -u32 qman_static_dequeue_get(void) +u32 qman_static_dequeue_get(struct qman_portal *qp) { - struct qman_portal *p = get_affine_portal(); + struct qman_portal *p = qp ? qp : get_affine_portal(); return p->sdqcr; } diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index c17d15f..7cfa8ee 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -24,8 +24,8 @@ void *qman_ccsr_map; /* The qman clock frequency */ u32 qman_clk; -static __thread int fd = -1; -static __thread struct qm_portal_config pcfg; +static __thread int qmfd = -1; +static __thread struct qm_portal_config qpcfg; static __thread struct dpaa_ioctl_portal_map map = { .type = dpaa_portal_qman }; @@ -44,16 +44,16 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) error(0, ret, "pthread_getaffinity_np()"); return ret; } - pcfg.cpu = -1; + qpcfg.cpu = -1; for (loop = 0; loop < CPU_SETSIZE; loop++) if (CPU_ISSET(loop, &cpuset)) { - if (pcfg.cpu != -1) { + if (qpcfg.cpu != -1) { pr_err("Thread is not affine to 1 cpu\n"); return -EINVAL; } - pcfg.cpu = loop; + qpcfg.cpu = loop; } - if (pcfg.cpu == -1) { + if (qpcfg.cpu == -1) { pr_err("Bug in getaffinity handling!\n"); return -EINVAL; } @@ -65,36 +65,36 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) error(0, ret, "process_portal_map()"); return ret; } - pcfg.channel = map.channel; - pcfg.pools = map.pools; - pcfg.index = map.index; + qpcfg.channel = map.channel; + qpcfg.pools = map.pools; + qpcfg.index = map.index; /* Make the portal's cache-[enabled|inhibited] regions */ - pcfg.addr_virt[DPAA_PORTAL_CE] = map.addr.cena; - pcfg.addr_virt[DPAA_PORTAL_CI] = map.addr.cinh; + qpcfg.addr_virt[DPAA_PORTAL_CE] = map.addr.cena; + qpcfg.addr_virt[DPAA_PORTAL_CI] = map.addr.cinh; - fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); - if (fd == -1) { + qmfd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); + if (qmfd == -1) { pr_err("QMan irq init failed\n"); process_portal_unmap(&map.addr); return -EBUSY; } - pcfg.is_shared = is_shared; - pcfg.node = NULL; - pcfg.irq = fd; + qpcfg.is_shared = is_shared; + qpcfg.node = NULL; + qpcfg.irq = qmfd; - portal = qman_create_affine_portal(&pcfg, NULL); + portal = qman_create_affine_portal(&qpcfg, NULL, 0); if (!portal) { pr_err("Qman portal initialisation failed (%d)\n", - pcfg.cpu); + qpcfg.cpu); process_portal_unmap(&map.addr); return -EBUSY; } irq_map.type = dpaa_portal_qman; irq_map.portal_cinh = map.addr.cinh; - process_portal_irq_map(fd, &irq_map); + process_portal_irq_map(qmfd, &irq_map); return 0; } @@ -103,10 +103,10 @@ static int fsl_qman_portal_finish(void) __maybe_unused const struct qm_portal_config *cfg; int ret; - process_portal_irq_unmap(fd); + process_portal_irq_unmap(qmfd); - cfg = qman_destroy_affine_portal(); - DPAA_BUG_ON(cfg != &pcfg); + cfg = qman_destroy_affine_portal(NULL); + DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); if (ret) error(0, ret, "process_portal_unmap()"); @@ -128,14 +128,119 @@ int qman_thread_finish(void) void qman_thread_irq(void) { - qbman_invoke_irq(pcfg.irq); + qbman_invoke_irq(qpcfg.irq); /* Now we need to uninhibit interrupts. This is the only code outside * the regular portal driver that manipulates any portal register, so * rather than breaking that encapsulation I am simply hard-coding the * offset to the inhibit register here. */ - out_be32(pcfg.addr_virt[DPAA_PORTAL_CI] + 0xe0c, 0); + out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0xe0c, 0); +} + +struct qman_portal *fsl_qman_portal_create(void) +{ + cpu_set_t cpuset; + struct qman_portal *res; + + struct qm_portal_config *q_pcfg; + int loop, ret; + struct dpaa_ioctl_irq_map irq_map; + struct dpaa_ioctl_portal_map q_map = {0}; + int q_fd; + + q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); + if (!q_pcfg) { + error(0, -1, "q_pcfg kzalloc failed"); + return NULL; + } + + /* Verify the thread's cpu-affinity */ + ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), + &cpuset); + if (ret) { + error(0, ret, "pthread_getaffinity_np()"); + return NULL; + } + + q_pcfg->cpu = -1; + for (loop = 0; loop < CPU_SETSIZE; loop++) + if (CPU_ISSET(loop, &cpuset)) { + if (q_pcfg->cpu != -1) { + pr_err("Thread is not affine to 1 cpu\n"); + return NULL; + } + q_pcfg->cpu = loop; + } + if (q_pcfg->cpu == -1) { + pr_err("Bug in getaffinity handling!\n"); + return NULL; + } + + /* Allocate and map a qman portal */ + q_map.type = dpaa_portal_qman; + q_map.index = QBMAN_ANY_PORTAL_IDX; + ret = process_portal_map(&q_map); + if (ret) { + error(0, ret, "process_portal_map()"); + return NULL; + } + q_pcfg->channel = q_map.channel; + q_pcfg->pools = q_map.pools; + q_pcfg->index = q_map.index; + + /* Make the portal's cache-[enabled|inhibited] regions */ + q_pcfg->addr_virt[DPAA_PORTAL_CE] = q_map.addr.cena; + q_pcfg->addr_virt[DPAA_PORTAL_CI] = q_map.addr.cinh; + + q_fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY); + if (q_fd == -1) { + pr_err("QMan irq init failed\n"); + goto err1; + } + + q_pcfg->irq = q_fd; + + res = qman_create_affine_portal(q_pcfg, NULL, true); + if (!res) { + pr_err("Qman portal initialisation failed (%d)\n", + q_pcfg->cpu); + goto err2; + } + + irq_map.type = dpaa_portal_qman; + irq_map.portal_cinh = q_map.addr.cinh; + process_portal_irq_map(q_fd, &irq_map); + + return res; +err2: + close(q_fd); +err1: + process_portal_unmap(&q_map.addr); + return NULL; +} + +int fsl_qman_portal_destroy(struct qman_portal *qp) +{ + const struct qm_portal_config *cfg; + struct dpaa_portal_map addr; + int ret; + + cfg = qman_destroy_affine_portal(qp); + kfree(qp); + + process_portal_irq_unmap(cfg->irq); + + addr.cena = cfg->addr_virt[DPAA_PORTAL_CE]; + addr.cinh = cfg->addr_virt[DPAA_PORTAL_CI]; + + ret = process_portal_unmap(&addr); + if (ret) + pr_err("process_portal_unmap() (%d)\n", ret); + + kfree((void *)cfg); + + return ret; } int qman_global_init(void) diff --git a/drivers/bus/dpaa/base/qbman/qman_priv.h b/drivers/bus/dpaa/base/qbman/qman_priv.h index db0b310..9e4471e 100644 --- a/drivers/bus/dpaa/base/qbman/qman_priv.h +++ b/drivers/bus/dpaa/base/qbman/qman_priv.h @@ -146,8 +146,10 @@ int qm_get_wpm(int *wpm); struct qman_portal *qman_create_affine_portal( const struct qm_portal_config *config, - const struct qman_cgrs *cgrs); -const struct qm_portal_config *qman_destroy_affine_portal(void); + const struct qman_cgrs *cgrs, + int alloc); +const struct qm_portal_config * +qman_destroy_affine_portal(struct qman_portal *q); struct qm_portal_config *qm_get_unused_portal(void); struct qm_portal_config *qm_get_unused_portal_idx(uint32_t idx); diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index a7c05b3..329a125 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -264,8 +264,7 @@ _dpaa_portal_init(void *arg) * rte_dpaa_portal_init - Wrapper over _dpaa_portal_init with thread level check * XXX Complete this */ -int -rte_dpaa_portal_init(void *arg) +int rte_dpaa_portal_init(void *arg) { if (unlikely(!RTE_PER_LCORE(_dpaa_io))) return _dpaa_portal_init(arg); @@ -273,6 +272,34 @@ rte_dpaa_portal_init(void *arg) return 0; } +int +rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq) +{ + /* Affine above created portal with channel*/ + u32 sdqcr; + struct qman_portal *qp; + + if (unlikely(!RTE_PER_LCORE(_dpaa_io))) + _dpaa_portal_init(arg); + + /* Initialise qman specific portals */ + qp = fsl_qman_portal_create(); + if (!qp) { + DPAA_BUS_LOG(ERR, "Unable to alloc fq portal"); + return -1; + } + fq->qp = qp; + sdqcr = QM_SDQCR_CHANNELS_POOL_CONV(fq->ch_id); + qman_static_dequeue_add(sdqcr, qp); + + return 0; +} + +int rte_dpaa_portal_fq_close(struct qman_fq *fq) +{ + return fsl_qman_portal_destroy(fq->qp); +} + void dpaa_portal_finish(void *arg) { diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 5027230..fc00d8d 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1190,21 +1190,24 @@ struct qman_fq_cb { struct qman_fq { /* Caller of qman_create_fq() provides these demux callbacks */ struct qman_fq_cb cb; - /* - * These are internal to the driver, don't touch. In particular, they - * may change, be removed, or extended (so you shouldn't rely on - * sizeof(qman_fq) being a constant). - */ - spinlock_t fqlock; - u32 fqid; + u32 fqid_le; + u16 ch_id; + u8 cgr_groupid; + u8 is_static; /* DPDK Interface */ void *dpaa_intf; + /* affined portal in case of static queue */ + struct qman_portal *qp; + volatile unsigned long flags; + enum qman_fq_state state; - int cgr_groupid; + u32 fqid; + spinlock_t fqlock; + struct rb_node node; #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP u32 key; @@ -1383,7 +1386,7 @@ void qman_start_dequeues(void); * (SDQCR). The requested pools are limited to those the portal has dequeue * access to. */ -void qman_static_dequeue_add(u32 pools); +void qman_static_dequeue_add(u32 pools, struct qman_portal *qm); /** * qman_static_dequeue_del - Remove pool channels from the portal SDQCR @@ -1393,7 +1396,7 @@ void qman_static_dequeue_add(u32 pools); * register (SDQCR). The requested pools are limited to those the portal has * dequeue access to. */ -void qman_static_dequeue_del(u32 pools); +void qman_static_dequeue_del(u32 pools, struct qman_portal *qp); /** * qman_static_dequeue_get - return the portal's current SDQCR @@ -1402,7 +1405,7 @@ void qman_static_dequeue_del(u32 pools); * entire register is returned, so if only the currently-enabled pool channels * are desired, mask the return value with QM_SDQCR_CHANNELS_POOL_MASK. */ -u32 qman_static_dequeue_get(void); +u32 qman_static_dequeue_get(struct qman_portal *qp); /** * qman_dca - Perform a Discrete Consumption Acknowledgment diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h index ada92f2..e183617 100644 --- a/drivers/bus/dpaa/include/fsl_usd.h +++ b/drivers/bus/dpaa/include/fsl_usd.h @@ -67,6 +67,10 @@ void bman_thread_irq(void); int qman_global_init(void); int bman_global_init(void); +/* Direct portal create and destroy */ +struct qman_portal *fsl_qman_portal_create(void); +int fsl_qman_portal_destroy(struct qman_portal *qp); + #ifdef __cplusplus } #endif diff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h index 079849b..d9ec94e 100644 --- a/drivers/bus/dpaa/include/process.h +++ b/drivers/bus/dpaa/include/process.h @@ -39,6 +39,11 @@ enum dpaa_portal_type { dpaa_portal_bman, }; +struct dpaa_portal_map { + void *cinh; + void *cena; +}; + struct dpaa_ioctl_portal_map { /* Input parameter, is a qman or bman portal required. */ enum dpaa_portal_type type; @@ -50,10 +55,8 @@ struct dpaa_ioctl_portal_map { /* Return value if the map succeeds, this gives the mapped * cache-inhibited (cinh) and cache-enabled (cena) addresses. */ - struct dpaa_portal_map { - void *cinh; - void *cena; - } addr; + struct dpaa_portal_map addr; + /* Qman-specific return values */ u16 channel; uint32_t pools; diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f412362..4e3afda 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -74,6 +74,8 @@ DPDK_18.02 { qman_delete_cgr; qman_modify_cgr; qman_release_cgrid_range; + rte_dpaa_portal_fq_close; + rte_dpaa_portal_fq_init; local: *; } DPDK_17.11; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index d9e8c84..f626066 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -136,6 +136,10 @@ void rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver); */ int rte_dpaa_portal_init(void *arg); +int rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq); + +int rte_dpaa_portal_fq_close(struct qman_fq *fq); + /** * Cleanup a DPAA Portal */ From patchwork Tue Jan 9 13:22:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123949 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4020483qgn; Tue, 9 Jan 2018 05:26:17 -0800 (PST) X-Google-Smtp-Source: ACJfBotC8AKlpVQ+5dD9hO7vrfjo01hibmxN+i/tQGwEbi0FnduAmY3m6exCpiS1swjulSxgs75K X-Received: by 10.28.230.20 with SMTP id d20mr13165880wmh.138.1515504377745; Tue, 09 Jan 2018 05:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504377; cv=none; d=google.com; s=arc-20160816; b=N66G/DC2AZ6qqPigskFHFz/sV5GFgmySfsct5ruOE1E/+eLO0rZTiyGcSKahKgknuE prSWGJQdJl0zINZ6a9z4+woukq63PqrPLrkUMvrkOYBAvFIywNVfpSdM8rIXy5D7yLaD i/TYvl+OqMQojP307HdxBQr3MUW1+7qrGihwWoMU8Hm/5guMbmzMO6fqXYj8cYHMVhgT zRsxZPFzphjiTEM7ckGQKdL9M5s2D768xnkCpaR+M02JunOS3kGjLys5Dr3NU5qWn2Mt JbRp+/NARSuwZ+2ZZ8yhwX1nRpfkL/Qr2hH4DGIHAHQ/nzuUtujmsEnimoKtzAi9qADs pnKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=i1vd4XyO+THlZ1ac8wo6oQx0zlxpG/s5VSVi+8DGxhE=; b=NC3oxeOWPFckJPjycoKvkYkYlUAz6xwU96uuulnB40Dxb2IY7Ti9+lr6h72RMetgbU 0H/rNlbz/fpDwQpGwo+eY1qFrFAEtU1IyAXSjF0j0foWBNu/juPvEOJjYnOMdAiaPLMg GIzV2CbaV7eATuGfr/CQzaU4oiB30RsSsECxlx8uNqY/bKaU24ccdYubQhnJSs90WdFE GeAjX3nYUNF6GEDHdP4MijJL/jdNtUU+Au32z41/wc602oo8GZSKWYoqkxTrIkE/pZo8 wzvrqHor8HvCGTVKuMHFjeCyyBFdZnVB0moRnvfSKrlJnjf4sQsvMxCNBH+/QIsrL5i7 H+pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id o1si5459569wre.195.2018.01.09.05.26.17; Tue, 09 Jan 2018 05:26:17 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C65341B218; Tue, 9 Jan 2018 14:24:41 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0055.outbound.protection.outlook.com [104.47.37.55]) by dpdk.org (Postfix) with ESMTP id BE2F31B20F for ; Tue, 9 Jan 2018 14:24:38 +0100 (CET) Received: from MWHPR03CA0010.namprd03.prod.outlook.com (10.175.133.148) by BN6PR03MB2690.namprd03.prod.outlook.com (10.173.144.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:37 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::165) by MWHPR03CA0010.outlook.office365.com (2603:10b6:300:117::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:03 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVr017638; Tue, 9 Jan 2018 06:24:31 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:57 +0530 Message-ID: <1515504186-13587-10-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778455481232; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(51234002)(68736007)(6666003)(106466001)(105606002)(53936002)(6916009)(2950100002)(50466002)(36756003)(498600001)(2351001)(50226002)(356003)(77096006)(85426001)(2906002)(47776003)(305945005)(76176011)(97736004)(5660300001)(51416003)(8936002)(8656006)(81156014)(104016004)(4326008)(48376002)(8676002)(81166006)(86362001)(16586007)(54906003)(316002)(296002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2690; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:ZH82suIPzDujvHn/uHuCq4UBYn9SaUXPEHe2Hz/3nQex+BjRu/ScSMAxkyWyNuMTaMEwS/DbzyKUJpTM9WDNeRU5wA4ChTmWLle7vLuXTzNTZobFupIetCkT8hnyfAfe MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4e069ac-7d16-42b4-eb90-08d5576441d2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2690; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2690; 3:A0TqSibvG3m+epectSwdORzHJ2sEiMQOqWVA6R52ahNswjjI2gEO7zLq7ycSOWPXSJd4MAi8TrSY3U7pPAQPX35F3DWYPDMCmC1Frc0HQccZsVAfttxTNsNWdgZ+j/yibzDZUUjkiqg3hJcOdFZWFGCNaIW7uGmYWm0kHGH6Jfq0/zi4Bf//NLXlwVJaOk2B8CWiH5lTQIFbMaNPQuZ1P+J6Lz+c9SedQyT4Jv8ZrDc1oTZ0beZp7Q6DRmowbk1+63NSxZcA6pg3TdZDSp++AA8vxBLbZMMTLlHRnYmVmHHrq383lCr8TFi3yBOw1K/EgxmZ92ED6FPkqyB3Y5jq6zkZkLf5XZ1QUwGI6Ub+/Bk=; 25:QpK9RloG3GPAoXFDBeZ0b2YYNYDG3JvUfYmL0ioBzUOjSISlZaaMbIF0W53XVhTgJP/mW6kYhgZPxM7UgWLOdGsYW0hcNWatJVaFqALWPf8n57R2eb38UHgeCpGfFcGF2yC1cw3MDpOrNMamZHvLekA+/4sY6zAYU54SBX7XPQveyoa8QAm1+TqQ/BerN4lAYrsy+Gg1iAP+dgfXeRxUXC07/fX/Tdi4CmDRr+4rvC+IIdEJpZj6xvGqpRiTZtkCoApEUSHwWPrrjjB8IUUuHAxpCk+YpdxOeeAWVM+YX+nnDGACNR+sw0l54LeV7ZC/NzZTAS04uiIjTKdtH9Ix3A== X-MS-TrafficTypeDiagnostic: BN6PR03MB2690: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2690; 31:6cQjM27ck9ZT2Qd353s5XmthV8m8axeEckxeUpKor28QH+Dr/CNXeTXzIDdi26vlPr+309hnw7RI3bEg2YOGvHqIg/35EhH7MOnzCABEXA0T0mOpm5lDHKMBoUrfa2CuYUmPzdfg85nxWQM0gl162hLqovE+DkEcFDOAOdSBLDCTaX7XqYQMLnJotiBEFUXDGx40VjAPJMgJixMbrg3igXZBm+OSppgPiKQkqLWKW3w=; 4:mKdgAfwuPMKeK3HwXA5VaKjX+o/v5tV1/FDbQdLTfX+WrWn9ss2TGtNYkJAiGCGeEdsHR1V+7s1E0jlRhcYGDpulUb6E6JUz7eBuEAUS0m+gIGyZmCk5ymqNreTXafhAmD3Pa2BVHXQmC3bSTFsOF/EcbPXARtl9k4SMpaOVPvlYjSVhyYo2VUmaG6P7FB2a315ZQjaq40JmNr92nECdtciq0OOjaj9jYovi//Nr+RGOW2KnMuW+wORYeP99hn4xSH8ize6/IRqMMeYg72XJPaSdYPddZ4Gf0G08VTaPMo59FgGSuPiGDrk8CPpJM6eu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(6055026)(6096035)(20161123556025)(20161123565025)(20161123561025)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(201708071742011); SRVR:BN6PR03MB2690; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB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put: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:03.5825 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4e069ac-7d16-42b4-eb90-08d5576441d2 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2690 Subject: [dpdk-dev] [PATCH v2 09/18] net/dpaa: change Tx HW budget to 7 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta change the TX budget to 7 to sync best with the hw. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index f00a77a..1b36567 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -41,7 +41,7 @@ #define DPAA_MAX_MAC_FILTER (MEMAC_NUM_OF_PADDRS + 1) /*Maximum number of slots available in TX ring*/ -#define MAX_TX_RING_SLOTS 8 +#define DPAA_TX_BURST_SIZE 7 #ifndef VLAN_TAG_SIZE #define VLAN_TAG_SIZE 4 /** < Vlan Header Length */ diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 630d7a5..565ca50 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -669,7 +669,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) struct rte_mbuf *mbuf, *mi = NULL; struct rte_mempool *mp; struct dpaa_bp_info *bp_info; - struct qm_fd fd_arr[MAX_TX_RING_SLOTS]; + struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; uint32_t frames_to_send, loop, i = 0; uint16_t state; int ret; @@ -683,7 +683,8 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) DPAA_DP_LOG(DEBUG, "Transmitting %d buffers on queue: %p", nb_bufs, q); while (nb_bufs) { - frames_to_send = (nb_bufs >> 3) ? MAX_TX_RING_SLOTS : nb_bufs; + frames_to_send = (nb_bufs > DPAA_TX_BURST_SIZE) ? + DPAA_TX_BURST_SIZE : nb_bufs; for (loop = 0; loop < frames_to_send; loop++, i++) { mbuf = bufs[i]; if (RTE_MBUF_DIRECT(mbuf)) { From patchwork Tue Jan 9 13:22:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123948 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4020263qgn; Tue, 9 Jan 2018 05:26:04 -0800 (PST) X-Google-Smtp-Source: ACJfBovRmUXGYWnPwrl+UOXyl3eG/VU3UF7e2yIPrREsiH3b3HJbgRlE860jNlHfBZ0cftrsnmpF X-Received: by 10.28.190.7 with SMTP id o7mr12991809wmf.10.1515504364100; Tue, 09 Jan 2018 05:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504364; cv=none; d=google.com; s=arc-20160816; b=QNR2C0lTWavs2wfm85ClBCuriVL/SULwISX+v1SGzOKk6eR9bcbckszk9n7CvFY22S bogz0kWjWyKcW3AKFCUSd5uCc4Z3AzhhnwyTQg3hGz+DAiZ69Vfz4yEl+qe2mVrtLh8B 4oR1ZKKDX2bmns1cIayhAUiMpvJLjfCkV18OJuVzM7Av6L5RdBk1sjPJL4cvXhYI82l9 RRgKcag6YILhKUcrfpRgwxbrUd1KEFbD0UDjGeoK9pDZnOPwP1ZehQl0WurUg8+DSa8H QVaKFtHT0dehNjFF00nxm5oZsxSac785KIeeNhsvrwxIiW2O4QmZ+X6uZ2Rv0gGMnq0Z LqzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=PoSRi0A58oS1uvOfd3wk1JLNZaNyzvnlZYEEDX0iIbE=; b=WdwYc6X2I5mwbs+tnYoiRdPO681oXhZtAFTJZCIAvU1l+pdk22lxWmXf0xriySbk3i i680gvIitmAw5mt6vmepb4oawjpXkOlsP+PCid3g4O0FoEJ+hx56yog8VvAkly0hVeqx RQNMFcQx5y2BdfiaX+9Zdighy8YyJ56EszCdfaXtJkoYEfX7xvsU70dhCJwRfs82N+ZF T5vmjKyFU2VrBB2tum0EdZ4fxsepkrSQ0LvFvKQPugHy3eIRZ/1iu6No4/AULXe2AfSo kUmGzpXHtXM3iuX7fkBQiBbbOVtLAboCDaDKtVY1qGaJs4goPGBr5a5TKvfW1mXyAuDi x8xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 91si3061366wrh.544.2018.01.09.05.26.03; Tue, 09 Jan 2018 05:26:04 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AAD411B217; Tue, 9 Jan 2018 14:24:39 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0077.outbound.protection.outlook.com [104.47.38.77]) by dpdk.org (Postfix) with ESMTP id EFF3C1B20D for ; Tue, 9 Jan 2018 14:24:37 +0100 (CET) Received: from BN3PR03CA0099.namprd03.prod.outlook.com (10.174.66.17) by CY1PR03MB2363.namprd03.prod.outlook.com (10.166.207.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:36 +0000 Received: from BN1BFFO11FD014.protection.gbl (2a01:111:f400:7c10::1:157) by BN3PR03CA0099.outlook.office365.com (2603:10b6:400:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD014.mail.protection.outlook.com (10.58.144.77) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:05 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVs017638; Tue, 9 Jan 2018 06:24:33 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:58 +0530 Message-ID: <1515504186-13587-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778453867439; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(51234002)(8656006)(356003)(8936002)(76176011)(104016004)(81166006)(77096006)(47776003)(305945005)(86362001)(6916009)(6666003)(498600001)(2950100002)(2906002)(8676002)(85426001)(81156014)(51416003)(5660300001)(50226002)(36756003)(68736007)(4326008)(53936002)(97736004)(106466001)(316002)(2351001)(105606002)(48376002)(16586007)(296002)(54906003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2363; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD014; 1:mwXzPz1mZ+TgTSeQlZo1RiPRgfOo6pwvGeM3k506G4QqAdUKkV0HbuAoXU9fl9SdNl/MX8DCTlU4joP4FQG8paFiHOVgIOnqFW+a/+H1EbOG1aPppkceAfptkjPRulGk MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23590a10-3c57-4309-4baf-08d5576441ba X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2363; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 3:EQxgEV6RT6fAPF+XZwj+J6UIAhVasCtvUhJvS5KACX57ugO+zH7yj2BZ0ZmA2YcosOUpaamQR1wq2AEUHRkmcJBRzWAuXmANaXzDmSDMN8DCbI3oNL/P+udCbEfFjh2yhIrfc1MkfiVlkKi8eC6H2F2iKaA8JRVzcz1aE2zRX7xlCzIx0fBftrINRnUw9JwFNVRIQyaXRG/SnQz0tFD9IS1COIJxN1SWzJHXdCKmtDwRWBdL9ruqBvepIv3PS1EI56jIG8TfFgcwJqSrAmsyOXhNCTT3DOs9Ms2+8b8KvKYKffmRRzt5Gh9Ljy3iDRwggnCfZjg3zdqsl49xsznJmWnI28pAgEuNuU/+no+U2Qo=; 25:x+jkt7flWwm7dDj3hmwcqDT/L6mlXSfdeRkcPmZ4aaPKLDsUxo95KJUX3ZRkPq8BUhJXd4gTfJwKamr7T0Uev1kHAqTsL/UsXktvIsf2sUwWObA6NZCzA/S3j77gXCxGsgqKmYgUlY23JK0Esraa0MPtA6mzEhJlRrjA6Hau7svAZkFDGOxuw8FUMTBxfRoQUX4AoORG3J+peCrALAj1CLSVzHcEj59xAJMnmqqC1xZD5O38SyQbPqqTl4yNBqoFgEQqgeCGDNlvpN9MnrQyC46Bwr2sIirb/eOcYfBQd4Ck2M+C2+8SmJGQVR0q8qdyDwU5jFwGmoZWdBZVt4ronQ== X-MS-TrafficTypeDiagnostic: CY1PR03MB2363: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 31:QD5/28Bw51NffxV8DoTyfWmlQoCT302Jd8AlrXcDqCiWaKuAnCTPs+VnSv+EDiG4+/lCHxMr7VYbA6sObjPO0mLX0NIo47FhHyGL8T+5cRxfHX5O9qPu/OVR8uAf5DsB4s1F8qmJfW3e8MeINySn9nJIMcQjyilL4xbDLJBEn/E81/Y5QBm0rgpxb0wGPgxnycQEpjo/BLQ+J6bFJ4PwYZJeHxOKDjQZ2hIblWy+fI0=; 4:lxOBVyuwC3SA5C8duOyYP/EwG4uoAqGk+rmj3VkIQGz8hDDDB8WpzkqCe3VVBNRua0nbz8GV59quOoH6Hx/7D+ggw1uNlv2DZcGjL6nXIWgJ0WCcw2XYu6++XUlKLPoy1qIr7v0RPz90kZLBC6IP64eN9tg5tvMGtG/OL7RxpxRMxHKw8NM1BQ5qyU0l7Da4HEEvthgSCAT5cA0fwamQTyJWNaw2AkfvDz9dWIkPtOxPiUsBnKinxCNxbw9y1womukGW/W3U+0Gl5OG7ygzpS/Nhe4HAKsqPxcMyfOojDEPMKR6HZ1/5+OXABRXI6J3/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(10201501046)(6055026)(6096035)(20161123561025)(20161123563025)(20161123556025)(20161123565025)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:CY1PR03MB2363; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2363; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2363; 23:lG0qf0+f/kLg/A/0oUzct8Le947blSIetT8vCCDH9?= xFru4iLg+ah50sM0AGowZ0UppbGTaeI0xw2wOJQXV13whqRvgEuNxcIpCbP9ufyrFiNswhAoT48WJknysQ16cbGfF66a1Gy5h0dA4k74ucG1WF2mhqS52pcl/uDLR3L8CgDx40VpBiAGkzZxX/forGFOi0fB5g5mfHiWimfjBBNKqRPZUqdcCE3sCsYqZaploX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r1WZ8XVWySb8iHmhVev8YsdjUPxYcq2q0tyyvGqClCZS96s+8hnxa/C9n34/hKcPMwzyXsyQ2OXvZSVS4SWaCHGRrC4YzcOhgaLRMMcf4jB6xqQljgebs4yc3asbQePbulszieUqO4ycQs2kRJKy5FgCwFoz6kJStORrdLxA0KixxH2qPIkwNJ6Q7oOIPM791qapylij92kiabW53XwymQWpurRsJl14LeQkU=; 5:rzHQ+sWojsXUNxGageSTE9M3sM9o7k4xkIDm0zTvBfvyffakMFqf9VvE6Pg5j7Gob4qICysLMBsLu+vS8//IMOB+0dyK1gLcIxxapGEdjTHu54bAhDAh8GIlfElRJJ2UwLT5lx89X64mMacDGv+yzNy2Ds7AbvL9V0I4cux/oyQ=; 24:4fK0UnOEmBGDybDc3wEGl5/pENYaZheGZms8NUj0NiCUUu62y0U0uwXWPTn+9/D/0JY0+ruJb6ZeLueMI1D+FEWOvoqxHLK4eZen91ctUQo=; 7:hh7lddcZYu4l/CQmobyDmx0hUXlpNO1b6qXaTFLZffrYEFfekT2WTOqm/s5uKCm0a/3224/gdKo25gdb7lrq98CF4z9Rc/j6QTjOIQsGtjwVrvAXYCzejHBfb9ykuoZmAFF9qK9XTNaWZgzuaOebXJ0kQ37ZAR6BGwaLKIEVyn4Ins9cqQKbtfpw0TFimpuiM689tXn4QYZ04BjQhV2r/kjnLCG3dbHl9sRrOxPAMQ68jOB7lJOagfcg0909pNYP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:05.2151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23590a10-3c57-4309-4baf-08d5576441ba X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2363 Subject: [dpdk-dev] [PATCH v2 10/18] net/dpaa: optimize the Tx burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta Optimize it for best case. Create a function for TX offloads to be used in multiple legs. Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 73 ++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 565ca50..148f265 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -272,6 +272,30 @@ static inline void dpaa_checksum_offload(struct rte_mbuf *mbuf, fd->cmd = DPAA_FD_CMD_RPD | DPAA_FD_CMD_DTC; } +static inline void +dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr) +{ + if (!mbuf->packet_type) { + struct rte_net_hdr_lens hdr_lens; + + mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, + RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK + | RTE_PTYPE_L4_MASK); + mbuf->l2_len = hdr_lens.l2_len; + mbuf->l3_len = hdr_lens.l3_len; + } + if (mbuf->data_off < (DEFAULT_TX_ICEOF + + sizeof(struct dpaa_eth_parse_results_t))) { + DPAA_DP_LOG(DEBUG, "Checksum offload Err: " + "Not enough Headroom " + "space for correct Checksum offload." + "So Calculating checksum in Software."); + dpaa_checksum(mbuf); + } else { + dpaa_checksum_offload(mbuf, fd_arr, mbuf->buf_addr); + } +} + struct rte_mbuf * dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) { @@ -594,27 +618,8 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf, rte_pktmbuf_free(mbuf); } - if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) { - if (!mbuf->packet_type) { - struct rte_net_hdr_lens hdr_lens; - - mbuf->packet_type = rte_net_get_ptype(mbuf, &hdr_lens, - RTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK - | RTE_PTYPE_L4_MASK); - mbuf->l2_len = hdr_lens.l2_len; - mbuf->l3_len = hdr_lens.l3_len; - } - if (mbuf->data_off < (DEFAULT_TX_ICEOF + - sizeof(struct dpaa_eth_parse_results_t))) { - DPAA_DP_LOG(DEBUG, "Checksum offload Err: " - "Not enough Headroom " - "space for correct Checksum offload." - "So Calculating checksum in Software."); - dpaa_checksum(mbuf); - } else { - dpaa_checksum_offload(mbuf, fd_arr, mbuf->buf_addr); - } - } + if (mbuf->ol_flags & DPAA_TX_CKSUM_OFFLOAD_MASK) + dpaa_unsegmented_checksum(mbuf, fd_arr); } /* Handle all mbufs on dpaa BMAN managed pool */ @@ -670,7 +675,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) struct rte_mempool *mp; struct dpaa_bp_info *bp_info; struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; - uint32_t frames_to_send, loop, i = 0; + uint32_t frames_to_send, loop, sent = 0; uint16_t state; int ret; @@ -685,10 +690,23 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) while (nb_bufs) { frames_to_send = (nb_bufs > DPAA_TX_BURST_SIZE) ? DPAA_TX_BURST_SIZE : nb_bufs; - for (loop = 0; loop < frames_to_send; loop++, i++) { - mbuf = bufs[i]; - if (RTE_MBUF_DIRECT(mbuf)) { + for (loop = 0; loop < frames_to_send; loop++) { + mbuf = *(bufs++); + if (likely(RTE_MBUF_DIRECT(mbuf))) { mp = mbuf->pool; + bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); + if (likely(mp->ops_index == + bp_info->dpaa_ops_index && + mbuf->nb_segs == 1 && + rte_mbuf_refcnt_read(mbuf) == 1)) { + DPAA_MBUF_TO_CONTIG_FD(mbuf, + &fd_arr[loop], bp_info->bpid); + if (mbuf->ol_flags & + DPAA_TX_CKSUM_OFFLOAD_MASK) + dpaa_unsegmented_checksum(mbuf, + &fd_arr[loop]); + continue; + } } else { mi = rte_mbuf_from_indirect(mbuf); mp = mi->pool; @@ -729,11 +747,12 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) frames_to_send - loop); } nb_bufs -= frames_to_send; + sent += frames_to_send; } - DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", i, q); + DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q); - return i; + return sent; } uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, From patchwork Tue Jan 9 13:22:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123951 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4020915qgn; Tue, 9 Jan 2018 05:26:47 -0800 (PST) X-Google-Smtp-Source: ACJfBotq/ZqrAEbEBOEmPEl8urCmibd+CavjdAz8z1BZDdaxNNv9dylwmzehPDINk87IRe/p/h0J X-Received: by 10.28.231.8 with SMTP id e8mr11277746wmh.16.1515504407160; Tue, 09 Jan 2018 05:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504407; cv=none; d=google.com; s=arc-20160816; b=ZuiA1t08ICIKavp/dCaQlVlsH6YzGEBrgOKJ4N8AEAo4Li9iTM7EhecWsxBweJizBd IXQn3FJtwSzpGSma502jb4Yc8/lROyi7AcfAOPM54+a28wgZcxWDvvUrL+t+m7qkR6/+ QJVcxDAYnNVoigbzEvgLo3aEYztzB0LHQFlkue63+UV0/kMaOms1usBGH5dCV/LbbLNf xGtV3ercqNG1owkk7caiIBDvV7Qx892LPw/9MJ2aU7az5AW9rS7Dg5IQVqGVWPwRIdkj ORFFEyAM5NmDDUrMJvm84jrJlpIE5ErhfuAjalqFCsfR/U/gQ8exGa7i0W1v0D/YWs9g YR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=dP2iTPQPyU3N6tIXg903qokdi5fH+A6wH9acG7cDk4Y=; b=0FiyHw+QFpzFbhQElmizqHPV9WGXEoZu1gIdyQ5L25rUz/clgH7OAQbTnplKVIfw+e VviRVyzw5wupkYFOGZR2SQ5okK9CSiVVO5ob0KZwCDweFN+pjTZem7DHT1a+J7wIL36a 1xPLIV3LZx8Ya1pjpnoMbc+OQ6jReO5v2bNt4qcEXBl5veyjOcSPtnbclLNWZX2m9qnV R4R5Mmaod2TiAZVm27UG0RnKX4/ZH5OjxCOQLA9NN4ZTRF1M4sl6R+6/IcelE6Uj2+H9 YUjfwoa7nUtn0Pbvv7++SolkuSmn5Ye+Fs4/P3vEDr3P/olTuP4LMB4moaKQ9DiNmszY E5WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z4si36364wrh.408.2018.01.09.05.26.46; Tue, 09 Jan 2018 05:26:47 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 21ED01B22A; Tue, 9 Jan 2018 14:24:46 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0077.outbound.protection.outlook.com [104.47.36.77]) by dpdk.org (Postfix) with ESMTP id 62C7F1B1C5 for ; Tue, 9 Jan 2018 14:24:43 +0100 (CET) Received: from BN6PR03CA0090.namprd03.prod.outlook.com (10.164.122.156) by DM5PR03MB2698.namprd03.prod.outlook.com (10.168.197.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:41 +0000 Received: from BY2FFO11FD025.protection.gbl (2a01:111:f400:7c0c::154) by BN6PR03CA0090.outlook.office365.com (2603:10b6:405:6f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:41 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD025.mail.protection.outlook.com (10.1.15.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:08 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVt017638; Tue, 9 Jan 2018 06:24:36 -0700 From: Hemant Agrawal To: CC: , , Nipun Gupta Date: Tue, 9 Jan 2018 18:52:59 +0530 Message-ID: <1515504186-13587-12-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778503477117; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(2906002)(53936002)(296002)(316002)(106466001)(8936002)(97736004)(77096006)(105606002)(50466002)(48376002)(8656006)(2351001)(59450400001)(47776003)(2950100002)(6916009)(36756003)(6666003)(81166006)(76176011)(4326008)(51416003)(498600001)(16586007)(81156014)(68736007)(86362001)(356003)(305945005)(50226002)(8676002)(5660300001)(85426001)(54906003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2698; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD025; 1:UYPc2Oh0PQtoD3o2/s+dbkm7jA5WJZS/J4xkWDgs3evKzSPUa2UEMO1p9OFgen0mP0kvtyCSLvLf/EQFQ+7uGb8kzbb4GLZXhvqtpZfcK0Un7CLf4cJLtuE/jsVg3PHk MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc73aca4-7029-4873-477d-08d5576444af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:DM5PR03MB2698; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 3:OYWImeUjSLGxSvbHfJhLsDXBmZz/EUHp+vjm6OLSerhqdRyIaAVDS1qQUKW6aop+YjWdCIumQi8sYgz2m0N1C4v6qPK6Pgg0JeJvqP6mCRI3DrGJ/bgWTm3cCeHN41loDazZLkx7NWLL3nDIbSjVv8VJ7PveL5HgZh7LCBmOuckmSYCKmW50viNzp7HqxKS1NDOnjZIgQopZe8E+5axMQ4eMONnF7+UTYL4HS3MPUm+SqMXMRuBVy9kEBnUvmlR8lDLN6QVF7iDIAyGP5wfMneDRza3CC4I1flmiswVmLxF8BvSJk62gcvDYGJ76Yn4yDU/lHrnCiIpBEsj1AC15d9DuQTzIi4a046JpUqXEfUI=; 25:G57jihPC3uO6shH3hLmQUJp3qJYNTzqvxeJXOq5IPsJv0Wn1o5LpMOM6jDZB/RzNYUDkSOHTC2yNYskHRYXqFLJiH5q0XX8zlhYg6a2AwnOSbRGUcXmfjrhSJ223cTz4Jfzv/Nw1uWG1KoA+w3CkuRxR/0ihszQ2rc1XGHF1bmhXlmhuvE1+ehunzGEWjE8UYIbuz7rC0jnPJ3HSiCvrlVZQoWJS+FjLvGWo1ydmOhA4aWs5JkdNId/nLIU1Ew0SiXhODVA+OGcY3UeR5N1j5DUCaUqEb7//zrMee+smWo0mROW/DNrUK05hjGxBFQMddQ7G2+vob1Es6dVCG+1ytg== X-MS-TrafficTypeDiagnostic: DM5PR03MB2698: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 31:DeljfSXGAz/utoI1xfvag2AvF85CGSnaYvajkgtYUCkTcQa5mbBx7GYVdV/+7jFwfGtXu4j8XMTqvZBNgSeGh1zayxc/w4MKZYSSKK6gOUydWgy71Tmt1AQDQqB71u2Q9f2jcj5zqRyPejUv8PCb0EwTJ7AWXXoc/s9oawnR2Gjxe8gAwtaadRyHmz3YuRJKKroKq+j9/ZJTIiA/d+Emgd5aoX9wo9SwNti+y6YNJvo=; 4:a0dPC26FPdbedxTwK3HKKOhsH8ggT9ez0Vfqpr0EQT5T6V7QHwRM7kinwc4OTkw9Ht1uNcMkBSa2oI9WNjCssdOrVhx3qIB7hSM/YDAV2rFvDyyAe03OlvfhDF3iBfACvidit1ZGQlF5ekIAcM+r9FACV+wF76vmEgLb/Nw6nAS2zRmIfkRwaXcbn0X46NyN7lIS7UNwmhHqhWML7SL2Odtp2CaLF7W4zuUGyEFmW1+ud1KKjhFhmh4miHM5kShVVwnJ1Al3itCCwm9ZiL9FVeNs1rbYc7tzKX7lygtS3tWb4EYww0bIj2YqvLNdh8od X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(201708071742011); SRVR:DM5PR03MB2698; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2698; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2698; 23:nKZWfQXqP5szbCZ/d1w3DN6olvP49Xofv+2mmt4oL?= 9g6HGCSEYYOncahCDaoZ5gR3oGos35NokDpgDMNDD7kVyGI6bITlJFaRdPl3tEMpS9pj/4TuxwTADcJvAdTxkZLWIFk9d0oU7n6LdbXwqoQ6nz4U/yD+r/22eP+3Azghi3rZe1Yca9VajbGVR+rnwbpqOYc7Dgxdrc5lphka528bRDWkQdcHyaEpYbML+Lxfs9E0jXe/3AiJPjU6uhDoy0PbOXhb+ISOpPe8CXM4dZEBlly57cZDiRiexkCSMm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Ooq6IJ6eEpiROPHcmc/C4mBlLSXSJh14vN5xtB55rxm57DxujO4BelDN8/oVGhPDeQvgcQeNpXH/A6GMH4tTs7s8e9iOqCERQTBUv0t1b8/ZgcYJ5G3Fc9IH1WZhd7fQcSlgHNEjM4gbRyWSnMOs9Y+FV/id0JhwkyyCaNT1tc=; 5:TZct2sfLMBAsmMMdYmxCfGgKC/ujZtJ6LYN3Znj3BBwWixfEi3SBhorPZUOt2XzrOIZKXo5x8FAOL5PckM0XGLQevQrKFkUeuQ9QpBRG69iz2cM0AGe4w1Wr1a/OGv/2q503+s/emUIgOGXyPx8C6CosR5Zl/TJgfaFpM8HFCw0=; 24:5QTIcNKyd3jUxui0/C7QY7esfQPhAH1kg5lYD1bf6rDLejmUUdaMF4xwakbBG+pUnEL+AOgI+S0c7tR3XuBAX2FG+Gy72SEJSfEBHZO7EqI=; 7:JIekgwj9bfwezGeQveeAFfS32S80cDSmkzejq+8RqUiw9Xob2ecEApkquR8FRrhLp29uVLs7xWW9gjL6UUzKuK3LkYRFjDOsj5LBSR+2rwZKP/FcqAHBtTJHRM6OFEAQBvrFbJ2syxdGMgUkdPcbNlmMv1XG1mWICDBkjcJWo6wKzcehwP4OWPAb95IZQ62GYqyCoTmlHb3DDkj0wGIUu1MqDdytYVzrAqPok5cJoj4gd2VO+SnWTm0cCOVk9pEj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:08.3041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc73aca4-7029-4873-477d-08d5576444af X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2698 Subject: [dpdk-dev] [PATCH v2 11/18] net/dpaa: optimize Rx path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 48 ++++++++++++++++++++------------------------ drivers/net/dpaa/dpaa_rxtx.h | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 148f265..98671fa 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -97,12 +97,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); switch (prs) { - case DPAA_PKT_TYPE_NONE: - m->packet_type = 0; - break; - case DPAA_PKT_TYPE_ETHER: - m->packet_type = RTE_PTYPE_L2_ETHER; - break; case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4; @@ -111,6 +105,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6; break; + case DPAA_PKT_TYPE_ETHER: + m->packet_type = RTE_PTYPE_L2_ETHER; + break; case DPAA_PKT_TYPE_IPV4_FRAG: case DPAA_PKT_TYPE_IPV4_FRAG_UDP: case DPAA_PKT_TYPE_IPV4_FRAG_TCP: @@ -173,6 +170,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_NONE: + m->packet_type = 0; + break; /* More switch cases can be added */ default: dpaa_slow_parsing(m, prs); @@ -183,12 +183,11 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, << DPAA_PKT_L3_LEN_SHIFT; /* Set the hash values */ - m->hash.rss = (uint32_t)(rte_be_to_cpu_64(annot->hash)); - m->ol_flags = PKT_RX_RSS_HASH; + m->hash.rss = (uint32_t)(annot->hash); /* All packets with Bad checksum are dropped by interface (and * corresponding notification issued to RX error queues). */ - m->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) @@ -297,7 +296,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr) } struct rte_mbuf * -dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) +dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *first_seg, *prev_seg, *cur_seg, *temp; @@ -355,34 +354,31 @@ dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid) return first_seg; } -static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, - uint32_t ifid) +static inline struct rte_mbuf * +dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) { - struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); struct rte_mbuf *mbuf; - void *ptr; + struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); + void *ptr = rte_dpaa_mem_ptov(qm_fd_addr(fd)); uint8_t format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; - uint16_t offset = - (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; - uint32_t length = fd->opaque & DPAA_FD_LENGTH_MASK; + uint16_t offset; + uint32_t length; DPAA_DP_LOG(DEBUG, " FD--->MBUF"); if (unlikely(format == qm_fd_sg)) return dpaa_eth_sg_to_mbuf(fd, ifid); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); + + offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; + length = fd->opaque & DPAA_FD_LENGTH_MASK; + /* Ignoring case when format != qm_fd_contig */ dpaa_display_frame(fd); - ptr = rte_dpaa_mem_ptov(fd->addr); - /* Ignoring case when ptr would be NULL. That is only possible incase - * of a corrupted packet - */ mbuf = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); - /* Prefetch the Parse results and packet data to L1 */ - rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); - rte_prefetch0((void *)((uint8_t *)ptr + offset)); mbuf->data_off = offset; mbuf->data_len = length; @@ -462,11 +458,11 @@ static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, if (!dpaa_mbuf) return NULL; - memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + mbuf->data_off, (void *) + memcpy((uint8_t *)(dpaa_mbuf->buf_addr) + RTE_PKTMBUF_HEADROOM, (void *) ((uint8_t *)(mbuf->buf_addr) + mbuf->data_off), mbuf->pkt_len); /* Copy only the required fields */ - dpaa_mbuf->data_off = mbuf->data_off; + dpaa_mbuf->data_off = RTE_PKTMBUF_HEADROOM; dpaa_mbuf->pkt_len = mbuf->pkt_len; dpaa_mbuf->ol_flags = mbuf->ol_flags; dpaa_mbuf->packet_type = mbuf->packet_type; diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 9308b3a..78e804f 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -262,7 +262,7 @@ uint16_t dpaa_eth_tx_drop_all(void *q __rte_unused, struct rte_mbuf **bufs __rte_unused, uint16_t nb_bufs __rte_unused); -struct rte_mbuf *dpaa_eth_sg_to_mbuf(struct qm_fd *fd, uint32_t ifid); +struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid); int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, From patchwork Tue Jan 9 13:23:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123950 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4020681qgn; Tue, 9 Jan 2018 05:26:31 -0800 (PST) X-Google-Smtp-Source: ACJfBotsOggSSnxya5Ior+iyBDR8uP8KLRGLu3LxhoFgSEjea0xlXkq2KWiiE/skfvGertBhCock X-Received: by 10.223.169.38 with SMTP id u35mr9443623wrc.57.1515504391141; Tue, 09 Jan 2018 05:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504391; cv=none; d=google.com; s=arc-20160816; b=PIFKRwANE5t8M/zMX7ECWfeShmgbDbH3yCo3aW/Gs776fo6crQjUUsuTAw87JV8F/q yuO4+XXhmj6NNpoQ7BbRFMpg9to0WtbkWZjcE0tFvEBZJMUIQG6PwOH3hrjaFSTYcjfN uJLOTFJJY8zIsiX8YGzK4vUBuDfTERwq60b8uYAPUZ3AlCwo5VIV9Nwj2XPwenQXAxuB Fan+CUNAz78zkSjrfJuiw/j8Dc58K+de9ixxiRXzmkQn+AptbnxqGUlMNA26kc6ZzFVO mQA0Nzx2l2szmnWhbalg35TdsryqBSVdMfgrasD05oGoJr3LT8goPimIOs2As8us0Byh vsjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=i/aN1DxCet0QcetUBthysoIu5erF+FcjgsLmv3TZa0g=; b=XvK/UWzB8ms0yFUM0OAPFNzGYPL1KyCuECAA98lQz4s1mXYx+EhlZ7Dn+ff+xmuysN 2Ol6G5oCCBreSvuwA9+XRQNOuDCKk9F/gMsa5seY6RXwFAJSBDkTSGCHHqemOJfkpVwe vfyQolfWo28k8xUNtklWCJ3qSKUL36uAyHfNksnNJZC+tOh9oduARQVbpbfiAt8hZA3m LPFpgMF0KB5qMeOyqqAcD4cA9VfJs4r0RNX9+xWI3itJUW6Ipt6bvcpUnesFCO5OE3qy k6YEcgJizy/r+0TgmfjciG966sU+XjI8knIdYepJP+eH/xAoBDDLVN9BjAV/q91T+NQD fsDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id r60si2646250wrb.135.2018.01.09.05.26.30; Tue, 09 Jan 2018 05:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D33571B21E; Tue, 9 Jan 2018 14:24:43 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0043.outbound.protection.outlook.com [104.47.38.43]) by dpdk.org (Postfix) with ESMTP id 5718D1B1C5 for ; Tue, 9 Jan 2018 14:24:42 +0100 (CET) Received: from BN6PR03CA0004.namprd03.prod.outlook.com (10.168.230.142) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:41 +0000 Received: from BN1BFFO11FD011.protection.gbl (2a01:111:f400:7c10::1:117) by BN6PR03CA0004.outlook.office365.com (2603:10b6:404:23::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:40 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD011.mail.protection.outlook.com (10.58.144.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:10 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVu017638; Tue, 9 Jan 2018 06:24:38 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:53:00 +0530 Message-ID: <1515504186-13587-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778501892970; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(396003)(346002)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(16586007)(8936002)(296002)(316002)(104016004)(68736007)(97736004)(305945005)(51416003)(50466002)(48376002)(50226002)(36756003)(54906003)(85426001)(4326008)(8676002)(53936002)(2906002)(81166006)(81156014)(76176011)(2950100002)(47776003)(356003)(106466001)(59450400001)(6916009)(8656006)(5660300001)(6666003)(77096006)(86362001)(105606002)(2351001)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD011; 1:kl3h0Xt+pei/Cgl5UvKBqmlsU0cteV5NmzIisqc7KL3zuVB08wiKHwfX3DT5WMNCtIadvZsMBX9+X666tI/APocugxCaCJUXBV17tNh5fx5Z0Jm3OBSQyyczKLI9YOl+ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3067f54-1f3e-46c8-1b6a-08d557644497 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:1m1Q4bJidtHws+BxE07NADWxBRUtScCnURiCVG9dWcVCja68NzLco++PWIK+nGx2ouCIFY8lBL9Ixw9tPqQM6zkJEFWYZC4HkP/tnsdhr1bnRuwlLPGU8OlvsoulvQyLhFJaJhCHavpf1i0ZWm96tDheHINA3TARb/zAJA3tsnYKIB5aDtVzRBxBBjJbbDtPLzxnTyCZDYERHuOPuh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YgmywFKKHh9uj4eBXHCjWKPUne16eDQ6T8SMGGPd+hcd9rA67nYHUle163Bwm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123565025)(20161123559100)(20161123561025)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2364; 23:HuLhq4WsFTA/W87KIYKZq5D++Yai5h3om7YPaduNK?= 66+e1Omo0FNkETRi0NsbSPNzrejYpfXWobr+XPR3KfEIOBjnbHDo50Typk6WvBCaQA2fIBJ5o2YoEzuYFbfVpCllBx4hEsTADJRxHEhVzqBgx9HAmheotDkKRgtSNVDrwBPhf7YpHPOyG+kvR3cMEmdGYQfEVmGAshZlBBnmOoMhdyTz1ZWD0vZvs9BBS112oAj5fHjE8hLzwttCdiNnp2sfB1PmBIrGG1Hrc/mmDkVY+uhyCYBrIsupRMRINsQ3mrrNOazLnKAZ7qKe63r1X5epKkL8qAY53G9CkdH5D11/if0n6BIbqugUpAMepwsnN9NzmMeXKb/41YrzIA0GR1KNYFy2hi8RvvACaCzTCkUUri82aBS3XhfHJRdGdi8F4D0iEinwlhRG42sXf9/gGTwteXpHx8s/YXX4NMZ8hJE1c+JsaA1dcXJBQcrMgMQXiHOAA46smE/JaMD2X8/O4QSlNrlk1RYHpgF1RHXWows9yMD4ChpApo+s9VlYCQhjPhFbEmqShKBFX0k0Ns0AgG+xYJ23kTsaPpbGT2gp0Rq8FURP4PxFoaOktjjbMIA3KT1v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qrHxXIXY=; 24:Srj59MhZk2e+TM9PzoQk2IgQjJ9BfSUGPQLrwn5RoLVKEgZcUeAxJMI9QNK8cX4HXT4DsMmG6bA7I9igRnbzJxXlyCfNG2B6E7MXfo77fCQ=; 7:nkCH0JF9qbQAJGVT92NNrkOIlKJUyhWJryFC5MUnqdEVJkHMYV6q0gi8leFju2cisudevAPsguhztp9VMZIYfHgIHrGzdrEfw9qZwvz4Rt/dJIwAlO20gwKR1/nvMu30zkcll5XT/vXbE6RgyxbaCosmwMndt6CXlGqgcHfTI2f8cfOwzQ+ZZvOjQXtk5ALDPUSV9EkJ9bahR59K8XqHT/59mQ3f42p1zD1pFa/v9C+k19DC0+ZnpuJKXeG5AW/x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:10.0176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3067f54-1f3e-46c8-1b6a-08d557644497 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH v2 12/18] bus/dpaa: query queue frame count support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 22 ++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 7 +++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 30 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index d8fb25a..ffb008e 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1722,6 +1722,28 @@ int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np) return 0; } +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt) +{ + struct qm_mc_command *mcc; + struct qm_mc_result *mcr; + struct qman_portal *p = get_affine_portal(); + + mcc = qm_mc_start(&p->p); + mcc->queryfq.fqid = cpu_to_be32(fq->fqid); + qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP); + while (!(mcr = qm_mc_result(&p->p))) + cpu_relax(); + DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ_NP); + + if (mcr->result == QM_MCR_RESULT_OK) + *frm_cnt = be24_to_cpu(mcr->queryfq_np.frm_cnt); + else if (mcr->result == QM_MCR_RESULT_ERR_FQID) + return -ERANGE; + else if (mcr->result != QM_MCR_RESULT_OK) + return -EIO; + return 0; +} + int qman_query_wq(u8 query_dedicated, struct qm_mcr_querywq *wq) { struct qm_mc_command *mcc; diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index fc00d8d..d769d50 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1616,6 +1616,13 @@ int qman_query_fq_has_pkts(struct qman_fq *fq); int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np); /** + * qman_query_fq_frmcnt - Queries fq frame count + * @fq: the frame queue object to be queried + * @frm_cnt: number of frames in the queue + */ +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt); + +/** * qman_query_wq - Queries work queue lengths * @query_dedicated: If non-zero, query length of WQs in the channel dedicated * to this software portal. Otherwise, query length of WQs in a diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 4e3afda..212c75f 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -73,6 +73,7 @@ DPDK_18.02 { qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_query_fq_frm_cnt; qman_release_cgrid_range; rte_dpaa_portal_fq_close; rte_dpaa_portal_fq_init; From patchwork Tue Jan 9 13:23:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123952 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4021176qgn; Tue, 9 Jan 2018 05:27:01 -0800 (PST) X-Google-Smtp-Source: ACJfBotYFSxqTfGB0CV0aCKXO5I0W3waqooojoVO2BkaEY1Z75iNC0bNa/xJpGQRD/3PPdOO7Yl+ X-Received: by 10.223.131.103 with SMTP id 94mr12539046wrd.62.1515504420944; Tue, 09 Jan 2018 05:27:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504420; cv=none; d=google.com; s=arc-20160816; b=AIJoTd/N2qv7bygZQLNFt3UPEPekU8UYXYdsegc+KM5gQd+rBPCsROJgiQrIw9nJyw jlA8qRxOxK51+uKGAXTjUvKaeDOFxWME6gLVWpA+PPm1ILll1/lhklpmpgSrBTvE7/gk HMlYs7UC7vMPF47+na7OdrACsTIZG8tSAtdUnhj+wBeIUzMHiE7VQAGEv3F0+pvDihfI QT1o03s+Pvv5Xla5GyKIF3ekOjhDll4lHLWpD76S+mvsI0epsC5qPdmhD4XIyKl70qGq NDkkzMIO4HXmmv9TfcUjxAyBZIUFrc36DR5FMSVfbwQrb/CaSaG5+jDHMAKpxjGyGnl7 UhQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=9bUoN+kCUh9nAbgLpQ48st1uy49XY4ymlpynJ8Zfi/8=; b=moxak7ge+2ezqc8VFTX5w5DhmBr+KwZJrwsw9LCRoFhOVF8FsfuPFZ6fjG3ntq346A n2Q9jve6DGHSOsCWsbNWioKBM4b+lKyqeaLl9WSsH9l/ZXCusxapV7SCRHu4uLM4I64Y RJBkXWIzWaD6b+d6cQY5P3oS9gArvZicRBdCSaIhWRcJuvIOXwOyy7KWKxe+6XvxO060 Q0kBFRjikXnEaB/4VX2iZhimuokVtzJT+j0lYcjkwaXMwQ6O5mydEamBPRQ2Xwja86Nb uH766/wk+K+tnKJiq2kqD0l0GOxgouvl1iDxEwIJb1zmfuPWH3BRACGAJt8uYjzLh0vE WAkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id i20si9854593wme.12.2018.01.09.05.27.00; Tue, 09 Jan 2018 05:27:00 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 176A81B1D5; Tue, 9 Jan 2018 14:24:49 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0070.outbound.protection.outlook.com [104.47.38.70]) by dpdk.org (Postfix) with ESMTP id 6DF091B1C5 for ; Tue, 9 Jan 2018 14:24:47 +0100 (CET) Received: from DM5PR03CA0030.namprd03.prod.outlook.com (10.174.189.147) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:45 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::187) by DM5PR03CA0030.outlook.office365.com (2603:10b6:4:3b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:45 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:12 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVv017638; Tue, 9 Jan 2018 06:24:40 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:53:01 +0530 Message-ID: <1515504186-13587-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778540629953; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(39380400002)(346002)(39860400002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(77096006)(81166006)(16586007)(2906002)(97736004)(48376002)(51416003)(296002)(356003)(54906003)(316002)(305945005)(8676002)(81156014)(85426001)(50466002)(8656006)(86362001)(6666003)(5660300001)(4326008)(68736007)(6916009)(2351001)(104016004)(47776003)(36756003)(106466001)(50226002)(53936002)(105606002)(2950100002)(76176011)(8936002)(498600001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD030; 1:H7FcL8dgqokwVkaaQPu2J3GEePR4/BS7owCYkqe2VuW+r7cHlQF8Y5EyieXDG0EAOAi5730/XoX0fBjjwURb53v4go6LVdPj4907kjZuCatiVZ4r24NQT17uXxtgmS4c MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b259b06-c45c-4c82-2fc1-08d5576446e6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:wster7kC5FeYT/M7dZQAVA/c9Bx8Cjq7iYDvlGMohLSW+jyLqVViB8S65TQYvEs84gmYB21m5SGvIA6Da1HQcqHTuY8b3PN7ymaNDxX8X+6Stl1EYMSG6U4W90E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LtJ2VCrcvubDLlybyDnpE7JZdTOsZZTXCC3MgCLSoOdGT9vSralpFDCo/UE61a++1O+0RT2SdVjyRYvdh/DGK+R6Ym8CTlNIKXrjGZcAa/lfcKt06ZEpIURKhXZjPrPKGRoUjByoQN7DNcS0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:yyOWZ5oal7s5n9Vethew/SoUPXUWAOZwMl3vlUHd4?= sWUqyUweHVObOkpMPXNNJlMeoxvZoS33iuehTYTPS1Al+JVy/ba2vsm5UOmbLJ1xqry17HH4evYpFt77Za6qU+GLk6PqLmh9gdA1cYyrCF7TVnBHhq6jOSFzdElPnaRvbAR8jjJ4rVX8r/fadpNCHvP8TmDLO54N3Th8BGlO130oRnc6jBVWGIf+J7hDv93UIrF7lKsZfl2QNPUkZQO5SapdofzfX6vWd8WLe1SPC2P2yKgKo36zyglxAZ8vWImh6WWEeVGRiH4xlUbAZ8K+YNZvuYVereABtJuuc3JpKsofN5/5cDsJCkq7QwbZ1wTSFUP2yhg2SWEho7BM+gzg57tDLj3V3ev3v+y2IVzmN7Wo1XfwAJkcTqKkvJxQX5c7AoTmJ6O7GkH6iAzX+iQWBWqb74RH3q95b/+kIhQKQWCC39aug2xZwoKIpbYuFGct99dABo4w+aopuQlnKn1Quf8S5IBBdmuK1byKg0s5ztnM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dgxfnNXNar9mcfgEXZEFMvuwwMCOv7elObVaEnD1u+7WOQGwEgLhKYCnIHY3WoTJWsslLi9wSa6iQH1evBcBq2TDUUOOEpuyV4rlA0gRYQX4F3GgdkKDUoc0ev6cwmi2jDZG9Cy4ewBn3jt5kQcXBQ5fWZ2pgcHlEm+7qw9zxk=; 24:YHt1HaWPhWIBranMWolBR83443zN1OoTefkUZTsvhrNV2tR3xkndA1E3B43pszdjWMP9txintgtCCxpJGQdOFOSr0pc41xxmVIFEd7lR2pw=; 7:62fhZq86+5139FdP7mVS8ezDljjmNmvT3D/SRN+4O1umGIJmAHgCL8t1H36E9Qnp2vS1TGEYIUabOIVVxZCxfdDwSw51xKzfFopq6u5Xq2MEGQttTX4ScCX50SLH575jVvwmd3ZSjG/s4ntuBmNKaXaBPFQZGNcWlpnN7qFIGeexb+yAG1O1xYHRI/RvyWLUaZO4cOGbX4+vYNYkQQH2bW84/AGeuCU9Knz3aoEI0j1i/waJLjasHfgZfD3tUsBE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:12.5029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b259b06-c45c-4c82-2fc1-08d5576446e6 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH v2 13/18] net/dpaa: add Rx queue count support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 5d94af5..de016ab 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -513,6 +513,22 @@ static void dpaa_eth_tx_queue_release(void *txq __rte_unused) PMD_INIT_FUNC_TRACE(); } +static uint32_t +dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[rx_queue_id]; + u32 frm_cnt = 0; + + PMD_INIT_FUNC_TRACE(); + + if (qman_query_fq_frm_cnt(rxq, &frm_cnt) == 0) { + RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n", + rx_queue_id, frm_cnt); + } + return frm_cnt; +} + static int dpaa_link_down(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); @@ -664,6 +680,7 @@ static struct eth_dev_ops dpaa_devops = { .tx_queue_setup = dpaa_eth_tx_queue_setup, .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, + .rx_queue_count = dpaa_dev_rx_queue_count, .flow_ctrl_get = dpaa_flow_ctrl_get, .flow_ctrl_set = dpaa_flow_ctrl_set, From patchwork Tue Jan 9 13:23:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123953 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4021436qgn; Tue, 9 Jan 2018 05:27:15 -0800 (PST) X-Google-Smtp-Source: ACJfBosFH1kqclRf509gwCkA9yJ3IcY/E3dRgxRVQW31MnzygccklWh+VhjVDXH/BKjN9k9n+s0H X-Received: by 10.223.157.6 with SMTP id k6mr13221806wre.124.1515504435049; Tue, 09 Jan 2018 05:27:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504435; cv=none; d=google.com; s=arc-20160816; b=0foOp87zXaNhDp4dfdRlfc/SJ0JBRheu7rYcOSIyCq8nMXt/m+us93dlCPAH2GKe81 9utL/dQkTmSQeMbXgqhbiBTUbMFmcYdstKkkwp3D73dms0lwCOGk+w0LcACRZaSSiCBO c6qdFnm2diav7OD9rrNJJ0eAdFpOTur0pgh3W8t3fqfrR5O8dyEU6yg56A7MM/54EsWV 3Phwv5RfcNfsM6I5JXbevbwgsLzU2pAf3WvlQDt53xMXNuHzItxzaaSgjp5yRnOLqf97 vJscHkzgAUdnEy0i4OryM8X9TlvNChkfgSSAPUd9XSxg2Yv0yTohaMskq1zNzbnyVEvi gquw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=uOJUZAgTQ7lEga7wJ093JqLFRwA7C89gequ3ozzvheY=; b=j4Dj5FMzQX9Qocj9r6RAuOLDZFq1wQ6+vq/ylwk6C23ordNWZELFMH1cw8z2zKK7pC WZ12JXqvT8C7RIuot7JnuXksJBjZYPGZ82iGv1w0oH1FQ1SDDCNlLz4P+ZWhBZErbRRB C/lQSX7IEi42eCLS/wq4hpe8h4+sgCN5DJaaGL/w8it82eEE8HELIG8kBd9AOPfj6Z01 hWKf9phTeWX+kAlCRJdBMgoDsuojI8u/VcGAc3MUTKu0kldFn5T0q43cHWqsSE0XMEM5 yOQVK8tPMXLwAhDCBIr9Ejdo+kCYeLwT+83hfOUpZbPwyMr8hFmV3DPaSxmuz3GLZm0M xpTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 91si10726712wra.41.2018.01.09.05.27.14; Tue, 09 Jan 2018 05:27:15 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3445D1B230; Tue, 9 Jan 2018 14:24:50 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0050.outbound.protection.outlook.com [104.47.37.50]) by dpdk.org (Postfix) with ESMTP id 97E101B1D5 for ; Tue, 9 Jan 2018 14:24:47 +0100 (CET) Received: from BN6PR03CA0060.namprd03.prod.outlook.com (10.173.137.22) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:46 +0000 Received: from BY2FFO11OLC006.protection.gbl (2a01:111:f400:7c0c::190) by BN6PR03CA0060.outlook.office365.com (2603:10b6:404:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11OLC006.mail.protection.outlook.com (10.1.14.199) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:14 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVw017638; Tue, 9 Jan 2018 06:24:42 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:53:02 +0530 Message-ID: <1515504186-13587-15-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778551374957; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39380400002)(396003)(346002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(316002)(296002)(77096006)(104016004)(6666003)(86362001)(2351001)(5660300001)(2950100002)(6916009)(106466001)(48376002)(50466002)(97736004)(105606002)(50226002)(8936002)(305945005)(54906003)(356003)(68736007)(47776003)(16586007)(8676002)(81166006)(36756003)(81156014)(4326008)(8656006)(2906002)(51416003)(53936002)(59450400001)(498600001)(85426001)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC006; 1:q/IpoOHrHoHeTzymGXV3LFKrcesQH6/b2wmE/84L4oj/IMAGv3s95f5MxFcdtQwveQN65LOTcuOG/B67xwR46aviWHZbEqIdn+ndg34oDhUquR+cEYvzwVAt37Tb/DRo MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e29a0798-baec-4177-c312-08d557644787 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:CNzywSxRL1uoB15yG5vXgEJWa7ijWoCxoM+JZZIwiwg9LFkkbTHvuSLeOV9DEyhiSww+qbxhci/NY7pHftH/9Ggn8IFpRv0sORR/h4LNHb++cpKfmO1g47qvbcuYIzK0ZSssNrQTRVR/4hpnhg77woRwDPdcR3TPoYKh6ynND7tj7hi10Xug/XLWCSQQYC16lQ728Dzbn4Ve1cKQlWotS8mFJKG8cVbpQ9gI2nHxi1ea7Ayjgx6Gqpg5FUD4GOTTzz4UPtQZJEM/hdFpJmi8fGX5fNkokuhqxQ6sPv28U2ERfx/UDtMbV1jMk5e63RwSARSKKUoAKZXM3gzkgbh8uv4r5VIUMgh6kCTRfHTXncE=; 25:sUYkpet3QO+JaF2RbQBoM1XFG09tWKiR0087Yp6FCAF1SSteESWzRg/eNSQ5NiKeeub3CFtwdx2OdjPlcFl07MPFuJcyVsJczg6RcBGnYtYT9rYTMpdKX5hO0YdJFslQrmtXXNRlcXqeZZpLjobnoKQ8iUT4pXC4T//S4TOuRJshzs5PamNnWOQECnswt9tCVilczZnpCYmoMVfd0S3gEYmO6AMtGWzYN7WbcuRZuY6wmYTZYZeU8D2LJNMP3mMEnaxv80u4GsW89FMH6mKTCPOwFhaHMsjtMpjMBUy2kgAowC9YBsvgKiv93LKx1gfBFeadLkPKAxugzS+OI1+28Q== X-MS-TrafficTypeDiagnostic: CY1PR03MB2362: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 31:/SkcKgR0fssAXBohEAw5niOlgT7K2gGHYg22YJdQfhmXx5CBY9GtACghLke6CGeqHjyGT/DpEx/0YAXyC6TwOXQCo51eMaeN9AyolqfGI91pXMYVED43SUG///iRRKSWWQNXyRgkjUB+2ywmGopkdYyM4nSoUJabAhVDsrF9dq1ZeuQgU0scfjAG0RO4PR+lzEOq4ZQg6qV7atpmWSgPmfzA3S9bdbPQ6nSMXxk/XwI=; 4:I1jtsxxPTZxVw36slYvWJ6Kpa0+WRWTXYoZJ8DLhszFLJKMMctOEf25I9NROMMxceEspzWRkAApWd1rLh+mNTbHOg2mqg306B9hg2My04tGbOVRQD/yRhpvvarf2dYmB+xMDNqurxgY32tazZ4ZU58x/Ci36DxF1L5iT2hD5AXQs4lDqH7YCpHdohijIgZOe9s8cCpbGRE0Bd0p21SofX6asxhjqDQjqHZWlc4iYzVB5N0mqqWCtmFGgKqU0tKoZshg4poFuqaJ0/5E5s86XweOVF/2g74xTJsjGTAnzqPv2w4dFq/xJjsehsGfN8k7x X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123559100)(20161123556025)(20161123565025)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:GIKtPXi9UXTAgSRx5JlSF/No0iP9b/sSB7vScjNCb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4VxhajlTkU= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 6:9+VdA9+htqJ91/QZOuvq9AxIWviMdaW6SqZRIY1VnME9tnbPiO8i8PlCyniYopfVLuwYk3Arh4vvSntvR6jfE2Zd9zxWisKMW7pPbmBrrN1a8GfH73uWbqX1JlZ1EITRITxrsxvn/yonHLow8+7yzkf/h6ZHwmyZa+QpcMukEdhF5LpEKW46VFjQyfMbvteuu7T1uoRlFX2nx1Hd5pXIpFDmSwlvpC1ZeZZ7egcJ3REXIquvD0EbwEPkjpexGV+3y6+ImvU8j5M1N8CupkUiopeu7ViMB4rPuB7lB904eSl6fFWRZQ/P4sqALLngod+XBmw6wz4Mon8XX7aGe+oDzCB99RbxdAMVOPoN5KKqqig=; 5:bx8PsjkH1R+VosNVc+lb7OR9TR1tXnf43A2xrHLA5/dj80EuCdOnMkPvDNK4QEH8Twz8a3RNpJKnp8b+P9S5cftp6pZTaf3bQc5cDb97kyssPf+bQNa1UsB4QMX4BcFTBvDBdULeb3DKBVrg8GWs3BAJoLuokdPVHwlDkL30Lvw=; 24:mgCtoN/c7scEme8q0Waxq3mq4jSvCkK6wc0j76lOV+4ZbITdjSt2mCqWLXW8BNLp2OKQerlqVxwUccJjeDyaB2H/hiwb591IIG1GBnaPiE0=; 7:lXbKv4+5pfLrGi+akO1p+56m5giBLi5lntJanzfSd9kQJa9SZjnPfeI93Xs66UvwtxgeUl7FAxC6qEC6xxNQUPR9mD9KGaRnvpKnsjoIcF/Xp8MPt2B9fQlR0MozlB7UvHebp4Mx6JSOuOpc+UbmtFTaUFE4GGGuTAfIEzbaqNr/Z+IhKg4NunwV6+y26QzZmqLlxX4MoUW3CMmpz3XwNLuPP0n0Z9Xhr+SY1MYXU30YiBUwQ7KyWKBrzrlevu/A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:14.9347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e29a0798-baec-4177-c312-08d557644787 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH v2 14/18] net/dpaa: add support for loopback API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/Makefile | 3 +++ drivers/net/dpaa/dpaa_ethdev.c | 42 +++++++++++++++++++++++++++++++ drivers/net/dpaa/rte_pmd_dpaa.h | 35 ++++++++++++++++++++++++++ drivers/net/dpaa/rte_pmd_dpaa_version.map | 8 ++++++ 4 files changed, 88 insertions(+) create mode 100644 drivers/net/dpaa/rte_pmd_dpaa.h -- 2.7.4 diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile index e5f662f..b1fc5a0 100644 --- a/drivers/net/dpaa/Makefile +++ b/drivers/net/dpaa/Makefile @@ -34,4 +34,7 @@ LDLIBS += -lrte_mempool_dpaa LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs +# install this header file +SYMLINK-$(CONFIG_RTE_LIBRTE_DPAA_PMD)-include := rte_pmd_dpaa.h + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index de016ab..85ccea4 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -84,6 +85,8 @@ static const struct rte_dpaa_xstats_name_off dpaa_xstats_strings[] = { offsetof(struct dpaa_if_stats, tund)}, }; +static struct rte_dpaa_driver rte_dpaa_pmd; + static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { @@ -707,6 +710,45 @@ static struct eth_dev_ops dpaa_devops = { .fw_version_get = dpaa_fw_version_get, }; +static bool +is_device_supported(struct rte_eth_dev *dev, struct rte_dpaa_driver *drv) +{ + if (strcmp(dev->device->driver->name, + drv->driver.name)) + return false; + + return true; +} + +static bool +is_dpaa_supported(struct rte_eth_dev *dev) +{ + return is_device_supported(dev, &rte_dpaa_pmd); +} + +int +rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on) +{ + struct rte_eth_dev *dev; + struct dpaa_if *dpaa_intf; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + + dev = &rte_eth_devices[port]; + + if (!is_dpaa_supported(dev)) + return -ENOTSUP; + + dpaa_intf = dev->data->dev_private; + + if (on) + fman_if_loopback_enable(dpaa_intf->fif); + else + fman_if_loopback_disable(dpaa_intf->fif); + + return 0; +} + static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf) { struct rte_eth_fc_conf *fc_conf; diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h new file mode 100644 index 0000000..04955a4 --- /dev/null +++ b/drivers/net/dpaa/rte_pmd_dpaa.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017 NXP. + */ + +#ifndef _PMD_DPAA_H_ +#define _PMD_DPAA_H_ + +/** + * @file rte_pmd_dpaa.h + * + * dpaa PMD specific functions. + * + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + */ + +#include + +/** + * Enable/Disable TX loopback + * + * @param port + * The port identifier of the Ethernet device. + * @param on + * 1 - Enable TX loopback. + * 0 - Disable TX loopback. + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-EINVAL) if bad parameter. + */ +int rte_pmd_dpaa_set_tx_loopback(uint8_t port, + uint8_t on); + +#endif /* _PMD_DPAA_H_ */ diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index a70bd19..d76acbd 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -2,3 +2,11 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + rte_pmd_dpaa_set_tx_loopback; + + local: *; +} DPDK_17.11; From patchwork Tue Jan 9 13:23:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123954 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4021721qgn; Tue, 9 Jan 2018 05:27:30 -0800 (PST) X-Google-Smtp-Source: ACJfBot/9vYoEq82KGBT8Z984uc19vW+bkxSlqI1h7+YES0rUSmNLLbdtAhB7SKsnfCELXNh9ad9 X-Received: by 10.223.139.75 with SMTP id v11mr12863638wra.244.1515504450881; Tue, 09 Jan 2018 05:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504450; cv=none; d=google.com; s=arc-20160816; b=oO0vpnb1U8OiZ8MevCRVCH2YW/cTULkT5MfwRDIQKHOGjcVjncddtz1aLVilnIIami hMPFa7FO+hC3yF6QDM2a8B1eUyAPYsJHwIXJFL+eB7vIhIoMFNKBl81D70S/BKVIAFX2 f56KljBHtMjOHwGbAB4XEq8twOMe5mzooSEnYyDgWi+ya6gOTomz9ca6EakZ/ZpNPLEG HtEfVdlmiYU1FpCJQXvGoSWypeLyL5KSIjDAZe/UTKX0q6MSq9X6w3Pd65N0yMOaNTYF LbhkK1EJkk7eLjcuBce7HJ4Lt4l8brquq+YtOfQRMuZfrbVbAqwwH6W4n2NKI8Jq6n7L 8xkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=ZhSkn8FFpRbGiwC/ZJtz5Ov7UCXIw/UsCzZmabqkaa4=; b=A7ZHnouMsTj6XZ3Mf8w29suSoz9uHe9uQN+wuFYqPIdbRUXJz/RrhMtSQzqsrevyvP sl8C+MJbvLdC1OijPBJw8YCys5lPrt/tdWwXNXa20zU2Q0v6sDkU4hpT0TmXHpgznLtJ vrtvFiTKA2TuDRXVjnhVGC2Y3VnlEue8CBGATOwRnluRhmc7jmVm6VCJBRTcQlm7DVQ5 9yMPI9xYjiNL7e8rXdJ+OP+ss/N7EvmwxBQKuUlpz8lHGV2yTgeEzMeDs4vmfwcmd5pM O88Zlp4Btc0SrvyZ63M4EOVUi/cZcO2Pn+IsyY4WLL6VrxsxcBU9YlYkTfAZxfCT/gMu P0Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id q9si11094845wrd.327.2018.01.09.05.27.30; Tue, 09 Jan 2018 05:27:30 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 445F71B23A; Tue, 9 Jan 2018 14:24:52 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0088.outbound.protection.outlook.com [104.47.38.88]) by dpdk.org (Postfix) with ESMTP id 364A71B231 for ; Tue, 9 Jan 2018 14:24:49 +0100 (CET) Received: from BLUPR0301CA0016.namprd03.prod.outlook.com (10.162.113.154) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:48 +0000 Received: from BY2FFO11FD034.protection.gbl (2a01:111:f400:7c0c::180) by BLUPR0301CA0016.outlook.office365.com (2a01:111:e400:5259::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:48 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD034.mail.protection.outlook.com (10.1.14.219) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:17 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVx017638; Tue, 9 Jan 2018 06:24:44 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:53:03 +0530 Message-ID: <1515504186-13587-16-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778573943967; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(39860400002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(77096006)(81166006)(16586007)(2906002)(97736004)(48376002)(51416003)(296002)(356003)(54906003)(316002)(305945005)(8676002)(81156014)(85426001)(50466002)(8656006)(86362001)(6666003)(5660300001)(4326008)(68736007)(6916009)(2351001)(104016004)(47776003)(36756003)(106466001)(50226002)(53936002)(105606002)(2950100002)(76176011)(8936002)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD034; 1:Ay8VSK3aQoT8e8CYOSWyA+ij+R1LHtAixgxsoYaOtrq2TXmwCv0Hkj7q3RTRa4Ky2/erbAp27u2EhoHXjoFrv16j6fZTLcbgJzIgk71/pzyHyMvW5KaKl5reD2N64bGO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5826cfd2-ee40-44f5-849f-08d5576448e2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:nSyfnbq90wmwKaDJxvkV0ORXAzpKThZ1tvaX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xqgDIV+akjvMp2iyqSemyxj4db16+izbiEuGT+XkW5/lbJp1IGTHzBu2QXAIDJ8+owE5gt57rFhGuYkTp9+anm5KYj6nfQkOJqpVouBG6LLMT7Ym7hyjgxCclwZmz94yCa6buKZax2Pj8x7XkkgsjDvmAQdSlIHNkZn63q/nXS5iGHJFOyz9rM+HR4dPHQYuRRb/IYGhZhfvNIPin6YuOVqfT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:sSSWSbLspV+n0Rn9JI+zjT/RZ33pw3foRQSv6EBhF?= 9FN3Uk1QX6zogs74hnoMJD9AtrsAPEsG4bYIiIn8qXqoj7FzQsb1Lbbv4apAZBfHKK6g9eeedrf2H3LmgETu8O2b0brMiyb4qEBf8Wh1B7s5yqhmCSZJomogH08K7fB865z5p+1WuTIwVrX6C6Kzn17UIaMtnlkXgqoeTTDHh5aZpKqyj5n6p88xi7u0uKpFFg59/2GEKvYGuBaCrwaX5lnt7AId3eZtdzy+ImiF5qawKPrlRhaEqZZnQTUR2mPO3B77oDo12XaL/D7/6+hVqHVyMA1WABxW87ILIhusgpHnJKmRRM+apL7rM7LemL2WlInOQoIqLianDF2y7R1KPWOQVW+4LHjyKHHt0XEww2UFj54T2ibgOxdUcdW+341hrYXKX/ijd6t8/4JIXmPkVgNjmBE5yDq1CpXirG8W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n1qX+6148ly95wcpXvuGW1syX7EMLH4hb3kp5EmlQwFAb04E4ZWJFN5lfWCmXERfO1B8E1a9wbySbTYtHmjl9iQBSEDFdG3R43dVtvfIb40i6a3BJGXRG6qNfzAtc=; 24:cdICbhi2O7r5xlQ6bYcx69YNtt0kVSgE9tGMEb4eLd1Daoou+6xfGpZQ2JXTApI6jbBdKkwhSbzj/5PYbv6LjOV1bqgKqrnTLD1YaK/RF5s=; 7:4jRUahNpabPgJJ8/ETt4eutEfITFA8C70x12/wtddumZvqGMgQfNa0muIY7ccWegG1Mnw+fo381p2PP6YW2Gq5lzxUGyCTuW0s6q3bWLFuendJoK45sLF6skSziKdWeg/CwSKQkkVwMS/H1PHjk4GkyCMWERdqpqk81cqmA2K2Eog2KD0MlCCnGjLGlWsftccbfPJHnJlFQLfMhDWqKagy6JaaveMYAIdToIdRCpb/N/3OHGGStsJC8Cu5MAW0yA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:17.2071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5826cfd2-ee40-44f5-849f-08d5576448e2 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH v2 15/18] app/testpmd: add support for loopback config for dpaa X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- app/test-pmd/Makefile | 4 ++++ app/test-pmd/cmdline.c | 7 +++++++ 2 files changed, 11 insertions(+) -- 2.7.4 diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index 82b3481..34125e5 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -43,6 +43,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y) LDLIBS += -lrte_pmd_bond endif +ifeq ($(CONFIG_RTE_LIBRTE_DPAA_PMD),y) +LDLIBS += -lrte_pmd_dpaa +endif + ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y) LDLIBS += -lrte_pmd_ixgbe endif diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f71d963..32096aa 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -89,6 +89,9 @@ #include #include #endif +#ifdef RTE_LIBRTE_DPAA_PMD +#include +#endif #ifdef RTE_LIBRTE_IXGBE_PMD #include #endif @@ -12620,6 +12623,10 @@ cmd_set_tx_loopback_parsed( if (ret == -ENOTSUP) ret = rte_pmd_bnxt_set_tx_loopback(res->port_id, is_on); #endif +#ifdef RTE_LIBRTE_DPAA_PMD + if (ret == -ENOTSUP) + ret = rte_pmd_dpaa_set_tx_loopback(res->port_id, is_on); +#endif switch (ret) { case 0: From patchwork Tue Jan 9 13:23:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123956 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4022133qgn; Tue, 9 Jan 2018 05:27:56 -0800 (PST) X-Google-Smtp-Source: ACJfBoux/THiijWi/EhPm+ocQSiFakc4BOtAs8MR8w5OawA0rGgt0f5QC6IzIWgqzxCCEkU0DpIP X-Received: by 10.223.130.196 with SMTP id 62mr877421wrc.145.1515504476676; Tue, 09 Jan 2018 05:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504476; cv=none; d=google.com; s=arc-20160816; b=YacFtbcJYAVBWdC7dhxBTD1psIswuehrB3ToyTRuullVT4BYNkIDtBiyMhVl8NosR2 7Y8oQ4dqzl69guIiHVElQ4C+JK1z1q6qvmtVpeHBUO49QwObqeXypDuCCgKdmj6Q0SOz 8ErQhzZd34DS2wUF4V5VxLm/kulcIymIm3fpgJUstComTnnmDJvEvJdOBcCtHImSuYWO gbq3Leg1a7XkC530DNXOaT0MQZApqFm7EkaVdXgGxebepDC8CSHVBNK7wVgAccgX4wbt W7hFUTmDUg7QfoKZjQMEOKiFwjnIZAfvIO1MBfiCZTDGe2I/DB/MrVd7Wgg9GAJHqGl9 gIqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=/EZWadmLfUbUUWDhryRj1gioZPzf3KdsMSDNisVMg0Q=; b=Kzdujsp2K+Wc5/UHYdgj/fnsMKia7zzCANR9ZGQJaKo0NcAoGE5ekdB0dXKHlp+MYn /jp+ilEIKSB7bcYHxMDGL/H0ZBRVPV+rwGnDvBr5OzZ06C4cr1BriC0848s4u3HzOqXn XtSwruxayU1Yu8wEsV50Fjh0CQgjngqb0bAICKss9++B60UzPyq76KEf+FFvs2hQPy+R ZCuKMnA7oJIcRPjS62or8Ymbz6OZLilFawa9zfn+XxvcBjMWlob2zaIlnmMFqtm6VrUR l/ErCA6ih+OzCC4DVOZam6xCh026bhpJGpk6AMlZdH3PaYxYjS9KDk3uh91YrM0KxymK EORg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 8si10946051wrz.280.2018.01.09.05.27.56; Tue, 09 Jan 2018 05:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D6351B247; Tue, 9 Jan 2018 14:24:55 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0055.outbound.protection.outlook.com [104.47.42.55]) by dpdk.org (Postfix) with ESMTP id 4D31A1B23B for ; Tue, 9 Jan 2018 14:24:52 +0100 (CET) Received: from DM5PR03CA0040.namprd03.prod.outlook.com (10.174.189.157) by BN3PR03MB2356.namprd03.prod.outlook.com (10.166.74.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:50 +0000 Received: from BL2FFO11FD051.protection.gbl (2a01:111:f400:7c09::118) by DM5PR03CA0040.outlook.office365.com (2603:10b6:4:3b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:50 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD051.mail.protection.outlook.com (10.173.161.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:19 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAW0017638; Tue, 9 Jan 2018 06:24:47 -0700 From: Hemant Agrawal To: CC: , , Sunil Kumar Kori Date: Tue, 9 Jan 2018 18:53:04 +0530 Message-ID: <1515504186-13587-17-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778592175356; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(39860400002)(396003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(77096006)(51416003)(81156014)(356003)(305945005)(36756003)(498600001)(68736007)(76176011)(53936002)(8676002)(86362001)(4326008)(8656006)(50466002)(48376002)(59450400001)(5660300001)(54906003)(316002)(47776003)(8936002)(104016004)(296002)(2950100002)(6916009)(85426001)(2351001)(16586007)(81166006)(50226002)(97736004)(106466001)(2906002)(6666003)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2356; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD051; 1:lP1/ixwfPBu27dBgAK9LxfBV/wSqG72pYO7Cq/jaZ3xyEXMXuByceH1onOrGJNpcNRiskoDxUmuJTwz0yZun7Wtj1j12X1HcJvbKP30xUppCJJUkN4q5ojXQFj3uYZmo MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0f01d10-7f44-40fa-b4fc-08d5576449f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2356; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2356; 3:JI83kJkSKCRcb120mc/l6Id5fON9fe2hxI3M6nCg9FxJ4IPIDs+g0piua94aF2fdE3TQMAVp05gNTm2cDEJ8w09/GwGKs+mMd45BSP08IYWz6hk+QyKubSQneEq6RhLWhV395xkX/4IL/zQMe76aG2d2KCMVjBFzE93LnlrHOAteROa7CDcUFKEBTes9LOVpUOXmDa6IBQFMixNzTEf12Qj1GL5MPR4rvi5lEs19xVhFKFknmU1javHxOdEUuZbIn8Seje1v4dEXucpHQ2L99Dt0fuoQ3OTdAoXfil1JQr2jzBOXxyjdYISZRFtiLesFd+ZTQuu/49/8N9Kp85RGdzlI9VM5gOuUoJB3iY1WUFU=; 25:xCd1X0ouXLjPAv1c73AOwSKCHSe4Mp4ulGt69b3TUUZaVLCtGPxaPHJsFnWd5uihV/WnIBvwOQql53rYFFFKPDcKMK2SZym+jpQXYJU4VdMKNW2RZjYCPXNdw2Y80YnsriXNkAyFp03Czkn1/na0++rjcBcq4qOuIMg0N22i4IaF+sgxTeynwhj9GdC0bf7CifNzs8uL83kPSrkRGy/8PuhGdH9NeZosEtDwqCee7XXOfsK7eWGE6ar47FxiEoJnIOCxSp0VcIzxJdjNsXROrVu6mLsdNkzo8+LWfXIR5BWHSMx51+CU74KczgxafumA/y7buTMDvUOCkIxzy/0LcA== X-MS-TrafficTypeDiagnostic: BN3PR03MB2356: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2356; 31:xp0J4IpZ49zTTduLY7SqDU96V8EYJkOlAQhhDGDDl+oaTdmMlFUyint7uGXFKoi99C1SRmTUhhlVhnNcgVHoEYw2t68Jo959B6bVY+WVeu7fh227wRJEl8i4dOPvAT2Td/QSmB4VXx7IF6mPMHyeRWBE3QK71mrEL+Ijotnds89jB0Vh/xlpSsQInhxNPPviXR0C/+RVphjs1yDj7HcCS5RA/EgUkh++MYn2IC9Ex5E=; 4:v5pet5usQBhtpFeqVUaLOxU2UMTolvRii4UX5VFXqfqX2EPy48aLvdHIS0fnojYg+APdd0SHybKfNd6T1+qShXdZIBRAP6QsWWasfDAxFHd7fp0yUIcP906Ob2vKs/Tto5zWFAAwp85ZbW+ZUDl4T8VMpO53Yv2YMrFFsbpxM6sb61j0yPDA5pniwnyL2AMBaiNDf/ttQUuirH6j1vNEXbvOz2jDjk3YOyzKVofU8rvLLkB/+Yy+KvZb8A/W/DX9mCvSIgkGfVzcLsmuG7+0SAnn7uvahef7/Q8tiG7BcqKT3FyTVEWub7Yr3EqoBKdp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501110)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123563025)(20161123556025)(20161123559100)(20161123565025)(201708071742011); SRVR:BN3PR03MB2356; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2356; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2356; 23:/0P7pVmLF6p6bH5JRUy4HDDalHBCXxgvhvGb1qbzG?= 8G3zA4BsI2KZXSRgpeEz2aazOS6vAcZG7w+3/VUsKCb4P1xqtPg49+aYaohvzaS2YrAASxlJ9YA2oPU8Xf0gMJzro6qEZCU/BCFqJF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hGcnzMXWpRmsT+RPMQh+2OSdcrvuJ1gdWXWZM0AvhKQ7L0bM+ggRhpy5NcIZmdrnWJCe9JGQUNNDCxG+isSgMcHVYlSzJ41eA55cyzRI8jYrwYBNdttpQdQP6HW99SeczbThQotF1XoHL8LJtkhVounPcPayaFEtVIxRnJePyZseg8ATtXxKrWwZVnk6JYEUTjvvAi3kPyIF1UFOjeoL8LsmyTYkzIKmdjTQYqbdXaHV15ApEoKYYtoHPedsmTPLY41sXvBtJAI1aP44UpdSb3HHeSUpNrvlYb57qwanF64+PsyGES9F0=; 5:++54cD5D7s/Ay713RX7r+eW+J/BYRVDAJYtToXZw4iE4eNuSSRyJnV/WM96QjcmuXIpFIWKdj/nZx0/JPe22iDEB1e6z3/IWmEQNbI7Qy1dOeSCl5yb35OzIrQOKZSJATtVaxk3LaHABs0R03SbVjFYgSfPx+5LXQ+P5xW65M+4=; 24:M0ovChoRIIRXmLOrVWSiQoIPM01x0ePgsCejzpx1hC2zsWHyakSz0VXfAb/dQ1xUEWqhe+/ahBUilB31lZwaREk/eN3iwuTGYfNKI8jsfgk=; 7:+1XjR+FmGHfzxkOeXAhWcKgX29nz7Gk87nCIlDfyRYsSutOa4YjLVPiDy9cR+a+G3pHV3pg2x/q1tNhsMzUNCAor1H2XAxX/FQXsKYuSuL4ONVHngaAqSvyH/lvuHHM1cexPS4pYqPi8r2uJ5HaoGRhzv2DxXsidWDlx9SmuFZaFPoyjz9wBHUkZV7Sri4c1JLN+F5RnN/cXietGn6h4gDYfCZJ04p94qjwYoWT6tCDkQ2tvsX+N/GWdJwKPOFzF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:19.0615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0f01d10-7f44-40fa-b4fc-08d5576449f8 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2356 Subject: [dpdk-dev] [PATCH v2 16/18] bus/dpaa: add support for static queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPAA hardware support two kinds of queues: 1. Pull mode queue - where one needs to regularly pull the packets. 2. Push mode queue - where the hw pushes the packet to queue. These are high performance queues, but limitd in number. This patch add the driver support for push m de queues. Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 64 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/base/qbman/qman.h | 4 +- drivers/bus/dpaa/include/fsl_qman.h | 14 ++++++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 4 ++ 4 files changed, 83 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index ffb008e..7e285a5 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1051,6 +1051,70 @@ u16 qman_affine_channel(int cpu) return affine_channels[cpu]; } +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, + struct qman_portal *p) +{ + const struct qm_dqrr_entry *dq; + struct qman_fq *fq; + enum qman_cb_dqrr_result res; + unsigned int limit = 0; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + struct qm_dqrr_entry *shadow; +#endif + unsigned int rx_number = 0; + + do { + qm_dqrr_pvb_update(&p->p); + dq = qm_dqrr_current(&p->p); + if (unlikely(!dq)) + break; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + /* If running on an LE system the fields of the + * dequeue entry must be swapper. Because the + * QMan HW will ignore writes the DQRR entry is + * copied and the index stored within the copy + */ + shadow = &p->shadow_dqrr[DQRR_PTR2IDX(dq)]; + *shadow = *dq; + dq = shadow; + shadow->fqid = be32_to_cpu(shadow->fqid); + shadow->contextB = be32_to_cpu(shadow->contextB); + shadow->seqnum = be16_to_cpu(shadow->seqnum); + hw_fd_to_cpu(&shadow->fd); +#endif + + /* SDQCR: context_b points to the FQ */ +#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP + fq = get_fq_table_entry(dq->contextB); +#else + fq = (void *)(uintptr_t)dq->contextB; +#endif + /* Now let the callback do its stuff */ + res = fq->cb.dqrr_dpdk_cb(NULL, p, fq, dq, &bufs[rx_number]); + rx_number++; + /* Interpret 'dq' from a driver perspective. */ + /* + * Parking isn't possible unless HELDACTIVE was set. NB, + * FORCEELIGIBLE implies HELDACTIVE, so we only need to + * check for HELDACTIVE to cover both. + */ + DPAA_ASSERT((dq->stat & QM_DQRR_STAT_FQ_HELDACTIVE) || + (res != qman_cb_dqrr_park)); + qm_dqrr_cdc_consume_1ptr(&p->p, dq, res == qman_cb_dqrr_park); + /* Move forward */ + qm_dqrr_next(&p->p); + /* + * Entry processed and consumed, increment our counter. The + * callback can request that we exit after consuming the + * entry, and we also exit if we reach our processing limit, + * so loop back only if neither of these conditions is met. + */ + } while (likely(++limit < poll_limit)); + + return limit; +} + struct qm_dqrr_entry *qman_dequeue(struct qman_fq *fq) { struct qman_portal *p = get_affine_portal(); diff --git a/drivers/bus/dpaa/base/qbman/qman.h b/drivers/bus/dpaa/base/qbman/qman.h index a433369..4346d86 100644 --- a/drivers/bus/dpaa/base/qbman/qman.h +++ b/drivers/bus/dpaa/base/qbman/qman.h @@ -154,7 +154,7 @@ struct qm_eqcr { }; struct qm_dqrr { - const struct qm_dqrr_entry *ring, *cursor; + struct qm_dqrr_entry *ring, *cursor; u8 pi, ci, fill, ithresh, vbit; #ifdef RTE_LIBRTE_DPAA_HWDEBUG enum qm_dqrr_dmode dmode; @@ -441,7 +441,7 @@ static inline u8 DQRR_PTR2IDX(const struct qm_dqrr_entry *e) return ((uintptr_t)e >> 6) & (QM_DQRR_SIZE - 1); } -static inline const struct qm_dqrr_entry *DQRR_INC( +static inline struct qm_dqrr_entry *DQRR_INC( const struct qm_dqrr_entry *e) { return DQRR_CARRYCLEAR(e + 1); diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index d769d50..ad40d80 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1124,6 +1124,12 @@ typedef enum qman_cb_dqrr_result (*qman_cb_dqrr)(struct qman_portal *qm, struct qman_fq *fq, const struct qm_dqrr_entry *dqrr); +typedef enum qman_cb_dqrr_result (*qman_dpdk_cb_dqrr)(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); + /* * This callback type is used when handling ERNs, FQRNs and FQRLs via MR. They * are always consumed after the callback returns. @@ -1182,7 +1188,10 @@ enum qman_fq_state { */ struct qman_fq_cb { - qman_cb_dqrr dqrr; /* for dequeued frames */ + union { /* for dequeued frames */ + qman_dpdk_cb_dqrr dqrr_dpdk_cb; + qman_cb_dqrr dqrr; + }; qman_cb_mr ern; /* for s/w ERNs */ qman_cb_mr fqs; /* frame-queue state changes*/ }; @@ -1299,6 +1308,9 @@ int qman_get_portal_index(void); */ u16 qman_affine_channel(int cpu); +unsigned int qman_portal_poll_rx(unsigned int poll_limit, + void **bufs, struct qman_portal *q); + /** * qman_set_vdq - Issue a volatile dequeue command * @fq: Frame Queue on which the volatile dequeue command is issued diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 212c75f..ac455cd 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -70,11 +70,15 @@ DPDK_18.02 { dpaa_svr_family; qman_alloc_cgrid_range; + qman_alloc_pool_range; qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_oos_fq; + qman_portal_poll_rx; qman_query_fq_frm_cnt; qman_release_cgrid_range; + qman_retire_fq; rte_dpaa_portal_fq_close; rte_dpaa_portal_fq_init; From patchwork Tue Jan 9 13:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123957 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4022443qgn; Tue, 9 Jan 2018 05:28:14 -0800 (PST) X-Google-Smtp-Source: ACJfBotDJiyiPFioL9HUI4LVArAnXnz9I/fTau8w6OInR5s79Eg8zgBpp6WSs+aVjuGN0C856wjc X-Received: by 10.223.162.199 with SMTP id t7mr14011936wra.130.1515504494762; Tue, 09 Jan 2018 05:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504494; cv=none; d=google.com; s=arc-20160816; b=IqOU7jZCS+iUggbZ0SCyFqK0lCwT99NClduU1DGB6/lWjzr6nJ1zJhO8mC1iCParWL DXRPGnA0hq20Wklt3p+Kd2z3JDon0/tyeYZZH1IDuhBesklWQHfTYL6+p8PvWq/XQT9c 3PIAW157O3/6ZpzDpqyyrhRHkOF4bzhtLQnzVeiPxi14Gnx2/1BtoLL8QDJq1Gtr9OU2 TKU3P1aCsKkkZ2kmLsARZrKF3Hs3uUDSM6PryMj+lrYOLBpN5O1YCkLhVH/2uIbjq/xv cQ6VNCtqHVpXuCwX0rTZJksYTYjjl2NVwCZzgDMwqvYeVlqsIb9xlqoyBxvz0ShrWKO7 mP0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=9HYWrsBjo43a4mwHLxLvV+VoarPweJeo6kYvwI0vOmE=; b=zJ9d9yTOukU2ehR3sp2PSiz+2NMz/p++9Nev3S4Ys4reo3GXQqpEf1x6eLdFpRs5VF 3lez7yhkhffGqP01jubWU0ODSLZYr+P6bP7X0D+oNUyxtkxctJ4qYCDE94murPsCtPl8 vuUi/fWxcCqvzrCTVS2BEpaCJx7YjXvxRngqJ4sL4sqSw3COCAdGOJ1z3mxso5h4I6kr iy9v7Q6tqHdFelY4irEpKkGvsG9YCf4P8CicOOsYOaQrnKPdaKVYMR7CXVQq8w9vJDlL 3sVbDKup/y1Qc6vZyrwwbSTICIkqY9xHKVzPljrUnE+SRSLrfNYgtLrwKk6hPrmJeeGZ d86g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k184si9457248wmd.221.2018.01.09.05.28.14; Tue, 09 Jan 2018 05:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CE941B252; Tue, 9 Jan 2018 14:24:57 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0062.outbound.protection.outlook.com [104.47.42.62]) by dpdk.org (Postfix) with ESMTP id EC4D41B243 for ; Tue, 9 Jan 2018 14:24:54 +0100 (CET) Received: from MWHPR03CA0015.namprd03.prod.outlook.com (10.175.133.153) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:52 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::141) by MWHPR03CA0015.outlook.office365.com (2603:10b6:300:117::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 9 Jan 2018 13:24:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:21 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAW1017638; Tue, 9 Jan 2018 06:24:49 -0700 From: Hemant Agrawal To: CC: , , Sunil Kumar Kori , Nipun Gupta Date: Tue, 9 Jan 2018 18:53:05 +0530 Message-ID: <1515504186-13587-18-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778619438283; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(296002)(305945005)(68736007)(498600001)(4326008)(16586007)(8936002)(77096006)(316002)(356003)(50226002)(81166006)(59450400001)(86362001)(106466001)(81156014)(36756003)(105606002)(8676002)(47776003)(2351001)(104016004)(6666003)(2906002)(5660300001)(54906003)(53936002)(8656006)(76176011)(2950100002)(50466002)(48376002)(6916009)(85426001)(97736004)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:xKphphRYtlEd6W3beTxUAkEvWdd/7+wahfxZh785iWQVm2wESA75HFEK5scep8FMjrKdTMxh1XPNhAkbNb9wz70sdqEHiCGIy52GgiG9M/i1ZpPyT4fUnBJZ2B//fz+G MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6f3d63e-0519-4b1d-b4cb-08d557644b98 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:pmXZkDmDcdlunfF15TkdWwwlJCtrirFsdoSwHyXc9n+9n0w4PECyS7EbGDmHFmA/4XlEba1HqeUjlFAanpdItPUA2PohuU+JYRllQSL32HsGA55YBXtu/RDKvHseM4Zbz7IJS3iL7NKUUw6iQOHDUWdFL/iDXOdVDDqWyr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RXUm3d/3lBhmIqbhQL11UBk3/mlvgLUOC5iKRMzbiHLHdl8WeVKx9Efk3WmoP3mqjxP6sEQf0r6EB/yYFaJ2cOrekW2K7SThOnxtaibs8HmW2NZnjQiYSRWqyn458GxV34xmAR2MhTS0/leYKZlSzxP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:5UASTwPXeClTiGx9HqBp8KxwF7u5QieelGH7RMsb/?= dxRgTYBkwnv5XdU4vXtcBw+MQbzYfWlou85MXMKq1KqRvMCTZMbl/wGJ2IvREZQaoj3azdb95BOlylYy+EZictFtnMhfo4+RW15qNZnJrzIN19uv3wD456MXcWd+GV8GHpFWSvXo7dUPdUvowFv3mRxAB4+2EQdoI73vdojI7eATp8Ltou6sVG+F818XzoJy6zkWA4syjIYa/tfWLgscVlvgKhJqrA1kTeS7SvZhUMeUyGRL8VOhBVQJxL/KwSp3q7lbKMk4/rrRVEk0vonp5AMiMFFNob+qPyHCg+ZQk4z7bSuBdqZfHIxOecfgy69prhUtYT5CkJZI8TaShZ3PZWWCoF9WVoAnxfq/SuON6GuT4bz0t8vNue0X0a4HAGctqMZ6JkCVulJzcSwfvhbjj2/RJ8h5Bdig04RAtRRxA7Rqx9LojvmtJDnzSQ0N8dW4f3NCRbID7TYLBtMkQCuVYOynVErw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4e9aX7gTjGqR181H7LHh90O4vH6AJsVoifDnQ5O59nHvfRH9eCH8HM1t6N8nhBlhN712hV3sZu3977iCg7U4xXgIQh0QR8J2ZuoQxWyWdtCSMCq27s/zWhqve3B2I=; 24:pj1cyIOJAStZUCs0mI0DWDIG8cc5C69O+kBI+AdHIM6RdAiuQIgaS3iMU06KxbLf7ZQ1Y3ydVFoHqlVr0vxlM7tAIHy+14U8yqWsBe7g7Q0=; 7:om9ufEa0C6E0llyf0r7NL9qRvnjrEZ038ffvamN0tq50wCrWhKyhTAY7fz2zYNOOsK8Sr4O0UZBFvyDFziAhfRyXvTKJN9fBz+/4y6yQezkIsbZSUkPgCgucEGicBE3EnIkXS9Nk2xAlkA7lEJISVlYQ4J/y1He14fozEYM967V55njh3WGa48lU0wtov9KR+TB2pgGdCEmWoS8sTRi9M8LcgXqZz8QzNLBFAiyH/Rh26+roegqTUijezD3+m/SV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:21.7566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6f3d63e-0519-4b1d-b4cb-08d557644b98 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH v2 17/18] net/dpaa: integrate the support of push mode in PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- doc/guides/nics/dpaa.rst | 11 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 64 +++++++++++++++++++++++++++++++++++++----- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 34 ++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.h | 5 ++++ 5 files changed, 108 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index a62f128..0a13996 100644 --- a/doc/guides/nics/dpaa.rst +++ b/doc/guides/nics/dpaa.rst @@ -290,6 +290,17 @@ state during application initialization: In case the application is configured to use lesser number of queues than configured above, it might result in packet loss (because of distribution). +- ``DPAA_PUSH_QUEUES_NUMBER`` (default 4) + + This defines the number of High performance queues to be used for ethdev Rx. + These queues use one private HW portal per queue configured, so they are + limited in the system. The first configured ethdev queues will be + automatically be assigned from the these high perf PUSH queues. Any queue + configuration beyond that will be standard Rx queues. The application can + choose to change their number if HW portals are limited. + The valid values are from '0' to '4'. The valuse shall be set to '0' if the + application want to use eventdev with DPAA device. + Driver compilation and testing ------------------------------ diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 85ccea4..444c122 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,6 +47,14 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +/* At present we only allow up to 4 push mode queues - as each of this queue + * need dedicated portal and we are short of portals. + */ +#define DPAA_MAX_PUSH_MODE_QUEUE 4 + +static int dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; +static int dpaa_push_queue_idx; /* Queue index which are in push mode*/ + /* Per FQ Taildrop in frame count */ static unsigned int td_threshold = CGR_RX_PERFQ_THRESH; @@ -434,6 +442,9 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, { struct dpaa_if *dpaa_intf = dev->data->dev_private; struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; + struct qm_mcc_initfq opts = {0}; + u32 flags = 0; + int ret; PMD_INIT_FUNC_TRACE(); @@ -469,13 +480,45 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dpaa_intf->name, fd_offset, fman_if_get_fdoff(dpaa_intf->fif)); } - + /* checking if push mode only, no error check for now */ + if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { + dpaa_push_queue_idx++; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; + opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | + QM_FQCTRL_CTXASTASHING | + QM_FQCTRL_PREFERINCACHE; + opts.fqd.context_a.stashing.exclusive = 0; + opts.fqd.context_a.stashing.annotation_cl = + DPAA_IF_RX_ANNOTATION_STASH; + opts.fqd.context_a.stashing.data_cl = DPAA_IF_RX_DATA_STASH; + opts.fqd.context_a.stashing.context_cl = + DPAA_IF_RX_CONTEXT_STASH; + + /*Create a channel and associate given queue with the channel*/ + qman_alloc_pool_range((u32 *)&rxq->ch_id, 1, 1, 0); + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; + opts.fqd.dest.channel = rxq->ch_id; + opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + flags = QMAN_INITFQ_FLAG_SCHED; + + /* Configure tail drop */ + if (dpaa_intf->cgr_rx) { + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = dpaa_intf->cgr_rx[queue_idx].cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } + ret = qman_init_fq(rxq, flags, &opts); + if (ret) + DPAA_PMD_ERR("Channel/Queue association failed. fqid %d" + " ret: %d", rxq->fqid, ret); + rxq->cb.dqrr_dpdk_cb = dpaa_rx_cb; + rxq->is_static = true; + } dev->data->rx_queues[queue_idx] = rxq; /* configure the CGR size as per the desc size */ if (dpaa_intf->cgr_rx) { struct qm_mcc_initcgr cgr_opts = {0}; - int ret; /* Enable tail drop with cgr on this queue */ qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, nb_desc, 0); @@ -809,11 +852,8 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, fqid, ret); return ret; } - - opts.we_mask = QM_INITFQ_WE_DESTWQ | QM_INITFQ_WE_FQCTRL | - QM_INITFQ_WE_CONTEXTA; - - opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + fq->is_static = false; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | QM_FQCTRL_CTXASTASHING | QM_FQCTRL_PREFERINCACHE; opts.fqd.context_a.stashing.exclusive = 0; @@ -947,6 +987,16 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) else num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + /* if push mode queues to be enabled. Currenly we are allowing only + * one queue per thread. + */ + if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { + dpaa_push_mode_max_queue = + atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); + if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) + dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; + } + /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX * queues. */ diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1b36567..1fa6caf 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -54,7 +54,7 @@ #define DPAA_MAX_NUM_PCD_QUEUES 32 #define DPAA_IF_TX_PRIORITY 3 -#define DPAA_IF_RX_PRIORITY 4 +#define DPAA_IF_RX_PRIORITY 0 #define DPAA_IF_DEBUG_PRIORITY 7 #define DPAA_IF_RX_ANNOTATION_STASH 1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 98671fa..0413932 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -394,6 +394,37 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) return mbuf; } +enum qman_cb_dqrr_result dpaa_rx_cb(void *event __always_unused, + struct qman_portal *qm __always_unused, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bufs) +{ + const struct qm_fd *fd = &dqrr->fd; + + *bufs = dpaa_eth_fd_to_mbuf(fd, + ((struct dpaa_if *)fq->dpaa_intf)->ifid); + return qman_cb_dqrr_consume; +} + +static uint16_t +dpaa_eth_queue_portal_rx(struct qman_fq *fq, + struct rte_mbuf **bufs, + uint16_t nb_bufs) +{ + int ret; + + if (unlikely(fq->qp == NULL)) { + ret = rte_dpaa_portal_fq_init((void *)0, fq); + if (ret) { + DPAA_PMD_ERR("Failure in affining portal %d", ret); + return 0; + } + } + + return qman_portal_poll_rx(nb_bufs, (void **)bufs, fq->qp); +} + uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) @@ -403,6 +434,9 @@ uint16_t dpaa_eth_queue_rx(void *q, uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; int ret; + if (likely(fq->is_static)) + return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); + ret = rte_dpaa_portal_init((void *)0); if (ret) { DPAA_PMD_ERR("Failure in affining portal"); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 78e804f..29d8f95 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -268,4 +268,9 @@ int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, uint32_t bpid); +enum qman_cb_dqrr_result dpaa_rx_cb(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); #endif From patchwork Tue Jan 9 13:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123958 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4022673qgn; Tue, 9 Jan 2018 05:28:28 -0800 (PST) X-Google-Smtp-Source: ACJfBosPFsLWgNYs5X2LNAXiJxHQ+qYfQSDqfK65B2+ZGYNOeCSRYBZnfxzCcpVbRDVn9R7JwTI4 X-Received: by 10.28.16.211 with SMTP id 202mr11771771wmq.49.1515504508823; Tue, 09 Jan 2018 05:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504508; cv=none; d=google.com; s=arc-20160816; b=PKSawatPEyE1Feg4gzPCREMD8RStzuEpUA4Oao73efGrY94pQ+/k2jjRN5gE/T8mGv mMdMbVF/dI6A1snLyDbuMZ0TKKqujqxy4mBq+2UBKAWmJ+V7hHqz93xTuGNPAtiHSwjS zKOrbxhnPCqZ9RkHLFZg80flH3uQOc11ztwNEoCxOT19JVan+orhlgVBAOJpC4/I+G8o 4m8OAeb36VChy1Lb+1Flqw21I2YeQi70/UfKmKc6BcF43bgjIUiIPLSLFPwmfKfsa4DQ OrBq+ybBZOx6UsnrBVVT0Sz1lD8BAe1QjckikSeEa5xhUIx5xUMviYk8z0qCIqPp4m1U KnTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=JPDMiFYMS3+CS13EfAD1Ilo8TapOEYzLKb08ZNhmghQ=; b=Yvo60Mj5nSFElo9pgm1Bt/YKYNSSnAFJNXnuzl+nsBOCHBCyIKM3caz+Z30A6IQxHx N12L9tXeHXVreUCOV4ZBdEmWaUXBBjJCtv/VPGDzF0pN1bRCAnawHatz0J3psGA28u98 Xj3a2Hc69xjTAkj8TMhuoQ6A3VbZ6q2tx9a1jb1K27pAnL7cvDaOmImf9H5G9lcZD7nI KFupctT9En8c9lUynMGuki+ILbPxPXsWtuc+yUC57Mo0rfvDJ3PjtqCVFvTubBJoJc1Z 2Ex3cF4F07rbtapet6RGuf5bl4GSNLzKzVhDWm5ZHhN+YJGQsV+Bo6kYWIMLqWNn54r8 tmZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id t198si9272810wmt.93.2018.01.09.05.28.28; Tue, 09 Jan 2018 05:28:28 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 82C961B258; Tue, 9 Jan 2018 14:24:59 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0043.outbound.protection.outlook.com [104.47.33.43]) by dpdk.org (Postfix) with ESMTP id 25E571B24A for ; Tue, 9 Jan 2018 14:24:57 +0100 (CET) Received: from BN6PR03CA0078.namprd03.prod.outlook.com (10.164.122.144) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:55 +0000 Received: from BN1BFFO11FD027.protection.gbl (2a01:111:f400:7c10::1:115) by BN6PR03CA0078.outlook.office365.com (2603:10b6:405:6f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:55 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD027.mail.protection.outlook.com (10.58.144.90) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:24 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAW2017638; Tue, 9 Jan 2018 06:24:52 -0700 From: Hemant Agrawal To: CC: , , Akhil Goyal , Nipun Gupta Date: Tue, 9 Jan 2018 18:53:06 +0530 Message-ID: <1515504186-13587-19-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778645522366; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(105606002)(296002)(305945005)(16586007)(86362001)(53936002)(54906003)(316002)(77096006)(2906002)(356003)(498600001)(36756003)(81156014)(104016004)(76176011)(81166006)(47776003)(8676002)(8936002)(51416003)(8656006)(50466002)(2351001)(6916009)(48376002)(97736004)(85426001)(2950100002)(4326008)(50226002)(68736007)(6666003)(59450400001)(5660300001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD027; 1:4ZjBColGcAQCaHDGJn1CSRH34zLU4S6/zSVqadSp7/fHkUC38nQm7p++ps6I4xa3FmXIXTr1o2rG+sVa/EnbELE/x+2Y9kp/+MawD8krRvQ+UbQ1bcCeN5LTdCLrgzpR MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f87e3a5d-d468-40e6-b7be-08d557644d26 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:g1Ap0GbWaLQWrBjRYEgg2Sp4WGzuCHQ2ADWtOytSe+LE6M2yMDZFPW7Dcj+QJXJNdXhAkxFKIsH8hbQFebhN2/vP2wIkui0nm8JBh/XW2SJpD2prxt7m/n04LhNlJlGqilOyhhT8plttkLzFuE7xdfuKqYLKzW7SI/Kv8eKwycmtUr8zJVbKqu2ra+/LRL6WPa9FjSBRstLDogi+7cuGhOPo+PLZf62Qlcl2oNjbFIN7K1UV+Wy97LtU+yQEZP4n5xtNnFscpdzeIbn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am-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123561025)(20161123556025)(201708071742011); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:O008QApk+zB8Xo4qyaHx6Im4IKx653z7OqIQzzm53?= y1NxzmCKF+BT4TDfTIheSF8thAN3xvFQqpi7kfwPiBJLKHyHJpTBvIUbd8NSp94jFaBPaJAJbWA5SeYAWO0lf7fYcAGqcyJu4if8I0sch/9hjvviaB+D0WlsIdc+7zUUJYku+16/hk2NhFqu5QtIp/NH1g2uLtKM4E3E9xkNRcEm+8hYDCekrz1I1rapJDhQPsKNzKAlxQUVBIai8qPHj4qU2HnUL8P/Ls/n9VKr+eJK9VAKqcYyF6PJbJhXe5zIzMm9t/6AjxklAcrlA8YjC3Qk3+E5GQhv/McreRgxWvzTAJH2TWXpbErnTh4Ael+xjX/oNE4zvQumT4MERCpHKZ7kQgmQT45f/I5VBg1L1VHc1RHoL1VvgZzbJTVGOvR4JRP+MIx+l6UBQYtQTjUDWus+BQa6KBpQhuhotuLglrp2mEqI+3rSssU4+gM88UAiFlEw0UzLdzjOsRA6OMtFfYbLajpn8auBzQqmWS2LDOQnTu7Tm1K4WAGb0moeKyqWjxbFL2iGBbaV/VQ7GUXIitpxIz4o8eV5xp7/qZ/u8THZHqN2l03vVg6XNzm5SarUKLKZxIDxr87XoOxcL/BVLm977oE/EMZvT5h6ibRKfib2tHV4z9mYIBtM4qe8PaGmTWuIMX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lNicy1xiYv1NnItFczTP4ytgkWA30s3UMmalBGyimvI0Y6iQ=; 7:OuwzGMNrp8TfYpVRooYCDGUZLeBKEPLKa2BDqaWS2fXvovCuU8/+vztNPTOWP7Zs2gQChVD4a6IXEo8mTK+ypznfqflHr0oXsF4j9esNf/2mUtJcBZOa5a/TZ7FcP4cO0xAXl6LWmfYirez72INJ8cKtBSsP8OnZhz9Xz4mgpbaFCGOUvZ4CkZTtagBzfReiV73lJsbjxsMCX3HGL6kre5F/dZrCY7bBKyTlB/o309wCKBxh2K8FOtkJidK0aJDH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:24.3806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f87e3a5d-d468-40e6-b7be-08d557644d26 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2701 Subject: [dpdk-dev] [PATCH v2 18/18] bus/dpaa: support for enqueue frames of multiple queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Akhil Goyal Signed-off-by: Akhil Goyal Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 66 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 14 +++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 81 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 7e285a5..e171356 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2158,6 +2158,72 @@ int qman_enqueue_multi(struct qman_fq *fq, return sent; } +int +qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, + int frames_to_send) +{ + struct qman_portal *p = get_affine_portal(); + struct qm_portal *portal = &p->p; + + register struct qm_eqcr *eqcr = &portal->eqcr; + struct qm_eqcr_entry *eq = eqcr->cursor, *prev_eq; + + u8 i, diff, old_ci, sent = 0; + + /* Update the available entries if no entry is free */ + if (!eqcr->available) { + old_ci = eqcr->ci; + eqcr->ci = qm_cl_in(EQCR_CI) & (QM_EQCR_SIZE - 1); + diff = qm_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); + eqcr->available += diff; + if (!diff) + return 0; + } + + /* try to send as many frames as possible */ + while (eqcr->available && frames_to_send--) { + eq->fqid = fq[sent]->fqid_le; + eq->fd.opaque_addr = fd->opaque_addr; + eq->fd.addr = cpu_to_be40(fd->addr); + eq->fd.status = cpu_to_be32(fd->status); + eq->fd.opaque = cpu_to_be32(fd->opaque); + + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + eqcr->available--; + sent++; + fd++; + } + lwsync(); + + /* In order for flushes to complete faster, all lines are recorded in + * 32 bit word. + */ + eq = eqcr->cursor; + for (i = 0; i < sent; i++) { + eq->__dont_write_directly__verb = + QM_EQCR_VERB_CMD_ENQUEUE | eqcr->vbit; + prev_eq = eq; + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + if (unlikely((prev_eq + 1) != eq)) + eqcr->vbit ^= QM_EQCR_VERB_VBIT; + } + + /* We need to flush all the lines but without load/store operations + * between them + */ + eq = eqcr->cursor; + for (i = 0; i < sent; i++) { + dcbf(eq); + eq = (void *)((unsigned long)(eq + 1) & + (~(unsigned long)(QM_EQCR_SIZE << 6))); + } + /* Update cursor for the next call */ + eqcr->cursor = eq; + return sent; +} + int qman_enqueue_orp(struct qman_fq *fq, const struct qm_fd *fd, u32 flags, struct qman_fq *orp, u16 orp_seqnum) { diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index ad40d80..0e3e4fe 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1703,6 +1703,20 @@ int qman_enqueue_multi(struct qman_fq *fq, const struct qm_fd *fd, int frames_to_send); +/** + * qman_enqueue_multi_fq - Enqueue multiple frames to their respective frame + * queues. + * @fq[]: Array of frame queue objects to enqueue to + * @fd: pointer to first descriptor of frame to be enqueued + * @frames_to_send: number of frames to be sent. + * + * This API is similar to qman_enqueue_multi(), but it takes fd which needs + * to be processed by different frame queues. + */ +int +qman_enqueue_multi_fq(struct qman_fq *fq[], const struct qm_fd *fd, + int frames_to_send); + typedef int (*qman_cb_precommit) (void *arg); /** diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index ac455cd..64068de 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -73,6 +73,7 @@ DPDK_18.02 { qman_alloc_pool_range; qman_create_cgr; qman_delete_cgr; + qman_enqueue_multi_fq; qman_modify_cgr; qman_oos_fq; qman_portal_poll_rx;