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 2E7ECA04DB; Mon, 16 Nov 2020 08:56:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB754C90A; Mon, 16 Nov 2020 08:55:45 +0100 (CET) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 3D445C8FE for ; Mon, 16 Nov 2020 08:55:43 +0100 (CET) From: Xiaoyu Min To: Jasvinder Singh , Cristian Dumitrescu Cc: dev@dpdk.org, Dekel Peled Date: Mon, 16 Nov 2020 15:55:18 +0800 Message-Id: <0bbc7b578dc8ad9348e802e2553de977805f80db.1605493464.git.jackmin@nvidia.com> X-Mailer: git-send-email 2.24.0.rc0.3.g12a4aeaad8 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 5/5] net/softnic: update headers size calculation 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: Dekel Peled The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1]. The rte_flow_item_ipv6 item was updated in [2]. The structs now contain additional metadata following the header data. The size to use for match should be the header data size only, and not the size of the whole struct. This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr. [1]:commit 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items") [2]: commit ad976bd40d28 ("ethdev: add extensions attributes to IPv6 item") Signed-off-by: Dekel Peled --- drivers/net/softnic/rte_eth_softnic_flow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c index f05ff092fa..7925bad1c0 100644 --- a/drivers/net/softnic/rte_eth_softnic_flow.c +++ b/drivers/net/softnic/rte_eth_softnic_flow.c @@ -169,22 +169,22 @@ flow_item_is_proto(enum rte_flow_item_type type, case RTE_FLOW_ITEM_TYPE_ETH: *mask = &rte_flow_item_eth_mask; - *size = sizeof(struct rte_flow_item_eth); + *size = sizeof(struct rte_ether_hdr); return 1; /* TRUE */ case RTE_FLOW_ITEM_TYPE_VLAN: *mask = &rte_flow_item_vlan_mask; - *size = sizeof(struct rte_flow_item_vlan); + *size = sizeof(struct rte_vlan_hdr); return 1; case RTE_FLOW_ITEM_TYPE_IPV4: *mask = &rte_flow_item_ipv4_mask; - *size = sizeof(struct rte_flow_item_ipv4); + *size = sizeof(struct rte_ipv4_hdr); return 1; case RTE_FLOW_ITEM_TYPE_IPV6: *mask = &rte_flow_item_ipv6_mask; - *size = sizeof(struct rte_flow_item_ipv6); + *size = sizeof(struct rte_ipv6_hdr); return 1; case RTE_FLOW_ITEM_TYPE_ICMP: -- 2.25.1