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 96D2AA04B5; Tue, 27 Oct 2020 13:32:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D35B5AB9; Tue, 27 Oct 2020 13:29:08 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 51DC037B0 for ; Tue, 27 Oct 2020 13:28:03 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from suanmingm@nvidia.com) with SMTP; 27 Oct 2020 14:27:59 +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 09RCRZ7B024637; Tue, 27 Oct 2020 14:27:58 +0200 From: Suanming Mou To: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Cc: dev@dpdk.org Date: Tue, 27 Oct 2020 20:27:08 +0800 Message-Id: <1603801650-442376-14-git-send-email-suanmingm@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603801650-442376-1-git-send-email-suanmingm@nvidia.com> References: <1601984948-313027-1-git-send-email-suanmingm@nvidia.com> <1603801650-442376-1-git-send-email-suanmingm@nvidia.com> Subject: [dpdk-dev] [PATCH v3 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 22349df..eaf8221 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -539,6 +539,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 3ae5a95..e43e88c 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7981,6 +7981,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) @@ -8055,7 +8056,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