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 039A1A04B1; Mon, 23 Nov 2020 09:13:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 92C7D37AF; Mon, 23 Nov 2020 09:12:58 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 32478375B for ; Mon, 23 Nov 2020 09:12:56 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 858125C009C; Mon, 23 Nov 2020 03:12:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 23 Nov 2020 03:12:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= 877KKFJnt92OHOjhQOza7plmsJ8WwB/EtQojs2oEyG8=; b=VwpQEZT2iSMdnG/w 7iA9WsmP/2p+kOwJSSSBEiYKHLe+Kh9vvoqa+8/ujducqJjTMt+gz3z31ljfD1Eg broofVc9G/v0gfqqqhTgbIPZq/Kfqwkh6SAklIRUPvQH/iE5xXTI2r0EB19/T1VH tWpRw8E0pM+CJRvTAmj4VGSmUOwVx9MgADIf6CWI55GHAVuE9bBxxUtYRigUZO0U Ep2npRLF9RxAtHSbt2wI/WpDa+vy5BRGlEZbjJxha5VPVFfGpUj2ao9V+PbYeHuw 3pYV9OqJKmTLzZ3KlivDf5TLKsPtVNddlBc2swj0F/qpwC5Nyc5+pXzFYH9TNRD5 WLU+sg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=877KKFJnt92OHOjhQOza7plmsJ8WwB/EtQojs2oEy G8=; b=mA17LIDpkn6r16ObLDP2fA4IH/V/JhSDN9lvyYd3mJGUsuLGxYYKd+9WB bxhaElIxTVqEen1V2OGG6A6AbgH0zj9R7SBvPU+ceTtUEtYQwjn70BFUzGulNmng CxCcb+0z52dK608WvzS2HaginpFd0ncOBQzTFcYp5724I1tukjrosVrRsU5cA5Cw r62od7eOqo7rc1ZopB/eFiN7/sOYMtMobUvTzaJl6jbc2CiTb9X4mVO8D6vetEIL fkGTnmJ53XwUxJSWrWAPgAwOeZu2dK6Hk/69CAx/gmQiff0IN+4QtBOjL5vRISLL hXdZTHMiLf2ALRvyNTAnFDWn78ERQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeghedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 52EDE3064AA6; Mon, 23 Nov 2020 03:12:54 -0500 (EST) From: Thomas Monjalon To: Matan Azrad , Slava Ovsiienko , Ori Kam Cc: "dev@dpdk.org" , Jack Min , Ori Kam , Suanming Mou , Asaf Penso Date: Mon, 23 Nov 2020 09:12:52 +0100 Message-ID: <2111543.zL4mt2f7QZ@thomas> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" 23/11/2020 08:54, Ori Kam: > From: Matan Azrad > > From: Thomas Monjalon > > > 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 = 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 = 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 = 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_ipv4)) > > > > +#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. > > > > +1 > > > > Why above the hairpin functions? This is correct for all encap decisions. Other functions were already using this macro. Only hairpin functions were not using it. So I changed on apply.