From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5FB6FA0A0F; Wed, 30 Jun 2021 08:37:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1605440040; Wed, 30 Jun 2021 08:37:19 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 96C4B40E01; Tue, 29 Jun 2021 19:24:51 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10030"; a="293832956" X-IronPort-AV: E=Sophos;i="5.83,309,1616482800"; d="scan'208";a="293832956" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2021 10:24:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,309,1616482800"; d="scan'208";a="643797101" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 29 Jun 2021 10:24:50 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 29 Jun 2021 10:24:50 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 29 Jun 2021 10:24:50 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Tue, 29 Jun 2021 10:24:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0kpxZU2RK/7onnn4nd54zTxPjaqMHlc/NAc1U3fNiaUqM2UlkJFVzdIF3S3OkFbv+jUYn4H5qbD0x21HvN4phP9mH4ISz23DI5+FdbyUyjRJpt+j5WCeGKa9uLEZFG3owmHQYYRw/lZ0j7dOMUedeiWYNSaUwl6sC7uqdeCUPvNFeVGZKF+tPh5l2lLXD/IjEvYGaqQvDsacQ43FlP0tMBUKhLykxC/AZF+MV6QIHmv8Eqsh5lEj05hzoKgp6iRwghPNPHW7x7HF5umpTwJmLZ6hQ1MKaOCHhTJnrkPdY19EwcnUn/2izq4TRckp3ELegz9Qcjryyctd90Sbzbt4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hezU3VjDEIp9K4IJdwxze+Nsmnh74lXQ3aULDQmRfyU=; b=eHMRDo4xuJ36v+/bQKWtGammAybG1jwXezXTt8SStn9/B1U0ajWv0ZSgwrmCSnztzM1lVD6jMfjXewHF8nuoVzq6yITBLj/FlXTexUmKU747BSpoFINuvg7Y0dP8moW6jzfGUEOmoIgzCdUYJcilPjCdgAM3htXObxokzdnnFEGnPD3VKOtjbQuaZhnr0wImenfGS3zk4OYEFpkyXIo9hgeinKEp1aau5gMMydxg6c6kpasiWqivOTJvfWzyCoNV5NxL/QlPj+FbFrDthKtb+5nFRw5JSclz/g1ZrdzhmfmkVoFGgsIWhexn98fMiUKvmLaCDJ1BSQKknOlzAO7A0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hezU3VjDEIp9K4IJdwxze+Nsmnh74lXQ3aULDQmRfyU=; b=bVLSfU/Z8u+Ii9KsrnzafyDpJEI+jHF7Eu+ZTbEnK+vi6/Ml4IOoZuzZJdMvchl0KcKAvNztuoj/uhFjTL4zxDeQnal7X8w55ptPphn8dN5FOKTUJXK/zWrnchrhvPCODldKN8o2HM35DJcEgn2MikZbimqbk+lgsz7VwWVASNU= Received: from PH0PR11MB4776.namprd11.prod.outlook.com (2603:10b6:510:30::14) by PH0PR11MB5112.namprd11.prod.outlook.com (2603:10b6:510:3b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19; Tue, 29 Jun 2021 17:24:47 +0000 Received: from PH0PR11MB4776.namprd11.prod.outlook.com ([fe80::9548:597f:90f6:3642]) by PH0PR11MB4776.namprd11.prod.outlook.com ([fe80::9548:597f:90f6:3642%8]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 17:24:47 +0000 From: "Kinsella, Ray" To: Mohsin Kazmi , "dev@dpdk.org" CC: "stable@dpdk.org" , Olivier Matz , "Ananyev, Konstantin" , Thomas Monjalon , Tomasz Kulasek Thread-Topic: [PATCH] net: prepare the outer ipv4 hdr for checksum Thread-Index: AQHXbQl7nrjQow8N2UC5XzBDuLZ6kKsrPRmw Date: Tue, 29 Jun 2021 17:24:46 +0000 Message-ID: References: <20210629170658.19452-1-mohsin.kazmi14@gmail.com> In-Reply-To: <20210629170658.19452-1-mohsin.kazmi14@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [89.124.12.13] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bfee504e-8bf7-435a-0f54-08d93b22cb09 x-ms-traffictypediagnostic: PH0PR11MB5112: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I81q/19jpeSvoNXjnQeHOkKeEVik/kgMlBJJIYDHN+CNemYzqOszmTBz9wQsJPyQN4la9ZyGvsk1ZKyfLWj638+5qZ5A8lyf3aoHWhFEx6WMjc5joXKnUsqG2IXUMCxoKfISttDqxzqcsgSmdYw/NUAV6DP5SNonhSI/yVrBicov4AS0kLPbQ2JhIEtmaEsNKBJpwWJWdsOHShVJ0utftYUY2ivIrBzTbeK4iH4buyyXixpPU1+BroCy/4ZUmKQMl7slA63KU6fu4lZASGWtiwwddBIzajGcmII+wG+Y59uHdGkGMBL4OajbzeFJ8WNdwPFKA0r+S/5Ywz2AMFhIykUjOszC8zgXKAg1rYSZwWrAAEN7mvZKNkoJ5BXWQOYU7ZGOrC4RYzVjYAtZSj6r8AU2Bo42toS6P/aiAVO6ll+1g3X5aNcI8X2FSP1J9Q9XsFsmsNV6TctOcxEsURuFRCskRAraXZVRlMFRjYT2cSL35cRQYTf1mXrrbc0TiD6h953ooA1S4hDO+Ge+kYj02G04e3xaV8om+Udp3srzHjVevmXF/fRZnIwqN0LeK8IMu7sC/hb/63aM2x37Mk30/86YBJTo7rYKhRfj38llfmhkBAb6GerooNG8KLQ7p+lV1h2Bo29bpbuwrAenQ7dCVQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB4776.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(136003)(39860400002)(366004)(376002)(346002)(186003)(86362001)(478600001)(26005)(38100700002)(9686003)(122000001)(71200400001)(5660300002)(33656002)(6506007)(110136005)(53546011)(55016002)(316002)(54906003)(7696005)(4326008)(107886003)(83380400001)(2906002)(52536014)(66946007)(64756008)(66446008)(76116006)(8936002)(8676002)(66476007)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BlNQGkvsx+cRVN9rqX+aPDbgyq8Vlvvb3zTNUu0hUBFd9ZfB9IOITYWH50GR?= =?us-ascii?Q?VqJdtSxM+2OrsDpFTSeQ4P3Ovh0sLPiipcjPdMIQd9lOAWdVp9bwyiN6sVSM?= =?us-ascii?Q?EbZ7n7tbz7mP8J3jk4PMcG0+WNCu1uhP3M7zeBQW0JO9XJ35hln1q9qP4XAP?= =?us-ascii?Q?+dSLjimigdu2ZhpnVFQvnsDhKv87ikgwxCkpJClSzdoib3dTjhpBwSNGxHuf?= =?us-ascii?Q?/8Kl/moAhdniQ/ObI0PzlOcolddr/inRUpTJ4gfF4n8ofwCikUuFRBfSYfj7?= =?us-ascii?Q?h8QipR0O0wwZqRlmWj7OqdMpIyZwqVKReWkZACUIOOLYleJ9gqmaxooxRbcb?= =?us-ascii?Q?PgNVppqkvecELYarMczMl7GrMdP69b4HOUB789eRv0iqPWKu1kms4KVVrKRb?= =?us-ascii?Q?kbsf3iod3ejJgnQe9egqCB1bF6tlFquhJETdb8LzxdDECniuENlyLFS0aLBE?= =?us-ascii?Q?WCqDGU7ztaxl6e0CrWYfrhuIwBzRq7jWWcR//UYxcAGodTayu9qydrhNSeeW?= =?us-ascii?Q?MzomsS8wbLty9GyvmjzmUakeS2/RVT16n9WByKpVBzOUAwCYFw1BBkzKNbiG?= =?us-ascii?Q?TXw/CqsHLlA4PeBfdmWQjKhoNHxjEL8gapdcqrm40L2bZfl2I3up8WUqR0Eh?= =?us-ascii?Q?Ir/qZQnfJcty+RDn75mBbTkIN8USUBYUD1lfUsTwFte96BvMGH2LjjHDtq2Y?= =?us-ascii?Q?S0ppu+ZqdN+5OaQtiZjnsZM0xYSAdCBXQ5Vk3iCWWN0SM9VyJ5A9lUfmw5gT?= =?us-ascii?Q?PRlx+NZ+XA3ClmTAqTowj7SsNyKt4Ev6haNDbqwU+pksVpoyKueoiTKzIAaS?= =?us-ascii?Q?l/uT2ajYOs7W88eZCdhWdSWv116fFDH4VX3aZ9uy9cNfevXUQ7xwGMTbXNe6?= =?us-ascii?Q?4fJgh4h+aNwVgj0a0B6Kpeiqo8hH1oSXf+hCLUzv6Ro/5JaurPnROhUXboB9?= =?us-ascii?Q?llBBHK3LLO9x5UFD/d4Eer9E+522p/93Exgh5PoLHFZVaBy+VrWhmGhb3rII?= =?us-ascii?Q?wJX3JuuKnZfUss9oaVg8/CaKl7DW8PbVmZG3clyp8KhP9XEIXFPvyzlkRA9j?= =?us-ascii?Q?ooHwWro5ZstvIPwIGrwHh7aomTC0GsEOICOmEXMjAMgljTRVD3DH8XxdKg1c?= =?us-ascii?Q?ImKWincBHVRRxkktgmUOfEr1Z0Fpegw9SGmTBfKGFTkogZCVKcw/YM0vspgK?= =?us-ascii?Q?3cOoS5B+bPqF/TOyJs9tCEJJ3/3dVusuCKyWS9eT99tcjEluxOSZlQoGY2F9?= =?us-ascii?Q?fPqFieeHAfPg8zpyjs5WMjhA8tAV1rTxboCSamCUiacbkDpaFhGlKwkX867r?= =?us-ascii?Q?o63en7+RyFbU325ME2Bun4Uz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4776.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfee504e-8bf7-435a-0f54-08d93b22cb09 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2021 17:24:47.0174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v1xQd0MiMViqm/vKHBhdKc+dofYj29CRggpcMKCYtOqM+iA1kyCAwYj5Gw45xa8/tP600OLSFnIzX2LtY6xn0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5112 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Wed, 30 Jun 2021 08:37:17 +0200 Subject: Re: [dpdk-dev] [PATCH] net: prepare the outer ipv4 hdr for checksum X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Please mark [PATCH v2], and record changes under the --- Ray K > -----Original Message----- > From: Mohsin Kazmi > Sent: Tuesday 29 June 2021 18:07 > To: dev@dpdk.org > Cc: Kinsella, Ray ; Mohsin Kazmi > ; stable@dpdk.org; Olivier Matz > ; Ananyev, Konstantin > ; Thomas Monjalon > ; Tomasz Kulasek > Subject: [PATCH] net: prepare the outer ipv4 hdr for checksum >=20 > Preparation the headers for the hardware offload misses the outer ipv4 > checksum offload. > It results in bad checksum computed by hardware NIC. >=20 > This patch fixes the issue by setting the outer ipv4 checksum field to > 0. >=20 > Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") > Cc: stable@dpdk.org >=20 > Signed-off-by: Mohsin Kazmi > Acked-by: Qi Zhang > --- > lib/net/rte_net.h | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h index > 434435ffa2..e47365099e 100644 > --- a/lib/net/rte_net.h > +++ b/lib/net/rte_net.h > @@ -128,8 +128,18 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf > *m, uint64_t ol_flags) > if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | > PKT_TX_TCP_SEG))) > return 0; >=20 > - if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) > + if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) { > inner_l3_offset +=3D m->outer_l2_len + m->outer_l3_len; > + /* > + * prepare outer ipv4 header checksum by setting it to 0, > + * in order to be computed by hardware NICs. > + */ > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) { > + ipv4_hdr =3D rte_pktmbuf_mtod_offset(m, > + struct rte_ipv4_hdr *, m->outer_l2_len); > + ipv4_hdr->hdr_checksum =3D 0; > + } > + } >=20 > /* > * Check if headers are fragmented. > -- > 2.17.1