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 D74D1A0C41; Wed, 15 Sep 2021 10:43:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D05D4003F; Wed, 15 Sep 2021 10:43:07 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 6119F4003C for ; Wed, 15 Sep 2021 10:43:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="220383504" X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="220383504" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2021 01:43:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="529329432" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga004.fm.intel.com with ESMTP; 15 Sep 2021 01:43:05 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 01:43:05 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 01:43:04 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 15 Sep 2021 01:43:04 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 15 Sep 2021 01:43:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbLXqzcnA6OUXwag6IHvsJhv5XgDH6RAR2MNVR2Uf9xabT/sCNssDx63MLz2AYgYRMOzX/06vq8Z8VQLVr/onJqxpivSKvgJ47Jb7WcHT2ThuzlO23Ti0RVBN1VL3PMwWzObgSYZlUpeUKK9Dqz94EGX+H2dbtFYX0OaSsOd0/aS1gL4WJmuq4aABVwHnpMe/YNRwreU4WIiC9qDo+4WE97RHReYj0ob380XgVx2pPHxxZG/QZZOzSZwF9Z1BzT7wNQuKWwvW/jJ15rNY61ncFsL1/PBv863a5aqGhYIByEcotR10+R223xSD/ivumes77cLHnyiHqidKM8ImSMhDg== 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; bh=MolEaPASDSHGi3hxRmBGR16cum6QsWwNRZ6MUaTDVi4=; b=dQYNwEXsdXABMzXthV+ws63ppRnipO+A1ItJS71khn5L2hWnIpydzyRYWKmNcBNzgEUecdDkkKvryBwHrNTbAwxkL7+lNubG5VecgBt3513rh1Y/hSmOIXMLHQEfOq4cWHNgu82/AYavmy5Z0SlQi9zij2fbb7u5kEzrbXaezaUEnsn8cJgYdce3yggwntJRyXYpmeH9u1NytRxGuWcQ4Snw75ZlYU0FY8cbdvOFdT+nBaMLYDpc87T3hG0d6dPLTMNmRzeVjftZ2oD0iJBO6C7YvnDZBmXZOKzwwNl4lWWuwgvHrmxiVXz40NIpAeFALl1o3mCcb3lzOI9u5OeZEg== 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=MolEaPASDSHGi3hxRmBGR16cum6QsWwNRZ6MUaTDVi4=; b=wyu3w8V5S8EaLr0VKCdzfFwdY2ILmH+UDhaw7/vW1EZvQQCCLn3p+2fKJ3kI8IViT8SOzTqCN0O9k4rhjfB6+dH/TzlG6fqgggm2z78CfNhWb0JiZAt55ceh/q6NswKycTCQDVp2QYm9bEmyC3HpEgJzzJeP5TknWxDQdLIsdsQ= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3227.namprd11.prod.outlook.com (2603:10b6:5:5d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 15 Sep 2021 08:43:03 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 08:43:03 +0000 From: "Ananyev, Konstantin" To: Stephen Hemminger CC: Usama Nadeem , "thomas@monjalon.net" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available Thread-Index: AQHXqZQ3ZFsLZQWOGkeIZKuXOaE2RKukF9lAgAAZ2ICAAJS0EA== Date: Wed, 15 Sep 2021 08:43:03 +0000 Message-ID: References: <20210913120951.103968-1-usama.nadeem@emumba.com> <20210914180827.184123-1-usama.nadeem@emumba.com> <20210914164415.020dd967@hermes.local> In-Reply-To: <20210914164415.020dd967@hermes.local> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 51b6ccf8-9680-49a0-b41d-08d97824d4c7 x-ms-traffictypediagnostic: DM6PR11MB3227: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3Mwrq+ZsggY1XnkChFbc2eiWrxSq8w+hDPJqfzxo2zyRkw46BiXtxw5hF0nIF2MIxY07q7Z8RUOgwetXwRuwZkZQHhe7C9kPeivqUf8V05zoP+PphzE6fxKFxeh9mos1gHaRl/BY9MBY6blGczTp/ieGqPeIU1J16tQ6Jh1ighoAyevfj/EXvqE+s/NdqNOVaXu0JndCFcLtUdbYdT6Coua+/8MtY3yYhePSMM10+SkQ0rSL+fta0GRypTaVZh9bsif7r2GZOcmStBn3e4mxe3Jv5AQz0PDAm9gH7gktd/b6x4AJKXq+SkX7psb+0BP/ENqfzx22fPAPr74shDNYX7UeQzuS91cW3EY+m1fUs0CBVXfKSrR3L1g6C3g56K/xHlmlHtSW2dqpVpKyKIcxa94BNblOBATIKg/ucOx8TWwkHqaOmsr32tMviSwhnV8kaoKEsylyWij8nnJHZaKnrBimUvPwSDnfJflwbywO3FGaFaK54mRsGg3CHUOsNgSejEH5ICwpdqqixB3agnDVucs9GsANRaaRwsk+kSKt3srE1OFBEtBkrxfIUWLE/JJYC93KkdxZAHJg7vwslcALnWOF5hZwlvD+CLyCpz5DwYJTsLSQ2+IJvaQoYds9BJDEcTr85B7OlLzhN4hgpssoCUI9DYdDXBL06OqXwXElXFqubUnrSgrm1xjUqBlpKy+63m9SecQngLzRlLK8QzleLQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(9686003)(316002)(4326008)(33656002)(5660300002)(6916009)(66946007)(71200400001)(54906003)(186003)(6506007)(508600001)(26005)(55236004)(52536014)(66446008)(53546011)(7696005)(122000001)(38100700002)(76116006)(8936002)(64756008)(8676002)(2906002)(38070700005)(83380400001)(66556008)(66476007)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?KUUcc6+UGLBCy6C5Y4dZ8CHwDoWsR02rDb/7315xSjKGwFenOrDOAXJC/e4y?= =?us-ascii?Q?KCwnt9NRUi7eitn9e9e7CzJXsQ9PSYsPvdVMcKzqJ1Tzj4TjceQ1GZWT9xaB?= =?us-ascii?Q?PTPn/5qjHkAmho1Cfvd5/cb9KMrrIvMfubbV4XPntxEDcgNZc0rS8NE0bXug?= =?us-ascii?Q?kRW7iBbMZ9qvvCEqTvIxUYRKwBasIG+K2NQh2q/gtF4ja1eckc+YJPgelgga?= =?us-ascii?Q?es47W63g9Dl8lIhpqyZ3Yafa0mnKEwAubuDS/V2bEVQ5tVwPEc0MkqnTAygG?= =?us-ascii?Q?kZXuM+/jCw8ZfeVKL4NyK7+YPHQptF6MklrnZ/T4TEf/TtVBZ15QzHNLqFOg?= =?us-ascii?Q?1VuaaJxjW5hjwRR2EzAjxBsS4ipyogQykTTKoUKjZ/TMHpzwzsHIxSRuEqX2?= =?us-ascii?Q?3Xwkiqzmu9lmD5xuyKeOox95G+Wpk7UN3/RnpjcO6vnDZbpdDaPX2WCJiUIm?= =?us-ascii?Q?lR9GfPZUGLM/VC5z96SXFIqmQ5BJSG2warGfUSSo+g4q5WmtXbtVR7dw8WFA?= =?us-ascii?Q?VJ54qCPRkUkYQlfD3ywPAY+18v5O70XPRDuomEYYfw5spugCHEmtjBrCPMPW?= =?us-ascii?Q?JKnuIzV5sYEokl0iwICWV+5QwbfhGskfE7iTjmZmvAS/58xNo89KxsXBvve9?= =?us-ascii?Q?MHJjKilUT1F4YJcmlE1IcMbFo7rET2NsZKR3vGHg97PcaAFN1fixtB3HCNFz?= =?us-ascii?Q?SkvxMsmLdq2rnqWVyN/SIRhHfqG3nVtVMl0iOcwGyWNVpuv75aV2usTKfDG4?= =?us-ascii?Q?JE2uFUSz5f54gMKitKG8ikylSiIBHZPgbkFdwX4vQ4j+XcmOvPLjkER0K4qk?= =?us-ascii?Q?b7PV0VOgAebJ5R3X1ujfqPR3uMNavpEImlHSYK4AjABu75tCeCZK9y4A0nbf?= =?us-ascii?Q?KiQ5olSGiLhJoJHlnurgNavwK/t4jbfvLRuutsS2FfBQjunjR9idFZFpVpOh?= =?us-ascii?Q?As4Bj5nimiFN/gjzI/u6qRo/4zHpoywtHE/MJlfXPcd6j6xA4aIdGRjA8BF+?= =?us-ascii?Q?qfmzEMUOUjngBPHbv/inkH+7LaIW1ldV+p4mLk24vIZUPfM4lIKaGa3sAEzb?= =?us-ascii?Q?dr0mew/2i6YIZk7W5Kye4VJ/hfgd/KFJpJQMHu+IonJLwdUSGDZ+7zyn6BtS?= =?us-ascii?Q?oW5beZTDq1XKC9meVsj9yaWvwhKu82ya9qOjow9lRMVJVIcU9g7iSgtS8INV?= =?us-ascii?Q?OXmYVHGWtoP34YxGNJuc5Y+DlTrsNk8x+pAHYXYXcZLSWE+rlzYbkq+sw80d?= =?us-ascii?Q?RO6OjrFUHi4E70Gc7joOVkFXEcSPlygeTStIbN6CDJRjcjcievNImDlcK/fD?= =?us-ascii?Q?RIg8Ork/bIetL4rIYwgetzgN?= x-ms-exchange-transport-forked: True 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51b6ccf8-9680-49a0-b41d-08d97824d4c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2021 08:43:03.2379 (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: EFwevUhhqmTXBOutJsVJqUqZcUMZo1/G87mImBYWOiulgZbcU7OFsovkLiDgAxNLWHPbpJWHfp+zB9W44uwaWR1Vic2rkjLFOGrimXLOKZ8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3227 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available 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" > -----Original Message----- > From: Stephen Hemminger > Sent: Wednesday, September 15, 2021 12:44 AM > To: Ananyev, Konstantin > Cc: Usama Nadeem ; thomas@monjalon.net; dev@dpdk= .org > Subject: Re: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum off= load not available >=20 > On Tue, 14 Sep 2021 22:22:04 +0000 > "Ananyev, Konstantin" wrote: >=20 > > > > > > From: usamanadeem321 > > > > > > Checks if IPV4, UDP and TCP Checksum offloads are available. > > > If not available, prints a warning message. > > > > > > Bugzilla ID: 545 > > > Signed-off-by: usamanadeem321 > > > --- > > > examples/l3fwd/main.c | 22 +++++++++++++++++++++- > > > 1 file changed, 21 insertions(+), 1 deletion(-) > > > > > > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > > > index 00ac267af1..ae62bc570d 100644 > > > --- a/examples/l3fwd/main.c > > > +++ b/examples/l3fwd/main.c > > > @@ -123,7 +123,6 @@ static struct rte_eth_conf port_conf =3D { > > > .mq_mode =3D ETH_MQ_RX_RSS, > > > .max_rx_pkt_len =3D RTE_ETHER_MAX_LEN, > > > .split_hdr_size =3D 0, > > > - .offloads =3D DEV_RX_OFFLOAD_CHECKSUM, > > > }, > > > .rx_adv_conf =3D { > > > .rss_conf =3D { > > > @@ -1039,6 +1038,27 @@ l3fwd_poll_resource_setup(void) > > > local_port_conf.txmode.offloads |=3D > > > DEV_TX_OFFLOAD_MBUF_FAST_FREE; > > > > > > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) > > > + local_port_conf.rxmode.offloads |=3D > > > + DEV_RX_OFFLOAD_IPV4_CKSUM; > > > + else { > > > + printf("WARNING: IPV4 Checksum offload not available.\n"); > > > + } > > > + > > > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) > > > + local_port_conf.rxmode.offloads |=3D > > > + DEV_RX_OFFLOAD_UDP_CKSUM; > > > + > > > + else > > > + printf("WARNING: UDP Checksum offload not available.\n"); > > > + > > > + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) > > > + local_port_conf.rxmode.offloads |=3D > > > + DEV_RX_OFFLOAD_TCP_CKSUM; > > > + > > > + else > > > + printf("WARNING: TCP Checksum offload not available.\n"); > > > + > > > > Sorry, but I didn't get the logic: > > Application expects some offloads to be supported by HW. >=20 > The application is expecting more offloads than is necessary for basic > IP level forwarding which is all the example is documented to do. >=20 > "The application performs L3 forwarding." >=20 > > You add the code that checks for offloads, but if they are not supporte= d just prints warning > > and continues, as if everything is ok. Doesn't look like correct behavi= our to me. > > I think, it should either terminate with error message or be prepared t= o work properly > > on HW without these offloads (check cksums in SW if necessary). > > In fact I don't see what was wrong with original behaviour, one thing t= hat probably > > was missing - more descriptive error message. >=20 > It is not a problem with your patch, it is fine. >=20 > It is a problem in how l3fwd has grown and changed and no longer really w= hat > was intended in the original version. There is no reason that the applica= tion > should be looking at L4 data. In fact, it shouldn't care if it gets TCP, = UDP, SCP or DCCP; > but the application now depends on ptype. >=20 > It should be possible to do L3 forwarding independent of packet type. > The application only needs to look at Ether type and do IPv4 or IPv6 base= d on that. >=20 As I remember l3fwd cares about L4 headers (chan cksums) because it can do = FWD decisions based on 5-tuple (exact-macth mode). I presume that's the reason L4 cksum offloads was enabled at first place. For LPM/FIB I believe ipv4 cksum check should be sufficient. If we believe that some offloads are excessive, then I think right way is to simply remove them (with updating docs and source in a proper way etc.). Just printing warnings and continuing seems wrong to me. =20