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 65431A04B1; Sun, 22 Nov 2020 17:04:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D2006CC6; Sun, 22 Nov 2020 17:04:38 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id AF30AFFA for ; Sun, 22 Nov 2020 17:04:35 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 22 Nov 2020 08:04:39 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 22 Nov 2020 16:04:32 +0000 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.50) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 22 Nov 2020 16:04:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KvppMj9v4WbjR+zHakeon69eKmjRgxSyJ6It46yD3Zagg3asEcbx0PhACwfuo4Xj8xTnI542LA7paQnfjV3Q/F2q3E2N7o0qyaYMic/XqEIQhkul2bj4Yn4SMT4m2MZUeiSSBHIEKPlv7oaI3sKibbm+SzMkpYIGjZZjdjhS8G5U53U3MCf53Qf7T1DP3XwwakTnOcEoqkzQlppxTOYkRG5ynHQphrmMGLZe15HC0e0BDKev5Fc3V5tsuMBwdiCCUybULAr//1CQT7AyaYlh0vLGVHt7dcS3/kEjwtHkqvV1jLQTFOdW1cYCoQBZcWE5Yn/EFV+FJt7wcsVu+3kCag== 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=BgYBR0env2OJk0tG91rkODvnH/JbuC+luecnt/ehY3Q=; b=CejHzL/kqv8y8ejz1c7jQjKmn3yinpH0EdUPXczP64YRuiXpeeDwkIghOLbVzdrzMzGc9TeNV/V9uujJDvLNeeuIc8Q8zuuBDvzfl9oB+b2AjIVXsJFx4tTVpYhNDdrjAZPsJGc+Zp0yIXPj5H5bz62dNMiWhYZU+rPJLJl4xMIbkYUHpBo4mm6JdlTtq+qWUxUZXfUPvqiwWdXJheGITo0iLYfIE+xLTWdTxPddIuFh22DleW2jvMQf7Yyl4jZfOmbG6lXDb0g0vmB9rDFF1RPZfnQRezaK2THHYqGKFbPWaXJsJNHXNRCf4p4HZKo6ImaRzfeydWZoH6dpo4BHmg== 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 MW2PR12MB2492.namprd12.prod.outlook.com (2603:10b6:907:8::19) by MW3PR12MB4476.namprd12.prod.outlook.com (2603:10b6:303:2d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.21; Sun, 22 Nov 2020 16:04:30 +0000 Received: from MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::2c59:3e5e:2b21:d20e]) by MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::2c59:3e5e:2b21:d20e%7]) with mapi id 15.20.3589.022; Sun, 22 Nov 2020 16:04:30 +0000 From: Matan Azrad To: NBU-Contact-Thomas Monjalon , Slava Ovsiienko CC: "dev@dpdk.org" , Xiaoyu Min , "orika@mellanox.com" , Suanming Mou , Asaf Penso Thread-Topic: [dpdk-dev] [PATCH 1/5] net/mlx5: fix protocol size for raw encap judgement Thread-Index: AQHWu+34PzFVIZP87EixS92biOSq7anUUZ6AgAAIthA= Date: Sun, 22 Nov 2020 16:04:30 +0000 Message-ID: References: <493405ea9f0f86ef8e0cfa08cab0d5ae764ae8be.1605493464.git.jackmin@nvidia.com> <2669658.zoTC9YsCJE@thomas> In-Reply-To: <2669658.zoTC9YsCJE@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: [77.126.110.58] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8feab3d7-0d31-43eb-65a2-08d88f004be0 x-ms-traffictypediagnostic: MW3PR12MB4476: 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: YL80CGIEAFBGOFfIjk9tS4Iu/XE+r9P5g6eik0/BxX411uS7vW+/uuaO5B3mAxTLb0vuRrPjdfS8VOLJeTXTpA3jeWVFaZkLYy11/gJ96oXVV0U2zvNKr+MB94LIoYM/ScAgw76778fbAcXLayUlVHYvQlTqLRZ/rnqk/hIOD0XQaTkNWDHJmCr1vWOlSgjHamfSTwLPNDrAaL9VxYz115X6nuHi8s+dddeOD2gBeiFKs75YgFTBqT1UQ15TUSdB534pYkRSuaiwoSsMJv0jQZPwMsWXnBELvxbe6txgDvVcXRn5/+r/SmiU345tN7E/ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2492.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(346002)(39860400002)(376002)(83380400001)(2906002)(71200400001)(8676002)(76116006)(66556008)(66446008)(8936002)(64756008)(478600001)(316002)(66946007)(66476007)(52536014)(54906003)(7696005)(4326008)(5660300002)(107886003)(33656002)(6636002)(86362001)(6506007)(26005)(186003)(9686003)(110136005)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: Hy63bxIUfTId16YKEM3Si8nWSnm3dTv51CkICE8HLEd0RtCFuaVAnPnr8r7BPyaJP51ksos1caSMj34PcXNR7YbsWfIupBQGNu4avecwJBFyPUI8LDpzO9XWDKD8048WqhdXX2Y5wPu/mjEna2lR8p924WReaVXhNfwORKTLMU3UYYYRy3ziRQ3gudaG5PKThE+7Q/S7/6W5AXsy9b/wrfApKTVyzzuth216dBXJ5zEBGoUOMrLMLe1t9e/qr+f04tBfLwH7fqihtSwjXAP8Z+dd26yOvH+yD0VlqVuU+G/WhRJ3Qj7AWaiXhfNyrD1rknEQFyjtqnt2/bph4d4d52Xx5qENX1YB7wy+H7HTdWYlrYH1NV6Ho0qiTFmqtKe/AeS3nCEUTZXGcZL7iJNM7+mafeDcuh+7owb3OHmdCQ8yOvE9pcF6+iVqSk4q/rivszJAJjebl1h9tGpXlX8rtMPjaNaK9UCpqZzkEYrvN4/Ll5vYrXR+C7NUeDWmnwFilKlDugUqjExWGK6iYzq2BnzQLboFXp+J8Vud4XOyZoslO+cYU+l7DqZIcT58mNQmsdxjXD/k1We2GYYQklQJAi+QvsB8xeOSz/dqUDXjoIZboobK0lW3XhZFDX15LF4JgUBjlg6a+UL1uybdJof16m30JbpBVt/r3dz28/ikU2h3QZZ7om/suuIVLrTX3t43zmhjQJw/O3cMnYcEigpUa+mWhhHYbC4F5YXMbiXWd4jVHiu82ee415kIv6ger2I9m7CkHyp9SUqNAgGPKSEUh15DzISgHizOOFrRheJuJn8Xk3hL6qMdV44OkPQN9zqSEvDJKc5MMdBFzmAh3UEamMqFqwc9wD4bPzQvUFvc9EC2HuQZGvT0eWH0d9LFw2FT7RBRsKa5Pg+RKNGqEn3Nxw== 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: MW2PR12MB2492.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8feab3d7-0d31-43eb-65a2-08d88f004be0 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Nov 2020 16:04:30.7485 (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: KiW3pThZZGX/Ll+1v8HyFAkrqa6ArQkfbIp+Z0cJMF4Dy7MBTGnVosYeJd0JSfFmGP3XnvgrlpNkidjPsNkedw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4476 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606061079; bh=BgYBR0env2OJk0tG91rkODvnH/JbuC+luecnt/ehY3Q=; 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=rUNQBAsL7p5b522rwdOAs3shtqCBxIhmclLVKkrTjJrZCMCU4gjJOpmwTa18N4PcM G9gSzbnw7p7mWmXeEYx/EqHNh2ewUsll/GbtXy5hWp+1gocRZhUZJpmhXm0sYk/XWV ud/TZ2nqx0mQP6pCbIpqMQ2DUqFYI+wvZ6BeiGMqb+DKf+lQLehMGF87LLYDB0tH7n pX3dWugupavGyVhOZohrY1CrPgHaM+0zkdbTWZhghAaIo2W9AngLaFbX3bMqoeQDMX +ASaOuwotTsLy0BjGOGn1++wuHbf2poIcJFa44gnQ7/jgFC/+5KEg+3ve87KJYRAMv LC8XNdrKM+ggA== 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" 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 VLAN > > 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_ipv= 4)) > > +#define MLX5_ENCAPSULATION_DECISION_SIZE (sizeof(struct > rte_ether_hdr) + \ > > + sizeof(struct rte_ipv4_hdr)) >=20 > This constant should be used above in hairpin functions. > Will change while merging. +1 =20