From patchwork Sat Sep 16 10:52:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112806 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1617997qgf; Sat, 16 Sep 2017 03:58:48 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB0dav7ALMD2PGLjrb/7zHLT2pheReYcS3YTIwN96F5fdtucR8r3N+S0osUqObmHJ+Avh3R X-Received: by 10.28.223.87 with SMTP id w84mr5301206wmg.148.1505559528539; Sat, 16 Sep 2017 03:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505559528; cv=none; d=google.com; s=arc-20160816; b=cuyPQ9sFeH47AIcVcfthJj3zsEfuHrm6OLHn/NVleTVoBaja58VD2Ba+aT4jsvfScR tpzHBNKukwjd1m0KbTftM0MjSrwToVDQhLW5tueWkwqIZgrrRAlz/c5dFeNHW3Re0h7A 7WFZEFa4RcfrOJYx1d3Uk8CUKtKbyRakS+jy+TQ7uCSpxmP1z3Orlu6rCThJQN1aCZCP kBziB+Rb4QNelbetaX0EEReqnADegM8lBLuLHWf1birKX0aDqswUEWkOfWZ4Qe2rNUeg Gxb9ladPoIM4H9NKTC+WTiH4mBsQFT04PeE8cyfS3KklWiPKsAyi1GyWbkIl1IRhYLo4 fohQ== 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=8vLzfhfy3vCjT4DFw7WdfkjiaTMgCyQQudYuLvaIXBY=; b=ZqQjJQ4fNmU12d7mB/fk333ePGo2RPobkgZpX1EDtUt6KGiSPUExPSRqeLKhHDSeTN tn6sdI6eqSZXpQxQBQeFxJqSOoPdyAi/UgBuRJ2zguVYPC+TyMwdEvOMGYIBNioYFxvy 5TNTXxuRZwXntbCDCv7DWVTGHX1mqufYAi/LXNifdkJF9ixhblG5b4Z/2Uda13AyzQ3b wUzuiAuWreNas/xgAjmC1MrifS6VBsiKlUDKvSXptZnPJMQXk9tPAXiErc5Y/O/1YeS5 8QnGUe7WANrXbJRzoR/brho7RpvrrH+Q8ooN29scAJoTaXZyWlctJlJqUv2G0lvGx9JO Mzow== 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 s50si2491152wrc.520.2017.09.16.03.58.48; Sat, 16 Sep 2017 03:58:48 -0700 (PDT) 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 1A34E1B23C; Sat, 16 Sep 2017 12:54:14 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0086.outbound.protection.outlook.com [104.47.38.86]) by dpdk.org (Postfix) with ESMTP id DF8201B1A9 for ; Sat, 16 Sep 2017 12:53:54 +0200 (CEST) Received: from MWHPR03CA0008.namprd03.prod.outlook.com (10.175.133.146) by CO2PR03MB2360.namprd03.prod.outlook.com (10.166.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Sat, 16 Sep 2017 10:53:53 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::127) by MWHPR03CA0008.outlook.office365.com (2603:10b6:300:117::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 16 Sep 2017 10:53:53 +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 BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Sat, 16 Sep 2017 10:53: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 v8GAr6vB028328; Sat, 16 Sep 2017 03:53:51 -0700 From: Hemant Agrawal To: CC: , Date: Sat, 16 Sep 2017 16:22:38 +0530 Message-ID: <1505559161-29222-25-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> References: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131500328331086033; (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)(376002)(346002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(45074003)(189002)(199003)(81156014)(356003)(8936002)(8656003)(4326008)(6666003)(50466002)(8676002)(68736007)(85426001)(54906002)(498600001)(5660300001)(97736004)(305945005)(76176999)(48376002)(110136004)(81166006)(50986999)(36756003)(105606002)(2351001)(53936002)(104016004)(77096006)(106466001)(5003940100001)(86362001)(47776003)(2950100002)(6916009)(2906002)(33646002)(189998001)(50226002)(316002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2360; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:Krv/9Xq1QfM2QYZkGOPxdvXP0I28pQva3gGtS4kwIeb/e610UVyWsgSKKjy9ZbUsWo73Ewep5zTvm/QRttcdscyPDhKN4lQMHwPj4SAS3E+U5HDJ9ql0qkzWr6DbZQIb MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aebb1eb9-36d4-439c-88d1-08d4fcf1387c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2360; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 3:oh4+lvYkzVC82IfjkWmPIRCopvPVrEx98z9Pc8Sa8GSUzBHjWHK3VsJAwIUYkX268yNKAM/v4bqZOiIvSEjSkpIoQOGfOl/DVm7yvohx3ucI1HbvzHek3wh9Dnlt5QdS6OkQqtIhk8AF3BrwSgM94KyrQ3Nu6DRXKHi+OvgFERg41c3H5iMbPAFJF1c3VP2efrtS9SSK+KnhX8BWNXYUm0fJS2073jq9Jm4jKZKJFxguqpaQvSaRuu/FMboIcnSDtT2fVtpQ8xDRSFs5MF9sAdF+kZE+lW1zeXH8/VuHFWMK4xTkakIcqgkcNYwlmWXAVT3xDY0fo2m4N08cF/qB0ntE9Sy3Sn7JlMtzFHNkONE=; 25:2jYedzW8/PN0FuZqXIOncudTlQD1NRkzeHVuI7W+D61KnqCiI/R4ZwGuk/vcoXIxH9VFX8VhhWJERWOHWnVzrwJJA+KOKyabWKyONBVPvAFcEXJkaA3sSiHIF78Ks122NOYQTsIR8Ju/9okmcSzRqjGyPyeduQRFw0PAdOlWYtMXHbFWgsv3botkGm2z6znRlbj4D5HmkdJmq/nyslAjbD5jYj5HlWM/lCj4BYzsCG88U+Verr8Q9l0ymc/9w6Egem8Uh62HE43VFPQVKW4W45DmvK1mAIijMn8uBjF767mL0nkrZzAO15k8hlhh/nE86Nea2zal+EUffnX+2sUUEA== X-MS-TrafficTypeDiagnostic: CO2PR03MB2360: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 31:o5o8EQwZHCT1NMr9001vyW2ROGXAnfV5u3jlQOKbHbD8TIokZ8RRFaqX1PnJbjok3OpY78tFxjammu55SC5Ne2pzYSZ0qQYdgcqQAzKpZatdhHIW6/fgUs6eUgKZVDhdQKrmyVtZyXzV9dmIu/fPuNm6JL4ywA61GK5BId5Ysa57GXIWDVMbelg/UTRxtYFtYxVICOX3dUkOeCo/IhNBKimBAyjoX84lMPIzp0rwHbI=; 4:h2gMoclTGTpiiYd0yWHXxqqcflLQPgp9o9jYBSrpjSwKvYExqAob0VzG6zO1xPHQgdhvS4QHES7gQRNff8aRaDsIZAAQoRvJwkd2g3WQSPVnVidxhY1citu2y47Qjw+p0jOEmCgV7F58y7J2+7p7MbuiD4arbrE/Yyn4n8E96fY6qyagtlEjEGEeI5NrpqmkvgQKgG3ryCnusL7+XPzKmxCx1IOKZpRYTyn8MkalXApIUvYRgkl0BCooDIBUuBpnIui3iY6T0T0XgwmOQ5C6709Ac1fi+y2zr8H6JYjUcKk= 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)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2360; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2360; X-Forefront-PRVS: 0432A04947 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2360; 23:oXtAzoBVGh670HDlKp20R6T3rjLoQaIaLzG/rqE2K?= DFiWEwEhxiZ8Ih2oUiG9qD07h3KStbDM+Vml3uEEW3MzT1mkTFQPrhMBGTLOqbD5bfXCQ0FalGS9882nCqqq9AQ8kW4F3uegHkcgsAbsE2PE8Kw9OZgHSn7bRllfjfS6ZxEM7mB8fid61IyRRm+p8h9Pw8QR2nW8GWH2iGdtpfIxpcUJ+IvWq3y5cL/vkTA8CmBjJmVMfjtpAcKmtw6xqWlRQk4zuW62O89MaK7DeZGeLO4lrom5iW1tpyINO12bqCRtOAnw15qiehw4I0aMJ6l1VidSbXqNtkzdNAsiyJhMWlP8ijnZGz/e2vSaet+Epi8mUKKXk2Dh0a1pkKN9PxaOehRq+Z1WabzQwYIFXIi2arPA6iNrovlIn0b8fspMmcFiH+73pFG67qCh9ZYmxCwzjLCOsXZZYghDnRzJ2XUaTcj/xBvuLHUVX9P+ysldNEy/70zOfgIAT9ssV5zcOK45Mcd5/pDBhmK43cQ9Wt5lRdzxGjowVnSDMcIKXovQPFMQKnotfXumf8q3j9wNWulVLM9SoMYmac77TPP1Cz6zmQa60wB6cEBCkVD4JqKfrtoo0A8yEE2deh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oiXbZJ7skWiCiF9q/1WszhJMBFwCysIhB3DmMmQu6dHisWRoYxoKlCQA/ebZSb8d2UiEuSHXxR+WF0eQ=; 24:iYjkvTbaXjwDKSM0pXwD1vyUF39Tejwi7DE7pGCgYaw5dVHOSwsI/87AiVZu0RaQ6Ut+6DYN5FWeatqvuPqbhGYg+G1hIcKGOTGjSrfJ3zE=; 7:vuQ/1kaA97Nw93XmcgbIm//DyPtQ5xmo0J9J1MSXdGRp986RaOO81/ekrbuuIY6+PU/bMhYn1ordNj73ca4j9aRITK28bwm9mWHe/BzOue//et0Kd0ZTCMTjs2M/fz7pOcxqqyWIOjeux6SoxMXZcyvSr9wE3U/F6zAa9isw/VYAugvl/c7SjbkUejJkR+Hs+deJDX4jWOPyKLQZTz3rw17AvkYtxu13Q+y6UNPZKKs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2017 10:53:52.9526 (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: CO2PR03MB2360 Subject: [dpdk-dev] [PATCH v3 24/27] 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 611f59b..7756c4e 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;