From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B1076CF9E for ; Fri, 17 Mar 2017 14:09:27 +0100 (CET) Received: from BN3PR0301CA0031.namprd03.prod.outlook.com (10.160.180.169) by CY1PR0301MB1962.namprd03.prod.outlook.com (10.164.1.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11; Fri, 17 Mar 2017 13:09:26 +0000 Received: from BL2FFO11FD054.protection.gbl (2a01:111:f400:7c09::151) by BN3PR0301CA0031.outlook.office365.com (2a01:111:e400:4000::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Fri, 17 Mar 2017 13:09:25 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.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 BL2FFO11FD054.mail.protection.outlook.com (10.173.161.182) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.961.10 via Frontend Transport; Fri, 17 Mar 2017 13:09:25 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2HD8peW021077; Fri, 17 Mar 2017 06:09:22 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 17 Mar 2017 18:38:32 +0530 Message-ID: <1489756124-10805-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> References: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131342297657376036; (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)(39450400003)(39850400002)(39400400002)(39860400002)(39840400002)(39410400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(36756003)(2351001)(76176999)(5003940100001)(50986999)(8936002)(33646002)(305945005)(189998001)(47776003)(81156014)(81166006)(8676002)(2950100002)(5660300001)(105606002)(106466001)(6916009)(6666003)(50466002)(8656002)(54906002)(48376002)(356003)(50226002)(77096006)(2906002)(85426001)(110136004)(38730400002)(53936002)(104016004)(4326008)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1962; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD054; 1:3Xv+bwzVpbIaVgakYUv2tin7j6GCCrslDAp8ityzgBnOZxgFZgFWuCJR8GUv+9GsQsLSInauPclZSOoERPQwrhYbP8pVwy4X8SVtVCthQbUVxhyMLyGSWHa9USLUv2F8iTD/mcJnp1t6IQL53c3cyKsB/y1wfwehJhu3CVvCtjfdR6tAu98P1cCavC6Caxuda5RSV3RjbOB1piRHTZDIPSWfDN+d/KjG/AI4z6HIfp554GGOfI2WWXdlRQsDZ5jYqbLYW3x9oW1Tw+W4JY3O4m6atY8gu2eKC+UdzWJ9d9Vgu+E1c0ntR0cBZHQRAmouJdPLlBrSaMVv38TFUSrW0DR4ROd7+aE0VZC8yW8NAdAUmyeuWTWyRJEWlMnIWTV0qFZfVhGd2RyhMTdTJZ1LShF5jp8FJgDMmWOkGq3ty58kOxi0IBYOI/ZdBFOdJn4pkEnNJlb4Rq/xYCORID970JmW7oOw8Tu8AGb3D18k7cHpiMGnGVJ/G1wiFVQglKbCAIoMt70c+rSsqHNWKm2iH57O2+OgueTaciZ1xeDCnpE/ZyU9zBgx9/9Vt+XJQo39/qbJ1mNYpaYa7t4Oc07K4Bf0ytoNrKYK52NmOmuqh5TvzcSBW6X02AspugtJ2ZhwQ2pgH4/cu8S3Teddrr5ZBA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: cb06ab88-a04f-448f-fd24-08d46d36d650 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB1962; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1962; 3:Yx7eOmHRPJ8ZvYN7yoZipZssBfyEvlQdzP6y0Jt5hOgwwxPNEbJ7jj1UM4Ox3VIau+JkaUVtAV7elmzbhM7mVhVMgO4Dxhi9ClZNzXKu1WJWYWGmBqr5ThE05EF9PYtNgM39M3W/ZsRvlkffMULVS10nwQmRd/ExMSPpfspIFnLpHPjnDmDmbmdhq5DvNdL8xRZ7B9IFvPhpoCNsLNIGmWokJD7xxYvMfee/DdYzu1SY1Mwfe+VeiqJ5cKv+2JmEkRbkbTXofcDSmZgRdHF78erQhCOkVExhEUuYdjBXiwFgWkNuO4bgrDD6nuo829VBPFydmV7jAh6Ok8LOc5PwqHwzYtDrtUp9C2GgvQQrSJJKct2Q1/BLa+5+l1F/NgTp; 25:mz+2QhQLKkhdL25yoLsyzl54yYQpMXUVIVkyhqXcs36CsjLs5gCP95BwJYI8HtH3KPb2y8fxQx23lwI3kzoKCkQApA9hxHfwpP2wImVb+IY3cByC4ape1bVc7EFeOOEbV9Z7Ja6vmcS6OUEqNPtALGvMrfjBuGuilAM0b98Lccxw5x17lCg7FkPlEMMA5pFuWCdPV0b++VRikK4bEIzAXjKrLAUofpEiqGWYaK7Gwoqf4iXeeml0gLfxz0aG1dBzKmBoI5kZPyopXwFvntE62VS/N3aRNveHCM0UqHJuDWCKcQcrUnsLEqOgRzj3ARbAu9GqHWMVlZgtTTaC2zViXPBBz9YSL2EyG5TTSOz0fhsH8UDopjtIJ+uMIGOsTc2pXW7+H5LNiY4tYKFyX8sXPm6N5Q9dXow1sHJ2HKEocXRxr8HGsvg9BlcbVTxVdI1oKFcp/SrObkKdhHyZh9UiQA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1962; 31:+B0b06XFX0auFveCr4zEGKFaNdvXlZmI7ujL3zKGz6/dCwc8KuAxkPMkVYUaSLOd335vTADrMkRxW0ngSmw09khlqbrjzGS/6qZXNeEpbidnvwKFv3LDZyZLuIVaz220ycMjM7CE2f5EHsdlgB/WmDjgtt5d/E6VyHteWSiHworGkJkYY9qb9QYpcIwJdPMsbKXhAD2qCkuo8HSmnXALoRUV9MoiyKfqBw0uljGsZITwn/n8GOJfTeK63CKAw1RulAc4bAW/qfZdmrU3bShZcw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13018025)(13024025)(5005006)(8121501046)(13015025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559025)(20161123556025)(20161123563025); SRVR:CY1PR0301MB1962; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB1962; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1962; 4:UmTPFn7eMlWNDYgYqChys3ilj4osesn3ArbcpSLxwmzp352P0KSICB8a5TxY3Y525mF40T4EZ6cD1EtqQAIa/m2SEpQIL/jZUNuSxzYbxEjsjVyFElFNpFfezQgyXtVXx0RVD3gs65Mr8NsyQp8prTCLb4NqiakNyIlZ9ev+Xb6I1fVWEDB00ShFvGcLe5jeQNU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W4P/ZraLoDstxBLfBbic31aFvUKTyP3YDB8eFU5XGKfiE63srOTNTvpyMybfjCWZ9NgNNTLWdJV6Ua5Iv4BcJUK9iw1Mpkue3DZv27r3feI715008ku/yGwmey2ly84CaVO4t8JmirOJbHUXNUT9y9L75cR23g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 13:09:25.5504 (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: CY1PR0301MB1962 Subject: [dpdk-dev] [PATCH v9 10/22] net/dpaa2: add support for L3 and L4 checksum offload 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: , X-List-Received-Date: Fri, 17 Mar 2017 13:09:28 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 72 +++++++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 20152a0..d50c62e 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -6,6 +6,8 @@ [Features] Queue start/stop = Y RSS hash = Y +L3 checksum offload = Y +L4 checksum offload = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 60e984b..f517355 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -68,7 +68,17 @@ dev_info->min_rx_bufsize = DPAA2_MIN_RX_BUF_SIZE; dev_info->max_rx_queues = (uint16_t)priv->nb_rx_queues; dev_info->max_tx_queues = (uint16_t)priv->nb_tx_queues; - + dev_info->rx_offload_capa = + DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM; + dev_info->tx_offload_capa = + DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_UDP_CKSUM | + DEV_TX_OFFLOAD_TCP_CKSUM | + DEV_TX_OFFLOAD_SCTP_CKSUM | + DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | ETH_LINK_SPEED_10G; @@ -252,8 +262,13 @@ memset(&tx_conf_cfg, 0, sizeof(struct dpni_queue)); memset(&tx_flow_cfg, 0, sizeof(struct dpni_queue)); - tc_id = 0; - flow_id = tx_queue_id; + if (priv->num_tc == 1) { + tc_id = 0; + flow_id = tx_queue_id % priv->num_dist_per_tc[tc_id]; + } else { + tc_id = tx_queue_id; + flow_id = 0; + } ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_TX, tc_id, flow_id, options, &tx_flow_cfg); @@ -302,6 +317,7 @@ struct dpaa2_dev_priv *priv = data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; struct dpni_queue cfg; + struct dpni_error_cfg err_cfg; uint16_t qdid; struct dpni_queue_id qid; struct dpaa2_queue *dpaa2_q; @@ -337,6 +353,48 @@ 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; + + err_cfg.error_action = DPNI_ERROR_ACTION_CONTINUE; + err_cfg.set_frame_annotation = true; + + ret = dpni_set_errors_behavior(dpni, CMD_PRI_LOW, + priv->token, &err_cfg); + if (ret) { + PMD_INIT_LOG(ERR, "Error to dpni_set_errors_behavior:" + "code = %d\n", ret); + return ret; + } + return 0; } @@ -453,7 +511,13 @@ */ priv->nb_rx_queues = priv->num_dist_per_tc[DPAA2_DEF_TC]; - priv->nb_tx_queues = attr.num_queues; + if (attr.num_tcs == 1) + priv->nb_tx_queues = attr.num_queues; + else + priv->nb_tx_queues = attr.num_tcs; + + PMD_INIT_LOG(DEBUG, "num_tc %d", priv->num_tc); + PMD_INIT_LOG(DEBUG, "nb_rx_queues %d", priv->nb_rx_queues); priv->hw = dpni_dev; priv->hw_id = hw_id; -- 1.9.1