From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0042.outbound.protection.outlook.com [104.47.41.42]) by dpdk.org (Postfix) with ESMTP id 8CA60F963 for ; Wed, 15 Feb 2017 20:07:14 +0100 (CET) Received: from BN6PR03CA0071.namprd03.prod.outlook.com (10.173.137.33) by CY1PR0301MB0732.namprd03.prod.outlook.com (10.160.159.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 19:07:11 +0000 Received: from BL2FFO11OLC001.protection.gbl (2a01:111:f400:7c09::168) by BN6PR03CA0071.outlook.office365.com (2603:10b6:404:4c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 15 Feb 2017 19:07:10 +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;caviumnetworks.com; dkim=none (message not signed) header.d=none; 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 BL2FFO11OLC001.mail.protection.outlook.com (10.173.161.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 19:07:10 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1FJ5fLx020023; Wed, 15 Feb 2017 12:07:07 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Thu, 16 Feb 2017 06:09:28 +0530 Message-ID: <1487205586-6785-30-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> References: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316592309775045; (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)(7916002)(39450400003)(39400400002)(39410400002)(39860400002)(39850400002)(39380400002)(39840400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(110136004)(38730400002)(626004)(86362001)(97736004)(104016004)(81156014)(8656002)(6666003)(92566002)(77096006)(36756003)(389900002)(47776003)(5660300001)(81166006)(54906002)(85426001)(50466002)(8676002)(33646002)(50226002)(356003)(8936002)(5003940100001)(68736007)(6916009)(305945005)(2906002)(2950100002)(53936002)(106466001)(50986999)(76176999)(105606002)(48376002)(189998001)(2351001)(4326007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0732; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC001; 1:QHsr2+oxOf/nap91loNPHxfFFvD6YbpeQMnslJbDrIZRTFGWyYDyK3LOkMLZG+9FTw7lV5DFSjpxfp2Zc3vq515n99tlJIKyk08tRWCNP7h2ntf84L7kKhcY3F3DdPf2dj/GK6xYRirsX4Fvu+1vjeipTIMjdVL7HMHPZoi9NDTAnBg14E6ZEhocas4DNC0iA/D7xsEHGyDpjP/QkM7SHYxE3l4XYwAFw2x7KTUQjghk7k0c67E1CxuRcvpivKLNit1nQ0SN3jZGUmxM5/FNJ7KC7ORZAMmGuspKzGb0VZ/NgP1GY+MvseqAAXMt5Mb5e6K3P/73of0jnoh6zGcFiAAGAplEeFvyURPTECPFXXkqoCiDk+mt9uGTFc0S5yyEGa9hu+GT+4iLY9JIyNLIEbaUsKeOs1bLNNpQvRxAOHBv7UGar0cT4C+sq3ajBYfM+cV2nKhanxX9lGFngKBagqq7+pMW76dirs/hOwuz1wi5zAVVS6+21UXrC2KQF1gj2N6XeVwCQK7l5+Ex5e+lN3Vrj9Zcv2mJkt+Ie2ysOLZBCE6HkBEYM0ulYVgt2dnDV41PCz16iegWqKhm43G6i8ij4QDji+qtzvalXgyEGCgN0862kQ8e8YGZWR0e8wdbfuM1WhkE5M8tMjOqmnu+zw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f474d7a3-8b68-4a1a-c968-08d455d5d831 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0732; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0732; 3:VRvsr7bIHBmG6K+icTKRREPkDcIDZVPW12fcOHCwYVNUJEZFtaU/mCdEGL+D80/H2kbzNQWhXbyqeYV8v7IFT70tFoS4rtbGRK0pZkWykojqe8qjj2omqMesHUlqZnZFd9Y4W5YBHM6xYu9Q7TS98Mt6DpvL+gs9xsDSaE76VVCiVuuehnhOvOAbTeeavjFt8uMkl4WAYMCHNbRoT866ZDbnF3LJnhwy3fgopU9nE5/OnaAi+AuUrareCWC3a8BA/y1vItjJA4OzzIZVzGZNqihX8xXleKJY7wdcTWo9jlLvdWcsD+u1RGx9k+uGSFbQUBHHjCw7LsyRd0ztGgaB0dD+4/coTunf8Wgxpfj7SlMgTvu3iDF+RaQW1nSPHFv9; 25:ZqSrX4+Y48hGLD0HwNBAsrBPZ86kMD+3XVbrn/tQ0vOKnUlq57zFt8iuj/wCRRq+2uDzuJRtXelJKE3MorbPOGAoVGaR3iJ2upYrOxgvbi/X7PCuJcx8AdEwsPiHhmiCb3NiFYKKcHPFMtif9vWotsi8D3CmXMfEPsFWDUkxcca48eNJjGe4XcM8926w7O5kPd5MybEwDbmQN95vcd6EQN2wPJnR4oFUXP/XEHFLeqephar3mSue5IFbNlopYnfN4VDMA51zyeZGZ3v4Jk1UOFtYffb4qwrit9vfV139s0XUmg74KVMIY3OqDWGsDNFQnDLk1ZSuAM4jPGCjIjuXLA/3rjNt+D0HJ2CMj810J7PDPNzb++4MxyqsUqBSeBVgOVrOOtuoEyavUey4CPA/FMikFDNotlJKUD+EU0eLb83+giibBVPxrb7f6rglo1j+YyT+JERHQTo1MJAMbpM4Lg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0732; 31:hVxns4bMl7VD5IQqZMc5CKeuqkKa3H318S7JZePbPe/+DSskGYFf1CzO4EFTu6k5y3msYS3Y1iUvtQ/BmwZuNh14d0DGcC39xdpcG7f97PY8uUeemH8aqRgJ+70aa7T+3alZOhk0LMDI5PhVuLt89D6vwWvV0iS7jJGphiLJIUoSKjeBybXEx3wULTmdgXDmvNYGWFuCKJV26O+TA3I0PZJf2k+fDSwtdJcTmf9nd5oASaLa4KRcLMbcoYWnVxL5H57GgoanHSg3fkvl6l+PrQ== 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)(13018025)(13024025)(13023025)(8121501046)(5005006)(13017025)(13015025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123559025)(20161123565025)(20161123563025)(20161123556025); SRVR:CY1PR0301MB0732; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0732; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0732; 4:+sA7iduWDI67/RLdkmdze6mp27T9nYD51E9fmtyAioH2ynGByxRNlqiyCaGj4Eg22ZmdhIAQdKLrH9ZHAqA2R4x0as6uO1vgSd9vKzInH5Ca/bDYD+KEriGApIfzgbGm+u2iKCTih2TSMDgPEG/Rh4+N8crU/IKXBcWr9p+Ng5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/ByMM6WskcwvI3FuinasR97oxa3MN4gQzql+AB0FKrliRPqmzwtZb8bIPBlSnT8xI7wg0mhNDT7bBuiTLTmUuJBDhTq6OA+ygdZvUTzPgceT1m+9SGzDvMucw6qzUaU/kgXFAnw2JmfsovSMb5F4uRAejoq80yN47hFIzLH4YOp60ddLLmX2qwWYVqtUCwXZtiNxKvGqf8QnnK348nX5dGSEsOob0rcw7KR+wTzxZ7JzVDDpCIpnrCvbUNRCGJljVp06csj6hyRZiZSJzUN6mdYRmeXSu9YpUmNQXE1/QTHpbUCqcw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 19:07:10.7903 (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: CY1PR0301MB0732 Subject: [dpdk-dev] [PATCHv7 29/47] 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: Wed, 15 Feb 2017 19:07:15 -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 906a4d9..763c574 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