From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B172BA04B1; Mon, 23 Nov 2020 08:54:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 00D5037AF; Mon, 23 Nov 2020 08:54:34 +0100 (CET) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id 97AE0C8C6 for ; Mon, 23 Nov 2020 08:54:30 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 22 Nov 2020 23:54:31 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Nov 2020 07:54:28 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.105) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 23 Nov 2020 07:54:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCqICTaVbjpAKlw7rg9NyjjeUEP5bzCrLjdmPUiTDjuc2QluAlJnDYzVNi7rtyS3lM2ryk4waFQvlzPuQH5UEz51dtjuvWUqXGLvVrsNjTyrRvhFk1Q8vl8EEGdVIb608nuszsjjwrDt1tiOV/uFAYBvyRwMHWrj9I5IsMeOxMj2F3FoerwLPzN1+mTHk1iATGOM87CC/46firbw76uHepfj+EvDsgfh2d5JXe4hWc4fgWLVek/8heLJxIpjYlQrpx9RaISieZocw8YQaaPgM97HBEpBDTQ7Mpe/YFtQhqgq9KPEx67zLFvkVHdd34GWcW4q5lj+2vfyfxMwf+y0zg== 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=SZGl8vMbRdA/k9NXFtqFn7QuIVNHtqIdZDRdmmLnbrQ=; b=Xaq6flDQ2Tktlvo6Td1qGOgTKX7SzVoSY1rZ4yib7i3GRW7IpeG2uNgBnxr/VRlsrN2BqYwJxbXJwCI9sXP/hl6kmC1qzQHn4PsScS+87QNJdCQIDXaqKHP0/Xu6H0yeAbT4h/ggKuDGx9g2ltTjH9Miv6PD1X/JpTRuufoSSh+4JEDK4bP55zhfxf+xkLpw4VJxc860OD81+BSPj+fP55VYjUQuth2TDoQe4AEGFxlDwjnFc3E8s9dTMY9au24u4NW9J9Nokjd8MhvKiYPVCo+i7Sy+1FOn1P/OWZFuk3w34duEFpg+eKvkWYacdKPfoY6HJPYhBBCFS58fjnCpGg== 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 DM5PR1201MB0218.namprd12.prod.outlook.com (2603:10b6:4:4d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.28; Mon, 23 Nov 2020 07:54:27 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::c186:ea33:d319:68a]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::c186:ea33:d319:68a%5]) with mapi id 15.20.3589.030; Mon, 23 Nov 2020 07:54:27 +0000 From: Ori Kam To: Matan Azrad , NBU-Contact-Thomas Monjalon , Slava Ovsiienko CC: "dev@dpdk.org" , Jack Min , Ori Kam , Suanming Mou , Asaf Penso Thread-Topic: [dpdk-dev] [PATCH 1/5] net/mlx5: fix protocol size for raw encap judgement Thread-Index: AQHWwOTGVnsBa3s8X0++lJRd0eCT6qnUUIgAgAEG/LA= Date: Mon, 23 Nov 2020 07:54:27 +0000 Message-ID: References: <493405ea9f0f86ef8e0cfa08cab0d5ae764ae8be.1605493464.git.jackmin@nvidia.com> <2669658.zoTC9YsCJE@thomas> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 19413acd-b11d-487e-bc39-08d88f85005c x-ms-traffictypediagnostic: DM5PR1201MB0218: 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:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u9PLSYNoJOAndsYkh4dIwb2vLWYjAOt5iiLRZsqOXYNSZ9hwwYdlDA/e6MYH/+y+lJvHSqjbLGrtr+TbQ7uWI0uP9rgRjGIvIfVKk6CG4G3OV/H/WAbxJWxMd5FiWBOMdFcDjAct3WdZuqX1uqkk+viDGgXMljBdnQCubyTwLdfPbqbYOQ3RtefXLP3Ym3iuaWueoLdaBDfdgrkg4gsD7lkZo4V6b/sAwFad7A0fquD8oIYxX9iIDI8J4wpYR1cRaIULesVWBUI82wQzcOUStAPGe3BQ3sE2EcN7EJDl0PYAcUe+paa1JBhnu+Fs/Rhv 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)(396003)(39860400002)(346002)(136003)(376002)(110136005)(6636002)(83380400001)(55016002)(9686003)(316002)(107886003)(86362001)(54906003)(8676002)(66556008)(33656002)(66946007)(76116006)(478600001)(71200400001)(4326008)(66476007)(5660300002)(8936002)(66446008)(52536014)(2906002)(26005)(6506007)(53546011)(7696005)(64756008)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: iU6/abjBQc+cEhfA7nQr1HoZ3dZgxGzUDm9QMxvoZkTxyE3cMvKBJKMFGhdKKEbrSvG0Owoo3BWTpIpcKgzeM6dRbSq/lLOXJKH0+51yK5dwwhcX/6opdSsu4Z7bD5ZuWKF4YtXuElgX1HW6MV8TL/GjtSeABD+51rGt4pPF8Juy5j0f3Ejk2Q1qDUn/xWpBAA57zt/YyAuZ1nrlEaGlFXBuGuj4Ob9aQj3w6hQok4mCeMSINBIgQLEthyjNZH0+fXaWV58fpC1oCa1gLgLHRdqR3W5c/uCS77TcsVNINoGZgMmw1SzWL+cJoqJUR151OdlAiUSFQUz/DMpj3RoUuYRO7GWpEX1KPzmDmYNW6X2iHqk2rpUYdOcR724n61PrusZLOxbGaDtJ7jq1Ojf/zej5rWRI9JVHrjQgLSTh57WPG/OVbikl4Fu4NVAucIeAHoWUNPVOpipd/iXoqeNo1sK2rl9M6lYfsuNtZaSU8xDGSw+4/Rrs8IkknqP2Iz4q3CrUR5OD8bt4sEmHoJ9MFWd47z/9SnG9c6miRBXVZ1uyorzKJFbjhI93Rjvp8ixj1UuOyDZrm48F9BKvjq6l+jkYwys5brG/WNm0CSKGi1jOJ3xmi9Zma7xcw/sccphIHIcwN8kU/X7CI0YewYb8hF8NbOyTpTliI4LHE/IXIV0YLqbsXLFFIKonMQKjC70edck+B6bxXtO6jwoLyWf1Nxrym1Ldq2QwbvEzA3EEJ1k8DeNPpkdtfU+ZsezUvghYwyx+I9uT9tRpGy6EBbvhYp4D3aBlT+OPTcRpGuP7Myoi53qyWxOqmqvaFnOQl7M4gZl8AiF1g21ZhSHyWWQWAtfKqcqUdpJi/ZA+XzRpVjEsXn5MjOr7txczGS/CtCZW73xGWjZSlZGtCiaTZZVoRg== 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: 19413acd-b11d-487e-bc39-08d88f85005c X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2020 07:54:27.0596 (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: Iv+nsR+VtNKSTImwwR9m3y7S0YamtWCaWQDc0hvmiD4oQAzVkmyXeecb+F59AFkVB4WZ9JfoW75uPIM+exSC9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0218 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606118071; bh=SZGl8vMbRdA/k9NXFtqFn7QuIVNHtqIdZDRdmmLnbrQ=; h=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-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=moSW6k/zdiAYmxRyT+NyqZt+fKNJBJbFDPngOrewficCKZFUklOeOnFSMOVae5zQ+ 58Z5kpu/buY9Y8UTjDjJUCORV/boFic3ioUpwgQxlwQcNJyZz/PVMtcBvfY9vQ2jYl V77AXfIdy+GEacTeFiT7X4j+HGwja6ZHJZ6lFm4B3Fy8zo1I77XgfmdMWwLg7zGq9Z 4vYSBylUfMTYY2+Mq+jomV3/40VzBOyRKxSAW9pqRlFRaIwISjnj0m/a8Tro752rCb 7U3vfCDpz090eydPI8EKogQbJNndPEQI5wGUCLS8H1Yy0A9zWQ4R/AX+1b9uzkqX1Z ehxPpl5eDLmhw== Subject: Re: [dpdk-dev] [PATCH 1/5] net/mlx5: fix protocol size for raw encap judgement X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Matan Azrad > Sent: Sunday, November 22, 2020 6:05 PM > Subject: RE: [dpdk-dev] [PATCH 1/5] net/mlx5: fix protocol size for raw e= ncap > judgement >=20 >=20 >=20 > From: Thomas Monjalon >=20 > > 16/11/2020 08:55, Xiaoyu Min: > > > From: Xiaoyu Min > > > > > > The rte_flow_item_eth and rte_flow_item_vlan items are refined. > > > The structs do not exactly represent the packet bits captured on the > > > wire anymore. > > > Should use real header instead of the whole struct. > > > > > > Replace the rte_flow_item_* with the existing corresponding rte_*_hdr= . > > > > > > Fixes: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLA= N > > > items") > > > > > > Signed-off-by: Xiaoyu Min > > > --- > > > drivers/net/mlx5/mlx5_flow.c | 12 ++++++------ > > > drivers/net/mlx5/mlx5_flow.h | 4 ++-- > > > 2 files changed, 8 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > > b/drivers/net/mlx5/mlx5_flow.c index 324349ed19..34b7a2f137 100644 > > > --- a/drivers/net/mlx5/mlx5_flow.c > > > +++ b/drivers/net/mlx5/mlx5_flow.c > > > @@ -3655,8 +3655,8 @@ flow_check_hairpin_split(struct rte_eth_dev > *dev, > > > case RTE_FLOW_ACTION_TYPE_RAW_ENCAP: > > > raw_encap =3D actions->conf; > > > if (raw_encap->size > > > > - (sizeof(struct rte_flow_item_eth) + > > > - sizeof(struct rte_flow_item_ipv4))) > > > + (sizeof(struct rte_ether_hdr) + > > > + sizeof(struct rte_ipv4_hdr))) > > > split++; > > > action_n++; > > > break; > > > @@ -4092,8 +4092,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, > > > case RTE_FLOW_ACTION_TYPE_RAW_ENCAP: > > > raw_encap =3D actions->conf; > > > if (raw_encap->size > > > > - (sizeof(struct rte_flow_item_eth) + > > > - sizeof(struct rte_flow_item_ipv4))) { > > > + (sizeof(struct rte_ether_hdr) + > > > + sizeof(struct rte_ipv4_hdr))) { > > > memcpy(actions_tx, actions, > > > sizeof(struct rte_flow_action)); > > > actions_tx++; @@ -4107,8 +4107,8 @@ > > > flow_hairpin_split(struct rte_eth_dev *dev, > > > case RTE_FLOW_ACTION_TYPE_RAW_DECAP: > > > raw_decap =3D actions->conf; > > > if (raw_decap->size < > > > - (sizeof(struct rte_flow_item_eth) + > > > - sizeof(struct rte_flow_item_ipv4))) { > > > + (sizeof(struct rte_ether_hdr) + > > > + sizeof(struct rte_ipv4_hdr))) { > > > memcpy(actions_tx, actions, > > > sizeof(struct rte_flow_action)); > > > actions_tx++; diff --git > > > a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index > > > 5fac8672fc..3b28c48a1d 100644 > > > --- a/drivers/net/mlx5/mlx5_flow.h > > > +++ b/drivers/net/mlx5/mlx5_flow.h > > > @@ -345,8 +345,8 @@ enum mlx5_feature_name { #define > > > MLX5_GENEVE_OPT_LEN_0 14 #define MLX5_GENEVE_OPT_LEN_1 63 > > > > > > -#define MLX5_ENCAPSULATION_DECISION_SIZE (sizeof(struct > > rte_flow_item_eth) + \ > > > - sizeof(struct rte_flow_item_i= pv4)) > > > +#define MLX5_ENCAPSULATION_DECISION_SIZE (sizeof(struct > > rte_ether_hdr) + \ > > > + sizeof(struct rte_ipv4_hdr)) > > > > This constant should be used above in hairpin functions. > > Will change while merging. >=20 > +1 >=20 Why above the hairpin functions? This is correct for all encap decisions. Best, Ori