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 1C5FFA04B5; Wed, 28 Oct 2020 00:53:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D7E66A12; Wed, 28 Oct 2020 00:50:07 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 39AFCAD0E for ; Wed, 28 Oct 2020 00:48:29 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from suanmingm@nvidia.com) with SMTP; 28 Oct 2020 01:48:23 +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 09RNltVk026660; Wed, 28 Oct 2020 01:48:22 +0200 From: Suanming Mou To: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Cc: dev@dpdk.org, rasland@nvidia.com Date: Wed, 28 Oct 2020 07:47:24 +0800 Message-Id: <1603842466-19879-14-git-send-email-suanmingm@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603842466-19879-1-git-send-email-suanmingm@nvidia.com> References: <1601984948-313027-1-git-send-email-suanmingm@nvidia.com> <1603842466-19879-1-git-send-email-suanmingm@nvidia.com> Subject: [dpdk-dev] [PATCH v4 13/34] net/mlx5: add flow table tunnel offload attribute 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" As flow table is shared between the ports in the same shared IB device, flow table may be created by one port and released by other port. Currently, the tunnel offloading active check in flow table release is based on the port which release the flow table. Since the flow table create port and release port may have different tunnel offloading configuration, it will cause invalid tunnel offloading release or tunnel offloading resource leaks. Add the flow table tunnel offloading attribute to indicate the flow table has tunnel offloading resource or not to avoid wrong tunnel offloading operation. Signed-off-by: Suanming Mou Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index cc64792..62c5e7c 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -538,6 +538,7 @@ struct mlx5_flow_tbl_data_entry { const struct mlx5_flow_tunnel *tunnel; uint32_t group_id; bool external; + bool tunnel_offload; /* Tunnel offlod table or not. */ }; /* Sub rdma-core actions list. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 13bc46d..0b4b7ff 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7986,6 +7986,7 @@ struct field_modify_info modify_tcp[] = { tbl_data->tunnel = tunnel; tbl_data->group_id = group_id; tbl_data->external = external; + tbl_data->tunnel_offload = is_tunnel_offload_active(dev); tbl = &tbl_data->tbl; pos = &tbl_data->entry; if (transfer) @@ -8061,7 +8062,7 @@ struct field_modify_info modify_tcp[] = { mlx5_flow_os_destroy_flow_tbl(tbl->obj); tbl->obj = NULL; - if (is_tunnel_offload_active(dev) && tbl_data->external) { + if (tbl_data->tunnel_offload && tbl_data->external) { struct mlx5_hlist_entry *he; struct mlx5_hlist *tunnel_grp_hash; struct mlx5_flow_tunnel_hub *thub = -- 1.8.3.1