From patchwork Fri Sep 8 08:45:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112050 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1249354ybm; Fri, 8 Sep 2017 01:52:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QChm7eFp3DamAPEaWhQSsauY1ePctD+xqLeBPoTfbVUsa9Si0LLSkK7bRIQjifIhwaMuC7l X-Received: by 10.28.230.72 with SMTP id d69mr1322662wmh.70.1504860737362; Fri, 08 Sep 2017 01:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860737; cv=none; d=google.com; s=arc-20160816; b=rioqP0udj9ZN4P8vxVy9kB7uyqfVxOgenEQdwGI6c6oAaCsrxF4V8JbPg55evQU0c/ lWxxrZk1MDaHT/OtoCEMcy9bnYTx3+oBwczQ4A2yoI52rAr+0aeTr3/ApfwVaJfv+MIF WYg9g6XyOY0nkquI+t/0PvuA0PzzfUPepmyVkIAHOyLXEE/Qx+wyaUqRLRIrWK765EW3 gVRWlyEhmX7FrbCoAhuTE0md1oWQAx/0UvusvWMX+YQ3+tgXgfhPqDeI3+68f5swRNO+ SWGIJgIZlhjraMfP/FIftAIoD2F5ZA00lu5R6rK4VrqR7WDcJClS2Jj1AicdfXju0r15 jP7w== 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=DdfjkNQpSvAntb5SoVxtX1C0UeQ1e8AuL21MU8cj1VA=; b=Bum2Aqg/V8g3piNSvuQPzQW6J5R8H0F7a2iregjTRiYnzzl8g/QdO1PFkOVkHf6SRZ q8em6SXIl06ju9aXnkJ3MCSWDz0GqgHbCbj6eAQ+Z/OyfdeIECYM7BTFuS3R2GFgSWV+ 5U7qkITovl0F0mW+KsMgraiwLGPBiVLBdSi0Asb8Zv62xTtXvcIJAE0hi11ig+Q+v0U4 mQvY7DNn8VZYR2hiZI02M/RieaSpOyo7ZGuDW08qvZgQMpikMEZyLOE5w7EYaqm/ryar K1x4M/1ryaC/nIZORy1p7iCM6ZTJDDk+efml9qHE835DaYQUbqGP/DAL1xI3KQJTj6p7 eW0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id g74si1110514wmi.79.2017.09.08.01.52.17; Fri, 08 Sep 2017 01:52:17 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 95F81199F4; Fri, 8 Sep 2017 10:46:49 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0061.outbound.protection.outlook.com [104.47.32.61]) by dpdk.org (Postfix) with ESMTP id 39CCF19A0B for ; Fri, 8 Sep 2017 10:46:46 +0200 (CEST) Received: from BN3PR03CA0111.namprd03.prod.outlook.com (10.174.66.29) by CO2PR03MB2264.namprd03.prod.outlook.com (10.166.92.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 8 Sep 2017 08:46:44 +0000 Received: from BL2FFO11FD055.protection.gbl (2a01:111:f400:7c09::190) by BN3PR03CA0111.outlook.office365.com (2603:10b6:400:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Fri, 8 Sep 2017 08:46:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BL2FFO11FD055.mail.protection.outlook.com (10.173.161.183) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Fri, 8 Sep 2017 08:46:43 +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 v888jmp0023063; Fri, 8 Sep 2017 01:46:41 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:25 +0530 Message-ID: <1504860327-18451-29-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131493340040969427; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(45074003)(199003)(498600001)(47776003)(189998001)(6666003)(68736007)(85426001)(53936002)(54906002)(77096006)(110136004)(36756003)(6916009)(86362001)(4326008)(8936002)(50226002)(2950100002)(81166006)(81156014)(5003940100001)(2906002)(76176999)(50986999)(8656003)(97736004)(104016004)(33646002)(8676002)(5660300001)(305945005)(2351001)(105606002)(50466002)(48376002)(356003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2264; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD055; 1:8IQ3CTkzWlC7K/SDjSpDWskwXD5VHCQ+jDgxuN/5wGn1pSomrQEpqgQGch2eCqHCfuRDUuTWh8PTF7N93i6wJoeZ5MLQW1/ONsUWeh04Ic0asWfF8lFSjm7uh1MNvKLp MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70c4f42e-aa14-4f00-fa19-08d4f69621ea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2264; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 3:UOxnVSjhkkpfEoy5qpDKVeCbce7QJg7JbX0RkR7VTSUblJpmYKemNhCTr5gJ8/5XuEaf6NAhmyYnyV7XdBAS3EUjZyOqM941J4i8bouYpD/SG0z9vobcsSDO0PfxLhDBYqGH3jzStjpvCzihFvreDbJjeQj2sGopu4IVnU9Y2bkTrxD7YsF/gW/C5mMXJNlOdtsHR7NTKvMwKuUw5d3YFlriHf5Ae5qYgv6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GbUr2k0= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2264; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2264; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2264; 23:jgiAnYlA+SJ0yQPzwml6G09BtLJ9ezwbaLhtyficH?= aYHtyQOjZiR31cw4QdoHL4S2aloHFL+C6CJ0dwbI4XjQBqU6X+vR34LHKT5wE37k1Y/zi3u8HXhdpJ/uns+/rjmp80oEdRBpeXYjvPSvRvcHzKvKEajDu/Bs4Z03SHJBQ+4HK8twDHSbuGtED8PVnwR3QE/AoOVLOo+QM0KlHnkOzCgY7lymnOjcoh7+sVBSDKEpD9N+ZvBkyfse2qZy3hI8lyng+bmm2Gy7T5qKIb6O9O7EuQfB/qEaRN4ICARnsF0gNTjgh5Df4jVWpMvZ3wrR4TAVlDDXhDsbTpnoVzxcIsMZ796dGaByT10yedvMwTx2TwQnPT3lxeSTTPVQzClDxC2fO6xGWZ8r5Gv3hBAyWnTjL2oUfn/r2i8/3m0MENrcCYAdzLn2OwZF8IGU4Gywc/tOK4NY8Wek20SDkjNKwOOQJTrWmjnhB9JGnfc3bn3vQda+OZZ0nUAvrtSH84xLSVE+j/ZjkcCBk/B0B3boKLvuCWOUWS2Tx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QnBQLh1KMXT7uP11VczfdnvoA+zCLRP1UG3+b2CGSgozlg/VxaUJjFg==; 24:NlhmUZ74FX/BGNv4EyS08cBvcna9rtcbCr3wEnztM/CGR3H27nprfc1GQlrudbUg4DE44iUzo31wH48HiFnfmrhNybWAgC0SWJGpYmfML7A=; 7:SvKk9c5Py1q9shBbdzOFih0MuohMpj7cP/S2+ajBW04dkYBsNcOvsJf8hllaa1WEgE3qS/pT8a1DZjEY+gV+66bxc+oUi160/l880H+o34dJIvuPKorOkpgvvSiJpHYrck/eKs0nJh+k8zjhdl3QPC/WU5uJznNe+V9DwxOm1ddvyfEj6UDfolDyVN5oUn9D6xkIhPrFWgUQdrayS1w7WjHYLFGtP7BjZT5EfG0qlKk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:43.9097 (UTC) 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: CO2PR03MB2264 Subject: [dpdk-dev] [PATCH v2 28/30] net/dpaa2: checksum support as per user config 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" Instead of enabling the RX checksum by default, make it enable only with user ethernet configuration Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 65 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 30 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 589ae6b..4e833db 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -334,8 +334,10 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) static int dpaa2_eth_dev_configure(struct rte_eth_dev *dev) { - struct rte_eth_dev_data *data = dev->data; - struct rte_eth_conf *eth_conf = &data->dev_conf; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = priv->hw; + struct rte_eth_conf *eth_conf = &dev->data->dev_conf; + int rx_ip_csum_offload = false; int ret; PMD_INIT_FUNC_TRACE(); @@ -364,6 +366,37 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) } } + if (eth_conf->rxmode.hw_ip_checksum) + rx_ip_csum_offload = true; + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_RX_L3_CSUM, rx_ip_csum_offload); + if (ret) { + PMD_INIT_LOG(ERR, "Error to set RX l3 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_RX_L4_CSUM, rx_ip_csum_offload); + if (ret) { + PMD_INIT_LOG(ERR, "Error to get RX l4 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_TX_L3_CSUM, true); + if (ret) { + PMD_INIT_LOG(ERR, "Error to set TX l3 csum:Error = %d\n", ret); + return ret; + } + + ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, + DPNI_OFF_TX_L4_CSUM, true); + if (ret) { + PMD_INIT_LOG(ERR, "Error to get TX l4 csum:Error = %d\n", ret); + return ret; + } + /* update the current status */ dpaa2_dev_link_update(dev, 0); @@ -707,34 +740,6 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_RX_L3_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to set RX l3 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_RX_L4_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to get RX l4 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_TX_L3_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to set TX l3 csum:Error = %d\n", ret); - return ret; - } - - ret = dpni_set_offload(dpni, CMD_PRI_LOW, priv->token, - DPNI_OFF_TX_L4_CSUM, true); - if (ret) { - PMD_INIT_LOG(ERR, "Error to get TX l4 csum:Error = %d\n", ret); - return ret; - } - /*checksum errors, send them to normal path and set it in annotation */ err_cfg.errors = DPNI_ERROR_L3CE | DPNI_ERROR_L4CE;