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 B4FF4A0567; Tue, 9 Mar 2021 16:08:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B7714069D; Tue, 9 Mar 2021 16:08:17 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by mails.dpdk.org (Postfix) with ESMTP id D1F7B4068A for ; Tue, 9 Mar 2021 16:08:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z01dzDqrPphkOaWriZzF2GvtRwGl525t6wK0IdYCbVhtHAW9JixiRKs5S0/mPivMh20pF7rsSmcxf4uApI6rufCzYxJdrEh0q/2KuI52Xy8XrAf0ZWNjKNMpTiMUlCi0p0Zi/aQR3p8427aS3mi+DCkdIoens333wETo1BmZ/WRkJkj2VvQE+7IFy3yX5PtAF1EhfuZo+oKTa7t4T57KwDfOIzLUVweJtJZRNyx8FPeWTA6/9SlgrPMV7kR8gmJskaquyjspGql6aqmdXtEAOh+4hSYiDFsYasD0k/zjBVFBwL8/LsSKvG4DB8aCCXjygwCWrmkBr+FV2skTIaFoMA== 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=OSeGC12E4cF2eDz41pUOwrkbN002zvp9A+gMPdIiJKs=; b=nDSBkOQktQqw6pd3bEUXHBC2DJQEUYdkc7qkrxfI360Vl3dehgBjGG9J96dsCXH4HSsV2cktI0IjFjVCanMuZldvjoBF+KfhM0ZM2qS0pddwpbbyn0MGkweZV3dOCGPmWxY97AMXiH7Yh5tiHZWyNsZAptwG8OqYkW7W/GJ6vFNpY2bSqfNoPIJ5i0AdpBYb+o82JuTSM/TeG0qesN+FFoEyrd0F27Z+rVzJWMVl7ISRo5Fe7gtipf3P/Hy3V6uvxa8XNpgxW2yw1s1vCoNK+kn0YH+w5KUoPBJuMuJ5pvCXivvy4t4X70MubQ97F5XTpjsI0RJ9/uD6Y4PZMiwTQQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OSeGC12E4cF2eDz41pUOwrkbN002zvp9A+gMPdIiJKs=; b=TSmfYEDAsHeEIVk9PMDozTc7kXIGiOn8/9LUOYx+m0qAy1qcJDJtMOYbIwmy1QvIXTSgOrPZjXnRR9AK3GgzJVYkOSVFbxp+F5v/oIi0fgvaYJpUpDpcbc+Gd3xTUq4vYjJUxpoiAYFPVFill+HnI0yUCwWZooqnKG/yIRTmuHY/kMAeJV8m4rGe2w3cqm2HhlHRVkBZjMEoregNWXhQII9hlo+Ee/l2peKZ8O+Svp7jZZ4N42hTvwRW8gTiTiPUgjr34tIGcpMVUfqs2hoedvMepoMu7502Ra10tXfHzUJW2qJ5soyb+UJc3W5/ZXRAHFslCvp6Cw6Q0oIkDZxYKg== Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB4530.namprd12.prod.outlook.com (2603:10b6:5:2aa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Tue, 9 Mar 2021 15:08:14 +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.030; Tue, 9 Mar 2021 15:08:14 +0000 From: Ori Kam To: NBU-Contact-Thomas Monjalon , Andrew Rybchenko CC: Slava Ovsiienko , "ferruh.yigit@intel.com" , "dev@dpdk.org" , "ajit.khaparde@broadcom.com" , "olivier.matz@6wind.com" , "jerinj@marvell.com" Thread-Topic: [dpdk-dev] [RFC] ethdev: add sanity packet checks Thread-Index: AQHXDgrGaABS+2Q53EeIxjHe/6avDqp7aZOAgAACm4CAAF/r0A== Date: Tue, 9 Mar 2021 15:08:13 +0000 Message-ID: References: <1614541699-99345-1-git-send-email-orika@nvidia.com> <9e1388ac-27f7-aa1b-19e8-6acb6dfc3498@oktetlabs.ru> <6096492.0E5FNQikke@thomas> In-Reply-To: <6096492.0E5FNQikke@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: 1c01fe20-1167-449c-77cc-08d8e30d2951 x-ms-traffictypediagnostic: DM6PR12MB4530: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:751; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gEc/CGZ4WRH26ozREMJGmnq9/yRqsU4BsApVSS23UeRUWnT93RwN1bbH+6m3C+hb88Jh0Ni7JmrMSob4Mzr3hmhQi9Ky2Y+sMYMxvmF8j2hQBF7ZV9ZrxQ+664O4n4UM7yrDlEYLNYV5ilg8eukBEBzfhuMB1V8rIn6RPC7/ZYEvdNgV0l/YTGB9Uhswt20zKoFIzc+DzuzN0YYnN8QMqpH/9oMAH90n9grCDpSzaRDNGImiH1nhR7tOv5uZ2GAIvDUQMQ4zhKR/RDtxLCpilvMx9xO4tQZ1e4rVR8plhcg4076PX5izb/ZUUlXTsKU/hKa5vSH5rLWbGwTYvNAvlRJ64KF4aZixaialsdNuH9Uf6CSPSbRVFOr86yd2x57r+pztv0rit/t8TuKRna8/tnLvBMIausj3OqfFeIBWAOa8Qzvt4NqknkshxB2nMRMbbe5+t+U/zHAURWgl9IQnTfBmayUTv11z/3FXuTO198X4pZumOsijU0x1uwsdUkNpNajpunLno71akrpKtRdlzQ== 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)(366004)(346002)(376002)(136003)(39860400002)(396003)(6506007)(55016002)(478600001)(186003)(53546011)(9686003)(66446008)(110136005)(54906003)(5660300002)(52536014)(26005)(7696005)(83380400001)(66556008)(86362001)(33656002)(64756008)(76116006)(316002)(66946007)(66476007)(8936002)(71200400001)(4326008)(8676002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?AbPbHn62Odlj9jWyoRqY7sei/6aBBf6YYjkHp2OrQTk4owOAvFQ1nD/ADG+i?= =?us-ascii?Q?UxO6p1Kgi26bqIK5tJd2LFKB/og2Q+MifgbNaEyK/W06LCZquFIyREkiMguM?= =?us-ascii?Q?F/fOoQPCBVsyiUplLUsoWqG9l/Gq9C2oHLTCAcl9Etfcy74SdUEB0U276CSF?= =?us-ascii?Q?BKOagRl/lWD/HaR+z8maNf/mifO+9fkoexk4w1SzLRH/4Q6GIxGmz3Chf8wg?= =?us-ascii?Q?ZnhFcZo2ds8O+FIoHYREidUfxa2jMHLSyjWTcG8h05+RgXyW+uIcaX2f8tak?= =?us-ascii?Q?xCGrL8878GRPkiiNkQYZLhj9l1pDFask0fw4Oe4xX0Y5NE5kPlSvG1bTnFC7?= =?us-ascii?Q?H10H/I8vDiDIH7glKJA+bhrueLijha1ruy+cTI8kr5v0BaU3EuVpe7Lrs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+Nz4kQ8GC19ZLdnnSdYt987X?= =?us-ascii?Q?k0/dBP0iumLILtFFRluEi7HH?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c01fe20-1167-449c-77cc-08d8e30d2951 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2021 15:08:13.9140 (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: /Lt0spVCU6uRWxhhR0yxJ4umrEFdFDkND9yrUjjMXO/ZL2WOK9LOiWy0W2+tdBo//oN/VRPVkDhVQKzU8wQGUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4530 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 > -----Original Message----- > From: dev On Behalf Of Thomas Monjalon > Sent: Tuesday, March 9, 2021 11:11 AM > Subject: Re: [dpdk-dev] [RFC] ethdev: add sanity packet checks >=20 > 09/03/2021 10:01, Andrew Rybchenko: > > On 2/28/21 10:48 PM, Ori Kam wrote: > > > 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 > > > 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. > > > > > > Signed-off-by: Ori Kam > > > > In general, I strongly dislike the approach. If such checks are require= d, > > it must be done per item basis. I.e. we should add non-header boolean > > flags to IPv4, TCP, UDP etc items. E.g. > > > > struct rte_flow_item_ipv4 { > > struct rte_ipv4_hdr hdr; /**< IPv4 header definition. */ > > bool hdr_checksum_valid; > > }; > > > > Also it will allow to filter by packets with invalid checksum as well a= nd > > redirect to dedicated Rx path or drop and/or count etc. >=20 > +1 >=20 I'm not sure I understand your comment, also according to the proposed RFC we can redirect to the correct path. > I think the only drawback of this solution is for HW giving a global > check status without knowing which header is valid or invalid. >=20 Like Thomas remark the main drawback with adding the valid to each of the items is that, it forces the application to have detected rule per each type, which will make the SW logic more complex. Also this may have performance impact on the packets and on the number of flows.