From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0071.outbound.protection.outlook.com [104.47.42.71]) by dpdk.org (Postfix) with ESMTP id E59B058EC for ; Fri, 30 Sep 2016 14:06:44 +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=vzV1eCUImDWuqYCw875UmjLecVfBuuJv/2UQZaoK29E=; b=HGzmtEh24KuRSISTxOfLWeXl9ktkCIRcne4cJdKt3+xnUsGPw7AHcbCehTXyEedwsRVarP6aWSJ1YidHgJpg2IZzIpRd81CllBcfPGRG5r7FzxbvsPrmWIgtbAH8LTHFFcDnyh8Ec67qmc9D23Zh79NdUq6B2ycmbmPXtZFJxyw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 30 Sep 2016 12:06:41 +0000 From: Kamil Rytarowski To: CC: , , , , , , , Kamil Rytarowski Date: Fri, 30 Sep 2016 14:05:41 +0200 Message-ID: <1475237154-25388-3-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR07CA0001.eurprd07.prod.outlook.com (10.163.160.139) To CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) X-MS-Office365-Filtering-Correlation-Id: dd308eaf-1728-4340-dfab-08d3e92a3e40 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 2:6po5cN7DvEwibmcT9DsBmVWr4cC+l0yyMiHA81rY+MIUx5G+D/eTk3Mm7yQ0v5mqIVL72EVWNOQmpDHDkJUZelDl3SHJ7gMjguG6FpKe94DmsJtgckh+Jut4M2R6qFIJb5twUwsfyD0NgDXIKMBG21xhCzue8RCPOXxN/LSUBzWOoi4xcPvbGAyPZ8CJ9RuO; 3:2YSiqZJp4GO2iTmxk2ND3u155aRIih1tCv/Zj8YyTEI9Upvz9nAcKLl8v7Qzxvu7EIGXyp+vm6Rbm4LFyq3AoWSFFRl+7ppl4HzSy3Xckf5BVKHFA3fYuvMkcZlZGsuY; 25:OfCD+taSiDV0onVPxRx3qpLOrenlPdWDteac2/H8iC8bVZcay2yLiP7mUiaJOqTVJVYJWgSo/k9YylMruec3XS+FNtedUssyxM4hDB//lyZmnU6kB9qzsyC6Q8Ao/PkB25SCmdItkPC2/tqSAYg2GeeD+3z4dp3TwSQ7NDspp3OsO4qzgLrTI5/+gxvbE9m4/S1SdtbUaFnYP6Vzm2Ovzf+2MpiUYpKK9KBIa/Vv2hWu5Lc5m9pbbUgKH33+TG4fY5pat58/Fsr6G/nilUgdZ8yif+SAogFg2IImzMCKu0TZm9bBMQyKbmfpoDUYvWbnquOPfzUMlioJAD2465XYcHVNWd9z5OGlNVPC+w6PIa1ItB8IsYa0hzmxg4XD6chXKXWVBOYrhEl6XaLSCvfLSpxu/8exOEFNX6GksJbFC08= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 31:GSxR0lK7CLic6xGefKFeiUlSnoZQxUXtLqMgkRmAvsQ77ZeqOpcBirQQSkuYCGnCiUXBYETILQGMeTz3sXY5JzbooSBa11gxnugu9+CkZIE9G+olf02CUYi7K5vNyUBMwkIJKA9HIOh/PNHiQtcQTL9j+YInQWzCnW5gA61uKSzTuitYtPANzaCijx/ouq/UqHGBxUOo2V0kLIwfqIYOtGZDNq+PU95a31miM1Incq8=; 20:piUPq52UW6G30k1NbP9KWyEg7F8HHaheqnNr9PxBgkI3cC2NKNOPJwE0G0bvTo4ZkG+9g5dB7QI2HbbB0OAitON02PjQJe1SjJZtaiDxVDnKibu+Irs6+7bTiuaR/Vd64A2tUZUq6hoZP7Q89Ri3tSdMEZVVTOXaoD3JmNbSw40TrUq4U9V5Eoab72maNOuOj+2X6BxY4MJ6ernjQts800YWL2wosjYWxpnlCqAxp0UAWsHDD5J3RTstWXKuZeNb7qqt7QI46JJl9BOBS9ibPZ+5nHZBRwRC66ZSW0avqc4KSL9Fwf/8Yo5iYfGQbdfsU5FPAreOqeCy+vefIKUSAxKzvuPFqdB2Ra5EjMhhYvizqia6wqqEFmTjM2GrsCsjWdu+ewCDj8rgcEhQShkGdFMMlFvP3SJbR1yjcQ27fIlIs6uh8HyO2cxFz10Poj0+c/wXhm//3bLk2oh5Z7nhqPWv32v7BeNuHND9/2C+sLcvbMsPlAjNMerpNIl6kVH+cUhKLkR34PLf4trYliAEmoKBEy1mWPTGr2aHnNgTSr9h/xe3FL/Vu7jwKBG8+hqS3EsyagiJeb+hYtqhKQpLKiluUBKAnjoJ8CqPn9aCYg4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY4PR07MB3063; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 4:+xCHYq6Zf7WfPC9mHQ63YA2/CcNwQaqx1VYCdDj3sEVQkb/bTzgIeVeZmtQvlw4zjgRz8l4fPRmH410hJVv0vYX9wcN91efE/SS7OMN3zDiCmw3zvS6uYWx4YN/FjyOCCLRNLBuLDhvHI2yXtljv1d4LzP9nSOugikclXRT+V4LX0HxXuX7zTF24g2cMUShRoz4qOHRPfZIkA8bFbRBUyyP681RSOdonv+odcBAD91nCcVBKAMfDn/2bJ0/wIUqo2f7cme8FgmOiadM9frg4g7sRxGZ122lxmmRhi/1Q02ES9YbT3A228kjvGZpwFrE0a7mz8KTbyddffxAHgVT5TcxrDPeDJkrqRap2ojjRhOuolTILTeJSlc70E20qq4PFFYMZIwNNupaRuqEk5syhBw== X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(92566002)(3846002)(66066001)(189998001)(47776003)(42882006)(36756003)(105586002)(19580395003)(97736004)(6916009)(68736007)(42186005)(19580405001)(50986999)(50226002)(77096005)(76176999)(5003940100001)(6116002)(7736002)(2950100002)(101416001)(586003)(106356001)(7846002)(5660300001)(4001430100002)(305945005)(33646002)(229853001)(110136003)(8676002)(4326007)(81166006)(107886002)(81156014)(50466002)(2906002)(48376002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3063; H:cavium1.semihalf.local; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3063; 23:ttgtxvnlo6av3kWnblK220bJrrHgRBfne8dBmpEau?= =?us-ascii?Q?LpkYefJ1qYFtEjCJgwioDQIN8I8/MeeyMmXHBcQB8tAAxBAhxSbKimYrmtqT?= =?us-ascii?Q?H+QhVO3jjdpSyWONL/vpiDm1buQS4I4jMnLwhLjteZcF/FjOL4OAM/EKaV6C?= =?us-ascii?Q?AOfNPtM9ldMSthkL+JS5OCXwTgdVngYErGrwbReJS3spzl8yYibmCehrS1YP?= =?us-ascii?Q?BiKoJOpUQpMbjViBm2yuOFFbt/4OZujBqA+3R9mPh/4Ldq5fpsj9ZGH8igAk?= =?us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nztTj77AlXt70PHdqbOvwmw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 6:kzUrEDNlCo+wkTJgvqIXy7KjCyH67E7Crx3iYECLaP4m0PR5/tLklNZ+xs/NNwNDdi7EYe5fTaTpzbPlpUoJVVYI3hekyZK+v2oyLyYuqECM+qsxDO2v8dx1txIzFqcxkuCDLLNyXSWHa1pClIOJpTD7JI0lI8L5rTJRt9WyctF9bqckI79OlB3PbOCnOwyBLiRBTDKl8xFhENjfpjTrPCpQ7FWbHgPh6bwYGZ7Hzsu3iyT42DRUtL4eu7xzZBEGy1jWxUYj0xdepLLjPlZYTRgOOk5R2LHPgONI4a4FhVw=; 5:OLMvR85Vu0cTfE69l4QnMx06hbr/Dnwprn15irT4czy9pupa4kluX15BsWudZ+dCzra7hx4RWg/wm2r49M/upkG3cHdKKw00KaS0ztOPMt8/BoMp1FQmUfteFgh3WN/4nlZaWUX5gzE/3KyHzMP8Xw==; 24:NzCv8YxgBI65jWVqyak7LUmPQXDjnRA+CNOkK9kbSp0GoIZXFmJDHmzMycN2xHDrDMzGGYJF8yhndHWJ47K8GFPXNwCBHaFRMei+Hrp0K68=; 7:49ZXHhWVFNEjerX6u+1uMzegKEyj8sDUHmQHQL4URAlX3WrDHI/wD4XUMfgaELtfq92EK8fcvbOcmVzLKxPR1aN/7MJPlcoEhIzvpRNGMp7RsgWSZrahf//O+6pESOCaiByc55n4jUPEqdHATY6OBbXkR3l5Sb1j/EgTQ0swDgVRRD9uuAHz67seOu3KT+9wDOgxp2TZUyfEkgqnw5s1P3EJ2igP6YvkuogqVe7ffytLpeRoQAlngR326QCoE+1W//RIW8MYXBsnIFio8onTwVPPlhA7M/oe9H9iTy6oUoltFk8YE5bpRvEiZ6PqteE2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 12:06:41.4865 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3063 Subject: [dpdk-dev] [PATCH v2 02/15] net/thunderx: correct transmit checksum handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 12:06:45 -0000 From: Kamil Rytarowski The symbols PKT_TX_TCP_CKSUM and PKT_TX_UDP_CKSUM are not bits on a bitmask. Set l3_offset always for TX offloads, not just for PKT_TX_IP_CKSUM being true. Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx") Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki Signed-off-by: Jerin Jacob --- drivers/net/thunderx/nicvf_rxtx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index eb51a72..e15c730 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -70,19 +70,20 @@ fill_sq_desc_header(union sq_entry_t *entry, struct rte_mbuf *pkt) ol_flags = pkt->ol_flags & NICVF_TX_OFFLOAD_MASK; if (unlikely(ol_flags)) { /* L4 cksum */ - if (ol_flags & PKT_TX_TCP_CKSUM) + uint64_t l4_flags = ol_flags & PKT_TX_L4_MASK; + if (l4_flags == PKT_TX_TCP_CKSUM) sqe.hdr.csum_l4 = SEND_L4_CSUM_TCP; - else if (ol_flags & PKT_TX_UDP_CKSUM) + else if (l4_flags == PKT_TX_UDP_CKSUM) sqe.hdr.csum_l4 = SEND_L4_CSUM_UDP; else sqe.hdr.csum_l4 = SEND_L4_CSUM_DISABLE; + + sqe.hdr.l3_offset = pkt->l2_len; sqe.hdr.l4_offset = pkt->l3_len + pkt->l2_len; /* L3 cksum */ - if (ol_flags & PKT_TX_IP_CKSUM) { + if (ol_flags & PKT_TX_IP_CKSUM) sqe.hdr.csum_l3 = 1; - sqe.hdr.l3_offset = pkt->l2_len; - } } entry->buff[0] = sqe.buff[0]; -- 1.9.1