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 EE692A09D3; Thu, 12 Nov 2020 14:55:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A810156A3; Thu, 12 Nov 2020 14:55:55 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 579544CA6 for ; Thu, 12 Nov 2020 14:55:53 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from suanmingm@nvidia.com) with SMTP; 12 Nov 2020 15:55:46 +0200 Received: from nvidia.com (mtbc-r640-04.mtbc.labs.mlnx [10.75.70.9]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0ACDtjVu008862; Thu, 12 Nov 2020 15:55:45 +0200 From: Suanming Mou To: viacheslavo@nvidia.com, matan@nvidia.com Cc: rasland@nvidia.com, dev@dpdk.org Date: Thu, 12 Nov 2020 21:55:43 +0800 Message-Id: <1605189343-363765-1-git-send-email-suanmingm@nvidia.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix header reformat action hash key 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" Currently, header reformat action uses the hash list 32-bit key generated in header reformat register function directly. The key will not be recalculated in the hash list function. As the 64-bit key is composed of the 32-bit attributes and 32-bit reformat buffer csum, the hash list function only gets 32-bit key directly will take the attribute part only, csum part will be ignored. For different header reformat actions, the attributes can be the same, while the buffer will be different. Only take the attribute part causes lots of the conflicts. This commits removes the key attribute part and uses the significant different csum part for the key. Fixes: f961fd490fd4 ("net/mlx5: make header reformat action thread safe") Signed-off-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow.h | 12 ------------ drivers/net/mlx5/mlx5_flow_dv.c | 13 +------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index e3a5030..c577c89 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -413,18 +413,6 @@ struct mlx5_flow_dv_matcher { #define MLX5_ENCAP_MAX_LEN 132 -/* Encap/decap resource key of the hash organization. */ -union mlx5_flow_encap_decap_key { - struct { - uint32_t ft_type:8; /**< Flow table type, Rx or Tx. */ - uint32_t refmt_type:8; /**< Header reformat type. */ - uint32_t buf_size:8; /**< Encap buf size. */ - uint32_t table_level:8; /**< Root table or not. */ - uint32_t cksum; /**< Encap buf check sum. */ - }; - uint64_t v64; /**< full 64bits value of key */ -}; - /* Encap/decap resource structure. */ struct mlx5_flow_dv_encap_decap_resource { struct mlx5_hlist_entry entry; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 78c710f..bca6289 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2865,24 +2865,13 @@ struct mlx5_hlist_entry * struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_dev_ctx_shared *sh = priv->sh; struct mlx5_hlist_entry *entry; - union mlx5_flow_encap_decap_key encap_decap_key = { - { - .ft_type = resource->ft_type, - .refmt_type = resource->reformat_type, - .buf_size = resource->size, - .table_level = !!dev_flow->dv.group, - .cksum = 0, - } - }; struct mlx5_flow_cb_ctx ctx = { .error = error, .data = resource, }; resource->flags = dev_flow->dv.group ? 0 : 1; - encap_decap_key.cksum = __rte_raw_cksum(resource->buf, - resource->size, 0); - resource->entry.key = encap_decap_key.v64; + resource->entry.key = __rte_raw_cksum(resource->buf, resource->size, 0); entry = mlx5_hlist_register(sh->encaps_decaps, resource->entry.key, &ctx); if (!entry) -- 1.8.3.1