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 D0469A0C43; Wed, 15 Sep 2021 00:22:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 967A64014F; Wed, 15 Sep 2021 00:22:09 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id BC6834003C for ; Wed, 15 Sep 2021 00:22:07 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="222187910" X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="222187910" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2021 15:22:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="516128628" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 14 Sep 2021 15:22:06 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 14 Sep 2021 15:22:06 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 14 Sep 2021 15:22:06 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 14 Sep 2021 15:22:06 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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.12; Tue, 14 Sep 2021 15:22:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gh3yxzmaTpnoUardVkQU4rdJZh877bU1CY1ocrBzV0eQQiV0PWkZT26uaK0K8XiJ7JIv64t8sSZOOIKKEsTwCVyjTT8MB5ew13938IZnztThzSVYoKyKlC3n5g9sEe92FQQU9FZ5GzxUCzGHg7qFxZqQZWDTx8hJTP2rEHhAFpx3YdcUDDMhEePAib9D32IE2Fi6vd8a3tViqZ4Bj0SDdKFqd3CEpCLEf4QAyZZheHjhGQJJV8jZ95X8M095mFphSUxDoaUCU9FlIn5vZxapChJvH2G8orbS6gP1IXFNEKIiQMXVo/tK1cXr9RhbTsdhafyrcjkxEEzD61O8Ci8ngg== 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=0m+WFOQAlmmafQH35/VG40/d1ihT7OuOwieaciKA8I8=; b=S43kbwR1tJRnKtbYn085TmTTpPaXB4+oJiU899yhrT19fDrdhqYtNAjhSBiyNXSdGxsGa4egiupBLTSqfxCWLlNgJUEwkU7E9VK7eSXBhaPd3Qm3vkOLunbI+2OyokbQ3OFwNLw32tJbxZl3j5Zcf2DIwpqD5GBhgLwsaoMG1+s3AOW3cpy43TnYtpE/M9QLUf5PUzfK7bPge7jwGAfrkJQVsTQW4OOOh53z+dKM9SRbpk4wYfB2ketsjgTwV1aHhaqF4aHziY34Ml0tvIR/6idHvcvCVOdNE1ujFK3dPcZY7/tPjt6RyNXLradZqch7Ko30eMWPpsbdCp4mhXp5XA== 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=0m+WFOQAlmmafQH35/VG40/d1ihT7OuOwieaciKA8I8=; b=t00TiE5WOeCsiUMPPpjyX/v4oqUxzBezj/CJOAB5BYsbdGhyUhqHG41pPitIpgauTqXhGd/3kqHh67BtaOa4MT/DzBKJfAKPMiec6w2FqU0ZRqugPdRELKkuOU53tfiB5YEATJD7OXQ6KhVceruUpnk40UMq73dGkw0qgA4WHLc= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3131.namprd11.prod.outlook.com (2603:10b6:5:6d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Tue, 14 Sep 2021 22:22:05 +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; Tue, 14 Sep 2021 22:22:05 +0000 From: "Ananyev, Konstantin" To: Usama Nadeem , "thomas@monjalon.net" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available Thread-Index: AQHXqZQ3ZFsLZQWOGkeIZKuXOaE2RKukF9lA Date: Tue, 14 Sep 2021 22:22:04 +0000 Message-ID: References: <20210913120951.103968-1-usama.nadeem@emumba.com> <20210914180827.184123-1-usama.nadeem@emumba.com> In-Reply-To: <20210914180827.184123-1-usama.nadeem@emumba.com> 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: emumba.com; dkim=none (message not signed) header.d=none;emumba.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cf2efb78-42f0-42a8-fd0a-08d977ce151e x-ms-traffictypediagnostic: DM6PR11MB3131: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nn247KtfdY4cYiM5baiWGYbv3WeXnZBhUDkcr4SvVj5Wr/IR22SvORY64zcxjQxhYI3g63vozRPCb4rL2+q9nvvYAUk+0gulD8nBuA0HVUrmKzh+0CHwaD+/0oGIV9iO8BSDxCO8oYSJwXJFtN5216wOGaQRcAFP6F08kKn7JNV/nfKskZFCohvOwY+xOuTxEYKfSYb9+xWVncYcKWodZcK9fcXIa+xaGKxZbMYAaSXq8l5IUYSEBdiW8+bqWAPtGCqOI5NgNKXPwggA9pd3TOd97sTsAk8v3UXfiDXqO0eF4lThpNcBiPESVlSDz6xL7h8ig6oopeOJ+wcqs66QWlXlEzVK2+hllPM+4GLbSA86Hu6GYj/qyvasbh3+xxWWnqQm1wANNGT06cXxXQHBE0Lal9ui1aCuF1rMEeG1hY97vXllRGUG4HX/Lz9unGqdT0ZoNZHMW4apKJMvXcrAJfir3wIJMRRzUJf4bygPmVnPYR8lh94TUubUXtp/4sgUfM/cGP0fBDxPQkjIlq9qa847TVJoZiY/XrncwsX19f0ajEgfItlbLSOJpV5c0udBriKyMwaE6CpDLFmBll5Gq+xmC//Y/tah3vMprbDU3M74kLmbSLjqNiqkU6mEuYZsYvnpmjpRUeXW/gsVpc2VUluuJ4yXAFoF+XLXAfUQT2s5253Ib/jExLTGRhSO1ZHoMenYfW8JMzRgweVx07Yg9A== 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)(346002)(366004)(376002)(39850400004)(136003)(396003)(38070700005)(86362001)(122000001)(316002)(9686003)(7696005)(66446008)(38100700002)(66946007)(55016002)(64756008)(66556008)(66476007)(6506007)(478600001)(76116006)(4326008)(8676002)(33656002)(2906002)(5660300002)(110136005)(71200400001)(55236004)(8936002)(26005)(186003)(83380400001)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IFFb5vZFRpV3DpuB5bPrUIHbPrW4325IECa3YJrbrQa2pdqCfEecqhYgJGfZ?= =?us-ascii?Q?p/hZv08clj+e9bFrKUF4n1PaqBYl3+4H5bZQXSAhoJdunZZi9AKR++VAOytL?= =?us-ascii?Q?TytVrLKl0IGFWuy8OeT7fEvpOZzC16gvDJ1D+32WT3PuYeo5d+cWKkpvt3Pt?= =?us-ascii?Q?FlNDU7byvJmjc7lJdQLg7VPCfwqDKIpUJ+JJ2hQQsvBtlLjyoB4eY8ej3wkl?= =?us-ascii?Q?49lqHQHC5W89EeXBXOUom+ucTGR3+LZXl+RjnHShap/F2c4oHtCMofuC8Gf+?= =?us-ascii?Q?JWrmtMYTzbMbWd7WySSe+6H0PomGux/LCaMJgI9Ogrv53Y+HcDEC1+z++D6V?= =?us-ascii?Q?TW0bqZ648oRg/V4XB0gJdA411SwNsQp2g6Miv71iQ4CNErW2fT9IVaSgTVSj?= =?us-ascii?Q?YMkWSBNADOBpAvYNYBbqcT8JW77M72V8G5XX/pzcHQDzKMZLuSiZt8Q3/3cO?= =?us-ascii?Q?ez0ZrPpLIjFNv4e+DS8GEVcI04WQB2EvMCM+xIAiNzB0Nby/Ih3k/ed5uoQR?= =?us-ascii?Q?VHMjovTxB7Dc0jTCZYLwfZLO3dyrl6QvpCCErQ8Ygm9P5ERcBObSfbWd16VL?= =?us-ascii?Q?6ELQpKFp8SCL7/GO7gsK4YX2k5bss3/g8TgTYaBOHKUoFS85WDwB0PxR/8Ey?= =?us-ascii?Q?Nfmoyb3fItdkShUSeoIufJ8gJSyor9hRSZA80Xqu37Z0O3SrI/27q9gVE2Ft?= =?us-ascii?Q?mFY8+Q/DlCec9lALm5EhnQpuT5r6FeJ3CS+6cpLeInV1OPwU9IrqDi+Yuh0c?= =?us-ascii?Q?YJ8IdAtkJSYYhUmfv0BGeUTp6/A+AUoocmBxuOMVsjMDDmWA3H/jJRcPIqjE?= =?us-ascii?Q?XrO7cokTi0IqteLAxYQyjaje6xMQuJNuVEPlk4TwP/IFLbofG9tTuW4jO+98?= =?us-ascii?Q?Q6MrBmSfTgQ0YPcVDrposyQxUITsAd47Kl6KTnZvbh/L9O5s2pr1C+9fkup9?= =?us-ascii?Q?3uWQi1Ql+aVgQzwhx/rU5gH2HgE78ZlDO2okJJ7Sx8FpYvfElZq+rsU0VwRg?= =?us-ascii?Q?WwIWwCHiEpID5nQyBWuSsN4rbLRAC+tkjJ98Fvo+egjWp9IsPN+w8lD+4bPm?= =?us-ascii?Q?TPy1roYweLjzNmhW0uSgfuO0cyW8C8E0fRCsQ5CyAIqBoC7bZ6i0b1C/8l8l?= =?us-ascii?Q?f1JLpr/dGSZ3gqJMoGBvJQEb9WkeJrC43BTi+rQ4r2JxglXWJKSYe+XImg5E?= =?us-ascii?Q?TP7ie1W91AwRor+c4nndjex1ZTjCJB3mYydlWk4rlLRbpU/lsR3TtaTWG5Ob?= =?us-ascii?Q?iNjLCWCcZB2UjhO0cOZIqiDSBeqXv5MLHTEygTCNzY0ndgyqWtYpyrKLdKZa?= =?us-ascii?Q?QMoimi1/40KXUYW3pcZoBQnE?= 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: cf2efb78-42f0-42a8-fd0a-08d977ce151e X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2021 22:22:04.9397 (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: ty0n0MhjBvkrnAdgCG/7tgf/+/FGto7RfccYVFcNqHVfFV/L8V7/5xOcmk13pSF5l24H3CVP+6tgHKDvuYT5JuLx9JMhNoQdPcOvKRhO1yw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3131 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" >=20 > From: usamanadeem321 >=20 > Checks if IPV4, UDP and TCP Checksum offloads are available. > If not available, prints a warning message. >=20 > Bugzilla ID: 545 > Signed-off-by: usamanadeem321 > --- > examples/l3fwd/main.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) >=20 > 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; >=20 > + 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. You add the code that checks for offloads, but if they are not supported ju= st prints warning and continues, as if everything is ok. Doesn't look like correct behaviour = to me. I think, it should either terminate with error message or be prepared to wo= rk 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 that = probably was missing - more descriptive error message.=20 > local_port_conf.rx_adv_conf.rss_conf.rss_hf &=3D > dev_info.flow_type_rss_offloads; >=20 > -- > 2.25.1