From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0048.outbound.protection.outlook.com [104.47.40.48]) by dpdk.org (Postfix) with ESMTP id 107F75A48 for ; Fri, 26 Aug 2016 18:54:58 +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=RiG6LdqUosQiCUwNf59TkMTslH148IAh/Va9DF8WrFwL5ZHUXucgxrHewtjGHrZTHxv/ONqNAh9ORtJVSyAt4EuRmU6FtsLyiJ0kZF/ozQsZk5sbLxpWn+78cEn4clriBWXsAAIqBDvWedyKlGcXgqlI+/2/HYUtAqcTi2yRA/U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Fri, 26 Aug 2016 16:54:54 +0000 From: Kamil Rytarowski To: CC: , , , , , Kamil Rytarowski Date: Fri, 26 Aug 2016 18:53:57 +0200 Message-ID: <1472230448-17490-3-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: HE1PR0201CA0008.eurprd02.prod.outlook.com (10.165.229.18) To CY4PR07MB3064.namprd07.prod.outlook.com (10.172.116.145) X-MS-Office365-Filtering-Correlation-Id: 54e430b7-6f20-4b08-92de-08d3cdd1b518 X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 2:m7s04vqj+9zw5k4iqQFGrtN0xZJpPfo68WEoMfgcZ4puQkKmlyxm42VAw0KCenxJfA/UpdFwED00ZomGSBU06RUssK/Br+jLqQ1fPYX2EF809UdWyOz35WsGTrkZXLq1/8NToOEVqMFwoDEFtvbFpe07psloJMDxoqyTvMf3f/gKJqU5Ir4QhATberruQZ6D; 3:rMuIte27To64uTzNILOvThtr1n3wOqeJLOJ6c+Ze1F+/RB2vDW3Dc4Gd10WqVuXLgiWm7/EZyvEcfrdjVDZ/TdnrnGiMS7ru/4C4AmG0NMb3t7Nw08VP7kPW8J8E7Cj+; 25:GdfbprDrDQ5Qn5ln7P9RWSj2vdjEaOOIj3zo+uITrntWixGWxXKkyb8IuJJQlUICfLqZlhsCGmunNv/mGwtrYZl+oIVkQ1bryWvcNqhG0TOSh4if3thbkFvyH408zsZLCJL+lRHn7kA0MbZQ22/I9+Afc4MWUMIfcR38ahp+jE12pRN+ZsxA9fMkMg5574ltplurDf5O0F/w8LF+iJtFVCecbDQpOePDnW6VGO6Gb81i1NtF4cNp6Cx1R/pULtqcUhQLr6IouTfJG6q+aaNPZ2sOjZfEhBSAF1Ks5IPSFnLj9iDXXN3q/0YQp6uvO0tOipucPR5JvnTy8tWkaDl366WqXV4OrqTdzYYvZf2EBNcXTuA/tgd/O5+guYt7CotfI7B0mKHSZPAlypOkKwXH8MLKPeBAokjz9mV1JCRvPMA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 31:2hCv6TgM+dtwAWp43x7ScwPo9RzfVvYWEUHKqd7QGQiVl8P/0yeluax5kxpBuLdjzO8mw4u8/9WkkeLI2jA0uBMl7Xqmc0a+mY2PRFiDm/aGKerB3SPd3LpZDV09HHZN5JXzGAddX/hYa37zjs1BQanEMdQUGU82HIbVInH9R84SQ86CBDH+TzHenoYGTz+VOnApzUOfvtHaYckZwwp9SV98BimZCptH/q5JtwTHUUo=; 20:yxF+XJRMqIkE8v1toi1fjOEO8Dox1zzpQWwB5d2HW3n1NVimuLKiwewPnIQgpqjxzQepvbw1Zi/cuCeFgfYtHH4MgSS74LWBro4b++wEsVDWa+ZmltiBermrVYOTGoGzTfvccY6CSkDicF0mpGabOdvHUG93/vYgyTJRBUu3DOVRahHxX1ug6MCUowhcFel8mLBp0HOo8e6M7K4Cjd8iv84AzNU9k5tP8Xq/51uLZtcLZdqyf1AsuP16n0+xrOiJ4Ibzt0Ow8VDsv30nk+xZZjv9Q+pwPgY0ORtbQw6vD+0X1wiFd1OEEp+9vPkficcyLnsY97Msdk7LVzYlgAVlUaYd6Ci1ZxnAw0MFlEDC5fY3GFMKXS1XiM1jP1uxjAKIh/PyfuSnhpE5Tz3B24LhScSB8U1/RsnQ/hR6WNhACOvv0USqQfKJyOlLOzgJH1sN2w8p06w4gEG2Sf5M8JwM5hio20yjdLdHh8TSt8QM2ZZLw084hrHzkc0wLohwWCSobKAE3Y34DapBOANZAyHbgPGBF/9roZKQMhJ4MoDx+4YHki0XNp2N/fXBgHuLaGdcP+6ZmiCnOpaos+ce8ueP91sDUOUmtM2F/zinxvYZlrY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY4PR07MB3064; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3064; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 4:nn1DfguqkjnXdg5cGKlzc5Zam93n66C0C85L0pcN/YnHpYw/dneYfgJ6qg5v/rxXM12hmmQowE5F0WB59J7OmM7U/NTnGGSh5LVqVnceu0CndrJZrJb+Um/z8raNUqEx/mi1kvPSTCYqbcadfdtnh8a7h0K2bitHzBlubKxXuPsCIwhGQcc9EgVpJmInGbf4ZTlcw72BrsrgC1yPBeAfnJoQbfuW/iHczCQ7IeNShoUNBbTcx7QKP+jTv/aQ8OHHLhJmE1vEOebXvuovn7yO8Pmd/wNT6MHe4cuGKGEA9Ey3FBKd0ZuGVEfZy5gUkYV9XvCikimjUFEv26kUoatV8JnE6vfkUnsbsYUxyiXu5bHcugD7TrC/b580AYLxl4KTL0jXOcELAqloJaC+r3mLKw== X-Forefront-PRVS: 00462943DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(81156014)(36756003)(77096005)(189998001)(2906002)(229853001)(2351001)(105586002)(8676002)(101416001)(92566002)(5660300001)(81166006)(6116002)(4001430100002)(2950100001)(7736002)(47776003)(4326007)(66066001)(586003)(50466002)(106356001)(50226002)(5003940100001)(19580405001)(19580395003)(305945005)(50986999)(110136002)(76176999)(7846002)(48376002)(68736007)(42186005)(3846002)(107886002)(33646002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3064; 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; CY4PR07MB3064; 23:OgHtgnWdANMM1EBQz0DF+Nn1CpnC30ok/z1DEk0TX?= =?us-ascii?Q?2rfPmzKAQS5PZgNYlv/iLM8pX4VdQWe55EP37xoF6FcHmodYBqUb1aT8fP5J?= =?us-ascii?Q?jnRQzeKc7rf9kocPdpQnV4SK0f7dHnHCcFJwviIR4hQo1HBnuz6RO9ZSTdsY?= =?us-ascii?Q?5PzZ2QnaGb0fQojodfWdafL98UR7HWYXrBp5LB3AXC2IoFGseWvW3XGV8QW/?= =?us-ascii?Q?1Zgw0uQhHz+6JfcHWnJxkwbO+E4oJd7gJ3usrpj61UNuJHg2vlyuyUxLZDeG?= =?us-ascii?Q?u+ll514JWuiMcV630ZAg3ScoSl78d1c1zVoSXgU8tR4agmrFQ4P4dqo9ODJj?= =?us-ascii?Q?oOA8EhtBNmKnIFZ+MQRSlI0sSSI5IN/Ebs78fYtAcb1QZ2x1I1rRCCDcUoqe?= =?us-ascii?Q?HR3ertFsKSZzvcdTA8TPElVe9D4HLey8krIWbhZknitpQeOLp2I8g3dlQyLu?= =?us-ascii?Q?oHWknSmFg4+HmzVVJnZfcREdf8bLJvOZ8uValubsMUNMmZnZC/11ExbwYkfR?= =?us-ascii?Q?m2gMxYQapq0cbHGid45Z/R9NloPTj5m2Pf7pAtK7JnoqvJAXPy76JOmdqFE/?= =?us-ascii?Q?+JtOa/PpqdmCVBmXC70t3/BAAjCS/vHNuFvN+iC2JSAuLpdMyAJMd73tBHSX?= =?us-ascii?Q?pUdDmkgkHX47S8TKYHAvA+K06KYY418lf0qpp1MMLHZBmUAXd17DJaTHmX5l?= =?us-ascii?Q?rq0ReDtOlecDOavCeFkFDrOHS774ONhjcI+RpKxM75yiRX9B87/0xZ/wPGLY?= =?us-ascii?Q?zqKhBIFTgrHX0MJtlLIyLCrilWquJYb3ra+IDsgIn5Q1WWtpKRGzKdog33ya?= =?us-ascii?Q?mu7aM74FI/saAnZLNeIluFsQ4sE/iodaeOhMLcy+7ZuiayJXO0sJpt6IjfhN?= =?us-ascii?Q?rtYIk0XIc7LdS/cF8KGVyFVnXEIJjPuk3fwtUnkZZHv3R0UVXQ5ZYkyj9sYE?= =?us-ascii?Q?c3DEiy/C005RF8AM1vB2HlBpuJ8kNEDFTGDZKmkyzQRbRVSc3pmL+lHP2zrz?= =?us-ascii?Q?qvzofUtViZEpbg6YTZU45jlxngofqeIytU2eyAavQr8JQOjc61l7Biip4YYx?= =?us-ascii?Q?y9DAj6aFheKTCb6XiIQiPwiIiYujgCnZAil46XXwf6WLm+/GpqtkndtgwbcA?= =?us-ascii?Q?6MdEvw7pTo=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3064; 6:qRGiXPDyx++EC/vEmRIbN0joxTMu2jeu3uuYFteLjSY+18yqduMkGQz4Sjrmj2guV+OX7MEZpnR5BSOmNpdzvjoz3pPQI2j20+jjqXWAPelCkEUtR6w8EbJcbE9sz4KmnD78Pw8Ij8Akb9wtvgu677QJmEPre/AbJMPRaYxIO1ldkMEUY4fjfV1uZcQ4ACBQkdnX2WdHJIMCblZ1cBYj1TbGi48xPn4PGuKglBqS7dGhAYd44MYYs7tttyQ2mov2LczpWSpM+XTsHZmfg/QsuYnTVJmyIhkpaLMb+YTYAzc=; 5:mxCuxs6DUEXQeQ0rchLUpFFovlgPkkR5rsGn82pjlJz8qNppr2E04py7xL54aEISpZY4bp/26Za1vig5m8jE2ifJLIucCG1a4KJC86D+6NuRGRNJ6nV63mMZOwF2xiTkGugPRyHfP6/KeFeistMCfw==; 24:vJoFGW9/ZsFIIigpHW0r+Ep0dqJEf744KrlDZu0HjGUlyRsmAnwpMwmpzG+A0cLfbqoJUln8t9ZpFTwuMiVBtyNyheIGo8d681/nFMhpjw4=; 7:mqbAeTiD1Pgg3TAwH+o+pz+wOwNQjHV7DRz6soElSzsmC+K39YQ2RRfTZS+Cr9lNOZkVy1mbeuP22VmJt0WSJX0IWmwHUWGVVZy93GfnuQHRxycGHQ9tSgOdiKksWhXlWpa/tktreyqwQj0JbviLqqsKL2EhQnV26DhxcIugIotGgTje2gCJZT1OPO0LRnuCt2hS1U0b5VNwHl1tOL6dvIcTSeWl39vUJi+RdTQWaIQNVbCObF6YGBLryfhMGw7D SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 16:54:54.1432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3064 Subject: [dpdk-dev] [PATCH 02/13] 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, 26 Aug 2016 16:54:59 -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