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 F07F3A0561; Thu, 4 Mar 2021 11:00:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7638640693; Thu, 4 Mar 2021 11:00:56 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mails.dpdk.org (Postfix) with ESMTP id 5BE0940684 for ; Thu, 4 Mar 2021 11:00:55 +0100 (CET) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Mar 2021 02:00:54 -0800 Received: from HQMAIL107.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 04 Mar 2021 02:00:54 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 04 Mar 2021 02:00:54 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Mar 2021 10:00:54 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Mar 2021 10:00:39 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 4 Mar 2021 10:00:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvfFV3VijQe4c9fiYUucVShoWLKpG40B6nLaVfxdHtGgHx090fvIdP5ztBsMVcm+l47TXu3mjg4zGcx+0oJ1TQ6S6maWIkEzftnVbD0N2/Z0t5+7a7LvCWCYDGV+hK3QNVXEmUFm4kI8g++gPqVVuWMRlu3BybTFt2WhGYmUeJHdhmuVLJPYlhIhn+CBDSYXekjBZuyom9yu8pUD8/vA0hB6vW0xVi3Tgh8ieFN0b68rsWmRXlmlqMVg4U4cueuN+Xf0KwnstFNvBy+fmWHVP/05znha6uQcj5z7+a5+mHYC/jfEa4tAJW3YOHHvbBDh7GueA/07rycSx+w8xBaBFA== 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=0oxwqFjSYKBdG2oyo2iq01yMlagD+oS0uBD032h3vVo=; b=bwcXw4/7IfgtMrnSvPaAmV1zLfeqkJy5B24gCRXEuHV0iLDI/0kuZ03D3Xe79Pa2YHMnBXoKrEv0PqlD2q0D49Y75tEOtpIS228et3XAhQf/JlUVS2VAoEJKCKMR3B2Ttm5d9VnKdWHtEkBlQazHXo9oCOS1qdft1wMovKcdbmKOB+GXAOgiwWQpeOrjCVHqo9Ncqz3XqI80Xlymm/hEF+IMmqqkA84/iz4thBqBDTN1iJ3sAxh935He84gKaM75rCBWkwKvCXdqHqFW2hTS4HujdR2TKCRIQ5kCWv4VLxR4iPdUPDtvsK79hHpoSwmQ43ef6ErDVWqazkOcqfRpmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Thu, 4 Mar 2021 10:00:38 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308%7]) with mapi id 15.20.3912.021; Thu, 4 Mar 2021 10:00:38 +0000 From: Ori Kam To: NBU-Contact-Thomas Monjalon CC: Slava Ovsiienko , "ferruh.yigit@intel.com" , Andrew Rybchenko , "dev@dpdk.org" , "ajit.khaparde@broadcom.com" , "jerinj@marvell.com" Thread-Topic: [dpdk-dev] [RFC] ethdev: add sanity packet checks Thread-Index: AQHXDgrGaABS+2Q53EeIxjHe/6avDqpuAH0AgARgq6A= Date: Thu, 4 Mar 2021 10:00:38 +0000 Message-ID: References: <1614541699-99345-1-git-send-email-orika@nvidia.com> <1769565.OWqOAu9aEJ@thomas> In-Reply-To: <1769565.OWqOAu9aEJ@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.145.126] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd0f0477-ffc7-4e31-9426-08d8def45d21 x-ms-traffictypediagnostic: DM6PR12MB4987: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:2657; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VkWEdn7eT8LQ3H7uRhPEwSKjOoqyXUQ30s+up8ISmr2olUbSTiG06YuBcCXbiOMMOpr2v47Kl1DKuY6ZBmxKD8K1DhRibSKBGcGnV99RYC9NbKUsx0gq8tPWkAPg7mBzLrnX99mgrm7tQ/6wcKd1sG4sIgFy+BbcP+4xI4yiCSmr0qzaearHDIZ/K5WxVqQVkCvS1wJmWdGOMx9bxAlYjyo8IRKudGfU8s01+5cIHs1W8SUYEwAVij3lmTq5LsHJl3Qj6PS8LkSHRXycsZRkcgUP6000wuOTZFlQ+DLpKqHi/frvZHAnY0qbSxJZ0WlHsGBKpVZBHBMCqF96IndrautNqtneHxVWeFSt/fXtp2247PEyuRF72SDChxZTyyjOYRvUizPhFg7D8RaACBCQmSdFT9Xg0wU12K82bkJJdup9MLvUqEkvxE0RLBLdOIcaTYwgHorKpcB3oYNnFpuzyrMO7h3dAvcJmgMXvoxFQx64kxlyR4jdQFtj+7nqSEbV0i/dE1lLREYcIhhCz0pupQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(136003)(346002)(39860400002)(366004)(6916009)(2906002)(5660300002)(478600001)(186003)(316002)(83380400001)(54906003)(26005)(71200400001)(4326008)(8936002)(76116006)(7696005)(9686003)(55016002)(66476007)(86362001)(66556008)(66946007)(6506007)(8676002)(66446008)(64756008)(52536014)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?09tD64yk162io2+2t3BUtL14GBwqzPBNwoAXrQNimf09TzO7Lu52TJnEml4e?= =?us-ascii?Q?0bHzJY8qCalByIsijeL1hMIlwx90NXmTpYcDU/eOx4L8cBs1PPEuJQBYur/4?= =?us-ascii?Q?8XnDPQ2FQ+s3C+XWITi8MJ8SEqrqaanRBpQrGaoY2nV9/ijNQ+8Jcrvs4QVa?= =?us-ascii?Q?q0eY3/2Zb7eAixOxvjuJ6DemRQ9S5k/X24naUUue/RKQZwrMWJcpx1UpaRjQ?= =?us-ascii?Q?WUjRdxwa5SRqfOc9Ud2xj+4BdmqpVVFCMvzwxfZp9SF/Kd4vxxCTKOrm17W4?= =?us-ascii?Q?3TqULfIlOEbVPul+i0AtWMqOgqFA8uBSiZukfs1+19CklPd/k8qRS/j7T3aM?= =?us-ascii?Q?kAMIOB3M8dxrlc1hIka/acJ0adJUYsEhKQ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us-ascii?Q?/DMPJwv995WTsOr5OKaQLRDHAzbWH3WAyEaN9AIvSlsfSPQvo/uCViv2RGQS?= =?us-ascii?Q?0fRZ931KXklGff6azpUbKaDf?= 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: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd0f0477-ffc7-4e31-9426-08d8def45d21 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2021 10:00:38.7244 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: U8Ywcv/S2IFv7ZmJt4WtDHnmA2+F5qVZt9aUwOC3xCdTsteYh3i46BwNOOQWZBOJa9gSmOcPeLJNsTcrfbBGQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4987 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614852054; bh=0oxwqFjSYKBdG2oyo2iq01yMlagD+oS0uBD032h3vVo=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs:x-header: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=L727sIPNUsBgvJAu9BQlrfzZ8XL1/94V2YC5fhMU77RhEtBUAaIp8ViIwNkIuwpiq uxiJdCxBPBpwa+qHzVhlhtFhmbh2P9del03WNejbO2LT16r+kGkx4I1p2VXDp2mLE2 43XEHrxuSY+XJI1qmm6djEopl9k+vNz1IwTN3G9PofaoGnHzTZtaEkMpwkNHq30dg2 qsHzLNZe+aYpfejFLrhnusTwl2TnJNMMjpTkF2pgRfJZHUoYNaoN0bJrtG+rck9s42 WK+GiBLywy23PkS2NB1intZT09nJ8QbLIT/rXZHnWfUWeKmiX36DcdTWPu7QekBi7C +FxmqEP4IQs2g== Subject: Re: [dpdk-dev] [RFC] ethdev: add sanity packet checks 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" Hi=20 PSB > -----Original Message----- > From: dev On Behalf Of Thomas Monjalon > Sent: Sunday, February 28, 2021 10:14 PM >=20 > 28/02/2021 20:48, Ori Kam: > > Currently, DPDK application can offload the checksum check, > > and report it in the mbuf. > > > > However, this approach doesn't work if the traffic > > is offloaded and should not arrive to the application. > > > > This commit introduces rte flow item that enables >=20 > s/rte flow/rte_flow/ >=20 Sure > > matching on the checksum of the L3 and L4 layers, > > in addition to other checks that can determine if > > the packet is valid. > > some of those tests can be packet len, data len, > > unsupported flags, and so on. > > > > The full check is HW dependent. >=20 > What is the "full check"? > How much it is HW dependent? >=20 This also relates to your other comments, Each HW may run different set of checks on the packet, for example one PMD can just check the tcp flags while a different PMD will also check the option. >=20 > > + * RTE_FLOW_ITEM_TYPE_SANITY_CHECKS > > + * > > + * Enable matching on packet validity based on HW checks for the L3 an= d L4 > > + * layers. > > + */ > > +struct rte_flow_item_sanity_checks { > > + uint32_t level; > > + /**< Packet encapsulation level the item should apply to. > > + * @see rte_flow_action_rss > > + */ > > +RTE_STD_C11 > > + union { > > + struct { >=20 > Why there is no L2 check? >=20 Our HW doesn't support it. If other HW support it, it should be added. > > + uint32_t l3_ok:1; > > + /**< L3 layer is valid after passing all HW checking. */ > > + uint32_t l4_ok:1; > > + /**< L4 layer is valid after passing all HW checking. */ >=20 > l3_ok and l4_ok looks vague. > What does it cover exactly? >=20 It depends on the HW in question. In our case it checks in case of L3 the header len, and the version. For L4 checking the len. > > + uint32_t l3_ok_csum:1; > > + /**< L3 layer checksum is valid. */ > > + uint32_t l4_ok_csum:1; > > + /**< L4 layer checksum is valid. */ > > + uint32_t reserved:28; > > + }; > > + uint32_t value; > > + }; > > +}; >=20 >=20 Best, Ori