From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) by dpdk.org (Postfix) with ESMTP id 141902C00 for ; Wed, 7 Jun 2017 09:44:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Pp+hWoLLyehJjsethMijniEBwNRZbrKEsntAaSyPEIM=; b=G4PFDKU+Ha/vaAX/zgO2FHCd2/lYKVuQdu96l2WuMWAU2uAzSNDnkMN/9kvJMo6g93+l2edInsyO02nALOUNsmZJoCZ5XEgQx4i2RoEpG5Rlc3k8/Mx02ktDvAOhNFSYeZWLjIlejLafpMWTAeDs4OoXZc70mNK8cA0iRdBEIv4= Received: from MWHPR07CA0010.namprd07.prod.outlook.com (2603:10b6:300:dc::20) by DM2PR0701MB1019.namprd07.prod.outlook.com (2a01:111:e400:246f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Wed, 7 Jun 2017 07:44:07 +0000 Received: from BN1AFFO11FD035.protection.gbl (2a01:111:f400:7c10::124) by MWHPR07CA0010.outlook.office365.com (2603:10b6:300:dc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12 via Frontend Transport; Wed, 7 Jun 2017 07:44:06 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1101.12 via Frontend Transport; Wed, 7 Jun 2017 07:44:05 +0000 Received: from avsmtprelay01.qlc.com (10.1.112.194) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Wed, 7 Jun 2017 00:44:04 -0700 Received: from avluser05.qlc.com (avluser05.qlc.com [10.1.113.115]) by avsmtprelay01.qlc.com (Postfix) with ESMTP id 39B088BF7379E; Wed, 7 Jun 2017 00:44:04 -0700 (PDT) Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id v577i4qr007002; Wed, 7 Jun 2017 00:44:04 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@cavium.com using -f From: Rasesh Mody To: , CC: Harish Patil , Date: Wed, 7 Jun 2017 00:43:49 -0700 Message-ID: <1496821429-6954-2-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> References: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39450400003)(39410400002)(39400400002)(39850400002)(2980300002)(428002)(189002)(199003)(9170700003)(4326008)(42186005)(575784001)(54906002)(86362001)(36756003)(356003)(101416001)(38730400002)(76176999)(50986999)(107886003)(5003940100001)(2950100002)(305945005)(6666003)(5660300001)(8936002)(48376002)(50466002)(478600001)(47776003)(8676002)(189998001)(105586002)(33646002)(2906002)(72206003)(81166006)(106466001)(87636003)(230783001)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0701MB1019; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD035; 1:Y1xzi6mbiHnxQi4XClf7+qx5UTKeHooi4jExjnB+KivCL2vYTvax92aAGxQrABLX1C+k5OCtwbcpjJYVeIOWDD67Bg0JgPkM0W2U6E6jq8Bkry+Yvi3wxZccyAAokdtGrp3K4TT1bi/PEYTwrUSD5ai5RF+mx2q3tB+a7eSLQAwuttYnpoE99EZ3Z9+0qcjjRHXuP1+eqp2+cS4duvF4zmsH4l2SRwmcPj3wFCRPRoMEpfeQDJ2V1N9sR82aYoYNA6tjkY61GGF4MObvZhBBS8VPIr00YUiHThSA39ft+Mf2se33fqYagm6rnrBvYC+dS8KHvcS7BPaHGD1jCiQ2sUjbP9+FiH6V7V+mtdeJeZU1Xp8EfGBZM8/tYQufeyGXdHmAeXXffA4EwWVTZXyLaaZz6X5+V1Q61GJ3SDRlOtaw1LIeJq0Jc0XZjaron3JQUUpu1gU1fGXNFB3eVhNXkD68kxmM8CjhhQxNeuDVlWRGOFKrICIHIuYbU/PGPfF36kWJfPPEhJZUD68zPMbyOA== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0701MB1019: X-MS-Office365-Filtering-Correlation-Id: a4aed70a-705d-4335-9788-08d4ad78f9ab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0701MB1019; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1019; 3:Yz/gtmHD5LuMkWUPePwH2wGKtvuZfJ6Nmf8e6PTfDPl34iWawkH0MXZHPjXjldOQwd2GxL0jdA7FdCBuC++HnynQXXvqyf8Gl7ez6mvMin8/Vcoe8icmflBJCG5kxYnmPnRNNVANpqpUt6wSwWAvjYIysDdwqVU9pnqm6QJGGPk+molfXejP7E4dFun9rUXzOMR8oeGeu4bVYVFtwWK5WcMlz45nFejZUPmB2jc9samui+TDBZA2RPd2XNNblzKyVWmx3wKUs3PP4m5A5BwqK7JtGrIVToCok/Kxh4Ci77ntTztkgN41CsM4mjUEidtziAGS9qRQd+a8v+rjcfZH96EPtT29j20Uzqzik5iENFn+NATRlniaWkj5dIa5XCMWwAKx7F38XLS9ZSh7+tyyWwwcNVISjtfvrakQiXmF+ACzAVhSo5TewSBQQGGLZyp1/2Em9pf5/r/w68itciSZsw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1019; 25:PsrYLQFkN4SGRBxC8FdW5FwnGEcUiE9IIfVK255z1fkCzNWuZ6TW/KVB2x4aPaBhvifw661Jo9o6bJ/CYchwa+lvo1a7jGfZ2F/dOOwhxD7Il+tOTZ+ivqP3YbW6b1DajJklE36B1QiKxBNZNXSlzF4cCj/rGVSKq6bo6cQ2TneW+0x7zfDMM5zqV4otbkny3axbttB8+yekO1BpburHe26tzyRQglyC8inxyd3PlrwgBmfM0wNxXh6YKYtjSn9tL7BM1pIADwy1nUIp8a1jOnarzXQRdcNDgeIKTop10C5VC24s0xXmGpfo5fbwTiix2anwL0cXS70iPo4lFE/kFUNZTQvH5lf/hMWkeJXiFmLw5JPRCvk2QNf6or0L/QoxttR6ASqxaEgRVAkNNPuhVWiDV0VBIGpVQtw88+YzgH+4gRqjdZrzEbliow1Ll3q/4r+wWr2f0GOBStLsGMVNsAel04PPpy3Cw+gBzjRoVOs=; 31:4OuZqBkm3+8Cqu5zhO553xz+6ryb6pM6OdlsU/5bJtyxvyOuepse6gZtqJUqULAeLiEfYwU+plcLTDp2GAThQRWSBqP+aCM2RpxgJS4tvVARkmL8Deqg3q99AdU4E6FPnLjytt1AGBX23KMXCT31ufWEooVMPbFse2ufrY8ZWNHaBph7BMzS9UiwIIA/lsVwnA97WnvQzjhae3qbYX3Llmmc94NFziva/FO5htZNlEGtuWxh5PjrDhaAbKL46hA2 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1019; 20:ov7XF/xXn752/hXe/g+xyXg0cAbi7hPC6VxlFwQT60fKqqWRd52lOXG7SM04QhCRvaMi3gYe42IqBsxPAU0zElbdsX2mZ3Wv58ri5w9b5QLrDBBFzqdLqJFEJtHuw9nd9IsucrcSC1VcgpO5BiTXnKtB+FdiaphALczKIX/YW2VCS5/NxZpEwuYoMg2UM3R+t63BhVvs727XyzQ+P9wLRvoVRVaEFF+tnMjN37UCUinqZLmab7NA8BCZPAodI57XvsMWFFAaLWIgU5ccN+OokIcB1GN9ebZJCJb8JpBw8gAOTcY8X9dMr4ariAS8mp2r8beljCCenYgaLfvf5PHAAZZnC1aIVFr+pm5NevbdjL4vEkv0Gua0GxuoiLSBXGYRuWaQJgQeXbNrqYoFtoYOaZwkzjkkJDhVWmLpGEgMK1p2nPEJKrFEYwx52wW20p3hy0pfepqrCHkGbO1HXKD4KOR3rgxJ0SfWzFB6MbH/K8or9h957ExJAVX96KfaTrOq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0701MB1019; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0701MB1019; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0701MB1019; 4:/1F2bkjNufBLLL9tUhSF6A91cJ1jJVo4aIDftMZh?= =?us-ascii?Q?uAIUL50vTlqMksxEuL1ZiQS9rkucneIX4wiobjL7XqBu78vEcWf4TEVOXHuL?= =?us-ascii?Q?jKLrfIV6pvP8D6E6imAhkqqTqs9ep6REVg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q?Y7RxQGUh4p++y8//jhL505PDF5OHbSqkX9XdbkMPasxFTNHS54qvXWH2GVx2?= =?us-ascii?Q?BlJeZA+y5vkVY/1syJc+De+20bZI7B+AqhsuNXjstuFdq2koKP6AsrkgUruo?= =?us-ascii?Q?r2yPPVDr/slmtvCIdawqDZPYffRyz+ES2g9iiA9848+7eVTBBueOpuAYa0DI?= =?us-ascii?Q?SXAwGMcDxFYzuDFgV0rqowSyZQZDYJD1BqCoRwA8/qDt1DnqIfOeHRxVsw?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 03319F6FEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0701MB1019; 23:gOFJTqvwys31OVdAIgeT+r2P3hlqVLqiGmSlUCV?= =?us-ascii?Q?tAdH7jYtdJycWnUUMsi65qTY7sZWGr7KT4qC8OpkoXCcxDIF5sudXN2ghGDP?= =?us-ascii?Q?NJDVGcr9tNRWHGdDjQk0yphE9OJ18iMc758O4uVbDKUX2CcD7gdyWQE9v2He?= =?us-ascii?Q?ZxqqxBBCBFvaCC1S3xqO0Tx+K66dWHlArN2wJdxo9lWNS44pKbqaxdHj1EVM?= =?us-ascii?Q?QqeOUrgxLHgbJ3LilKhNH7Kg279fsFavqCqHhug+GmfZlkwXgJKZQxhVrgD5?= =?us-ascii?Q?ypnbnq8O+58/j6KEBdwkeQ0HXC3vHgk7GXse25pslkl6MVriMviL4J21OI/z?= =?us-ascii?Q?xzEzm/OVkWFzcLBqBp4+8Hx9R8HffdlItIcWMGLTRP8xq6ZCz6HRjBvxGIa+?= =?us-ascii?Q?tjEVRek3x7UvYthSTVIsAyC1l4ysiY2Ne3MqlD8wygpqps02b3CAKcPmJgXy?= =?us-ascii?Q?kkirRTDHr5cpbNFK3T5Uoa+EzA5rxDJo+ydpM/P34fuTh1A7xE3BF9WEwYNJ?= =?us-ascii?Q?VM5kKsLV6QZkNj0UVfX0FOu7FWp0ZXLa4/XQtuVJ0ReW4Rg7HQU7n0iqYT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0r5wVE7/pPn9hzo743qU7/e7P1y+Os/XkaCrX0DnGeRArFvvXWjMX2JwefAT0AzWG/iLd6p+Oyxx1Q7SJZUViXD4Gjyek+B7tMbjC5lhIgb/C9IUuwKuNdVFbw0RA8tKZat4A3sZggYknzwOOKUY9XrBYYFOssJMkF+moi76wLtt7W2pFWrObAVbVspv6RnvUKSGgUQ== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1019; 5:1l8ro1Zu/KtLjHMb64ryJcm/drRRn3eN202gIfu6yGzqQwnJrBsta3f5VS115mq4+W1rXaoEv7IzHby2X/A6+4U0YaFWPr1BXsi0U2/vXEYwpB8YP3ONIDCJvRygMNFEdgATGvfNpPEJ0e4TWhJaAaWbKDTW7Sm7VJjTN8VntQrFpBn8haRmkKFPPieT+ENPflRQQQiKTV8vH1cXBy0wHKOLAvU4PYcemJO1CaRNW44U6hq3kFmjlRpLDqTROIy7Pbr6EZy+92HoG/GrBt5RjRgWnthv9QneTgF/1y+v8PeHcuKxPnx1ygOIoAPO2ytU6PTzH4I7f5SACWc8axM4YDHlBj5LNEBz4rj/n/iETBE87Tr2Bz4kUQwofPJ+zeBxyeqzKCggqombe1LyAtbG3uns+nb3U9BizeCcQWAithpj/pmfR7/mLw+JNkTVQ50vYeqQs5iUIJ6lvXbh+U179mONwp869SOppi8FCa8Rr0ptQeZOFrulhIFDi5IwlBFQ; 24:BDCx5tKsCBxuEtGlD4t7+afgDNu/iyw223e9bOG1addV3yiaqu7OchAezNrHGwpye1tNK1e+fM0+IQukUeB/Lkjx2xUV8m13FDTZb8UIQcc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0701MB1019; 7:58CXMsXemUlifZN3sropG381q2HvlGiZKGDfncjlg6zRa37HJMjrpOA22CWPgXjYREyCoExoFjrucvbiX2BTNOI/uvSMGBHbaErHn9rVRYVB3azVu1qtBUhddwObruigccdTowzjTYdrl7hcmtmr7XFeQeCknzkgRDwTPtubeZAvRYwSD2Hh4YHExsxSstd6xHCdbx5yaDGdd11scu+IpVxN44KKOBD39BOngIl2IvRW7tmumWRHdmlVVPb8UPmAjW3UxIb9rg0SGEtkIDLYXZP62W6X+aXsQaubmG8M9w+oBxPqpb4/2kzzfeJTCBZgTEfk3JNcS21W8dYbzrKatw== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2017 07:44:05.9103 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1019 Subject: [dpdk-dev] [PATCH v2 2/2] net/qede: add Tx offloads for MPLS-in-UDP packets 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, 07 Jun 2017 07:44:10 -0000 From: Harish Patil Add support for inner/outer L3/L4 TX csum offload for MPLS-in-UDP packets. The driver checks for PKT_TX_TUNNEL_MPLSINUDP in Tx ol_flags and updates TX BD elements with appropriate offsets/length of tunnel headers. The pseudo csum calculation is removed from qede_xmit_prep_pkts() since its not needed. Note: Some lines are exceeding 80 columns and is intentionally not fixed since it affects code readability. Signed-off-by: Harish Patil --- drivers/net/qede/qede_rxtx.c | 194 +++++++++++++++++++++++++++++++----------- drivers/net/qede/qede_rxtx.h | 3 +- 2 files changed, 147 insertions(+), 50 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 1633b91..99f5e50 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1445,7 +1445,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) uint64_t ol_flags; struct rte_mbuf *m; uint16_t i; - int ret; for (i = 0; i < nb_pkts; i++) { m = tx_pkts[i]; @@ -1478,14 +1477,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) break; } #endif - /* TBD: pseudo csum calcuation required iff - * ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE not set? - */ - ret = rte_net_intel_cksum_prepare(m); - if (ret != 0) { - rte_errno = ret; - break; - } } #ifdef RTE_LIBRTE_QEDE_DEBUG_TX @@ -1496,6 +1487,27 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) return i; } +#define MPLSINUDP_HDR_SIZE (12) + +#ifdef RTE_LIBRTE_QEDE_DEBUG_TX +static inline void +qede_mpls_tunn_tx_sanity_check(struct rte_mbuf *mbuf, + struct qede_tx_queue *txq) +{ + if (((mbuf->outer_l2_len + mbuf->outer_l3_len) / 2) > 0xff) + PMD_TX_LOG(ERR, txq, "tunn_l4_hdr_start_offset overflow\n"); + if (((mbuf->outer_l2_len + mbuf->outer_l3_len + + MPLSINUDP_HDR_SIZE) / 2) > 0xff) + PMD_TX_LOG(ERR, txq, "tunn_hdr_size overflow\n"); + if (((mbuf->l2_len - MPLSINUDP_HDR_SIZE) / 2) > + ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_MASK) + PMD_TX_LOG(ERR, txq, "inner_l2_hdr_size overflow\n"); + if (((mbuf->l2_len - MPLSINUDP_HDR_SIZE + mbuf->l3_len) / 2) > + ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK) + PMD_TX_LOG(ERR, txq, "inner_l2_hdr_size overflow\n"); +} +#endif + uint16_t qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { @@ -1510,9 +1522,10 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) uint16_t nb_frags; uint16_t nb_pkt_sent = 0; uint8_t nbds; - bool ipv6_ext_flg; bool lso_flg; + bool mplsoudp_flg; __rte_unused bool tunn_flg; + bool tunn_ipv6_ext_flg; struct eth_tx_1st_bd *bd1; struct eth_tx_2nd_bd *bd2; struct eth_tx_3rd_bd *bd3; @@ -1529,6 +1542,10 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) uint16_t mss; uint16_t bd3_bf; + uint8_t tunn_l4_hdr_start_offset; + uint8_t tunn_hdr_size; + uint8_t inner_l2_hdr_size; + uint16_t inner_l4_hdr_offset; if (unlikely(txq->nb_tx_avail < txq->tx_free_thresh)) { PMD_TX_LOG(DEBUG, txq, "send=%u avail=%u free_thresh=%u", @@ -1540,7 +1557,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) bd_prod = rte_cpu_to_le_16(ecore_chain_get_prod_idx(&txq->tx_pbl)); while (nb_tx_pkts--) { /* Init flags/values */ - ipv6_ext_flg = false; tunn_flg = false; lso_flg = false; nbds = 0; @@ -1555,6 +1571,10 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) bd2_bf2 = 0; mss = 0; bd3_bf = 0; + mplsoudp_flg = false; + tunn_ipv6_ext_flg = false; + tunn_hdr_size = 0; + tunn_l4_hdr_start_offset = 0; mbuf = *tx_pkts++; assert(mbuf); @@ -1566,20 +1586,16 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) tx_ol_flags = mbuf->ol_flags; bd1_bd_flags_bf |= 1 << ETH_TX_1ST_BD_FLAGS_START_BD_SHIFT; -#define RTE_ETH_IS_IPV6_HDR_EXT(ptype) ((ptype) & RTE_PTYPE_L3_IPV6_EXT) - if (RTE_ETH_IS_IPV6_HDR_EXT(mbuf->packet_type)) { - ipv6_ext_flg = true; + /* TX prepare would have already checked supported tunnel Tx + * offloads. Don't rely on pkt_type marked by Rx, instead use + * tx_ol_flags to decide. + */ + if (tx_ol_flags & PKT_TX_TUNNEL_VXLAN || + tx_ol_flags & PKT_TX_TUNNEL_MPLSINUDP) { + /* Check against max which is Tunnel IPv6 + ext */ if (unlikely(txq->nb_tx_avail < - ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT)) - break; - } - - if (RTE_ETH_IS_TUNNEL_PKT(mbuf->packet_type)) { - if (ipv6_ext_flg) { - if (unlikely(txq->nb_tx_avail < - ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT)) + ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT)) break; - } tunn_flg = true; /* First indicate its a tunnel pkt */ bd1_bf |= ETH_TX_DATA_1ST_BD_TUNN_FLAG_MASK << @@ -1592,17 +1608,88 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) bd1_bf ^= 1 << ETH_TX_DATA_1ST_BD_TUNN_FLAG_SHIFT; } + /* Outer IP checksum offload */ - if (tx_ol_flags & PKT_TX_OUTER_IP_CKSUM) { + if (tx_ol_flags & (PKT_TX_OUTER_IP_CKSUM | + PKT_TX_OUTER_IPV4)) { bd1_bd_flags_bf |= ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_MASK << ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT; } - /* Outer UDP checksum offload */ - bd1_bd_flags_bf |= - ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK << - ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_SHIFT; - } + + /** + * Currently, only inner checksum offload in MPLS-in-UDP + * tunnel with one MPLS label is supported. Both outer + * and inner layers lengths need to be provided in + * mbuf. + */ + if (tx_ol_flags & PKT_TX_TUNNEL_MPLSINUDP) { + mplsoudp_flg = true; +#ifdef RTE_LIBRTE_QEDE_DEBUG_TX + qede_mpls_tunn_tx_sanity_check(mbuf, txq); +#endif + /* Outer L4 offset in two byte words */ + tunn_l4_hdr_start_offset = + (mbuf->outer_l2_len + mbuf->outer_l3_len) / 2; + /* Tunnel header size in two byte words */ + tunn_hdr_size = (mbuf->outer_l2_len + + mbuf->outer_l3_len + + MPLSINUDP_HDR_SIZE) / 2; + /* Inner L2 header size in two byte words */ + inner_l2_hdr_size = (mbuf->l2_len - + MPLSINUDP_HDR_SIZE) / 2; + /* Inner L4 header offset from the beggining + * of inner packet in two byte words + */ + inner_l4_hdr_offset = (mbuf->l2_len - + MPLSINUDP_HDR_SIZE + mbuf->l3_len) / 2; + + /* TODO: There's no DPDK flag to request outer + * L4 checksum offload, so we don't do it. + * bd1_bd_flags_bf |= + * ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_MASK << + * ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_SHIFT; + */ + /* Inner L2 size and address type */ + bd2_bf1 |= (inner_l2_hdr_size & + ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_MASK) << + ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT; + bd2_bf1 |= (UNICAST_ADDRESS & + ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK) << + ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT; + /* Treated as IPv6+Ext */ + bd2_bf1 |= + 1 << ETH_TX_DATA_2ND_BD_TUNN_IPV6_EXT_SHIFT; + + /* Mark inner IPv6 if present */ + if (tx_ol_flags & PKT_TX_IPV6) + bd2_bf1 |= + 1 << ETH_TX_DATA_2ND_BD_TUNN_INNER_IPV6_SHIFT; + + /* Inner L4 offsets */ + if ((tx_ol_flags & (PKT_TX_IPV4 | PKT_TX_IPV6)) && + (tx_ol_flags & (PKT_TX_UDP_CKSUM | + PKT_TX_TCP_CKSUM))) { + /* Determines if BD3 is needed */ + tunn_ipv6_ext_flg = true; + if ((tx_ol_flags & PKT_TX_L4_MASK) == + PKT_TX_UDP_CKSUM) { + bd2_bf1 |= + 1 << ETH_TX_DATA_2ND_BD_L4_UDP_SHIFT; + } + + /* TODO other pseudo checksum modes are + * not supported + */ + bd2_bf1 |= + ETH_L4_PSEUDO_CSUM_CORRECT_LENGTH << + ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT; + bd2_bf2 |= (inner_l4_hdr_offset & + ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_MASK) << + ETH_TX_DATA_2ND_BD_L4_HDR_START_OFFSET_W_SHIFT; + } + } /* End MPLSoUDP */ + } /* End Tunnel handling */ if (tx_ol_flags & PKT_TX_TCP_SEG) { lso_flg = true; @@ -1646,14 +1733,10 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) 1 << ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT; /* L4 checksum offload (tcp or udp) */ - if (tx_ol_flags & (PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM)) + if ((mbuf->ol_flags & (PKT_TX_IPV4 | PKT_TX_IPV6)) && + (mbuf->ol_flags & (PKT_TX_UDP_CKSUM | PKT_TX_TCP_CKSUM))) { bd1_bd_flags_bf |= 1 << ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT; - - if (ipv6_ext_flg) { - /* TBD: check pseudo csum iff tx_prepare not called? */ - bd2_bf1 |= ETH_L4_PSEUDO_CSUM_ZERO_LENGTH << - ETH_TX_DATA_2ND_BD_L4_PSEUDO_CSUM_MODE_SHIFT; } /* Fill the entry in the SW ring and the BDs in the FW ring */ @@ -1667,12 +1750,12 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) /* Map MBUF linear data for DMA and set in the BD1 */ QEDE_BD_SET_ADDR_LEN(bd1, rte_mbuf_data_dma_addr(mbuf), - mbuf->data_len); - bd1->data.bitfields = bd1_bf; + mbuf->data_len); + bd1->data.bitfields = rte_cpu_to_le_16(bd1_bf); bd1->data.bd_flags.bitfields = bd1_bd_flags_bf; bd1->data.vlan = vlan; - if (lso_flg || ipv6_ext_flg) { + if (lso_flg || mplsoudp_flg) { bd2 = (struct eth_tx_2nd_bd *)ecore_chain_produce (&txq->tx_pbl); memset(bd2, 0, sizeof(struct eth_tx_2nd_bd)); @@ -1685,16 +1768,30 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) QEDE_BD_SET_ADDR_LEN(bd2, (hdr_size + rte_mbuf_data_dma_addr(mbuf)), mbuf->data_len - hdr_size); - bd2->data.bitfields1 = bd2_bf1; - bd2->data.bitfields2 = bd2_bf2; - + bd2->data.bitfields1 = rte_cpu_to_le_16(bd2_bf1); + if (mplsoudp_flg) { + bd2->data.bitfields2 = + rte_cpu_to_le_16(bd2_bf2); + /* Outer L3 size */ + bd2->data.tunn_ip_size = + rte_cpu_to_le_16(mbuf->outer_l3_len); + } /* BD3 */ - bd3 = (struct eth_tx_3rd_bd *)ecore_chain_produce - (&txq->tx_pbl); - memset(bd3, 0, sizeof(struct eth_tx_3rd_bd)); - nbds++; - bd3->data.bitfields = bd3_bf; - bd3->data.lso_mss = mss; + if (lso_flg || (mplsoudp_flg && tunn_ipv6_ext_flg)) { + bd3 = (struct eth_tx_3rd_bd *) + ecore_chain_produce(&txq->tx_pbl); + memset(bd3, 0, sizeof(struct eth_tx_3rd_bd)); + nbds++; + bd3->data.bitfields = rte_cpu_to_le_16(bd3_bf); + if (lso_flg) + bd3->data.lso_mss = mss; + if (mplsoudp_flg) { + bd3->data.tunn_l4_hdr_start_offset_w = + tunn_l4_hdr_start_offset; + bd3->data.tunn_hdr_size_w = + tunn_hdr_size; + } + } } /* Handle fragmented MBUF */ @@ -1709,8 +1806,7 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags) rte_cpu_to_le_16(ecore_chain_get_prod_idx(&txq->tx_pbl)); #ifdef RTE_LIBRTE_QEDE_DEBUG_TX print_tx_bd_info(txq, bd1, bd2, bd3, tx_ol_flags); - PMD_TX_LOG(INFO, txq, "lso=%d tunn=%d ipv6_ext=%d\n", - lso_flg, tunn_flg, ipv6_ext_flg); + PMD_TX_LOG(INFO, txq, "lso=%d tunn=%d", lso_flg, tunn_flg); #endif nb_pkt_sent++; txq->xmit_pkts++; diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h index 3f38d0f..b551fd6 100644 --- a/drivers/net/qede/qede_rxtx.h +++ b/drivers/net/qede/qede_rxtx.h @@ -135,7 +135,8 @@ #define QEDE_TX_OFFLOAD_MASK (QEDE_TX_CSUM_OFFLOAD_MASK | \ PKT_TX_QINQ_PKT | \ PKT_TX_VLAN_PKT | \ - PKT_TX_TUNNEL_VXLAN) + PKT_TX_TUNNEL_VXLAN | \ + PKT_TX_TUNNEL_MPLSINUDP) #define QEDE_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ QEDE_TX_OFFLOAD_MASK) -- 1.7.10.3