From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0907C1B2B3 for ; Mon, 22 Apr 2019 20:11:11 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 22 Apr 2019 21:07:20 +0300 Received: from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx [10.210.16.124]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3MI7Kv0013102; Mon, 22 Apr 2019 21:07:20 +0300 From: Ori Kam To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Mon, 22 Apr 2019 18:06:56 +0000 Message-Id: <1555956416-79534-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1555935668-81847-1-git-send-email-orika@mellanox.com> References: <1555935668-81847-1-git-send-email-orika@mellanox.com> Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags 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: , X-List-Received-Date: Mon, 22 Apr 2019 18:11:12 -0000 When creating the modify action using Direct Rules, we need to add flags to mark, if the action will be done on root table or on private table. Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API") Signed-off-by: Ori Kam --- v3: * Address ML comments. v2: * Change title. --- drivers/net/mlx5/mlx5_flow.h | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index c419e6b..b665420 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource { uint32_t actions_num; /**< Number of modification actions. */ struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM]; /**< Modification actions. */ + uint64_t flags; /**< Flags for RDMA API. */ }; /* Jump action resource structure. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..af2cf33 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -43,6 +43,10 @@ #define MLX5DV_FLOW_TABLE_TYPE_FDB 0 #endif +#ifndef HAVE_MLX5DV_DR +#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1 +#endif + union flow_dv_attr { struct { uint32_t valid:1; @@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = { ns = sh->tx_ns; else ns = sh->rx_ns; + resource->flags = + dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL; /* Lookup a matching resource from cache. */ LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { if (resource->ft_type == cache_resource->ft_type && resource->actions_num == cache_resource->actions_num && + resource->flags == cache_resource->flags && !memcmp((const void *)resource->actions, (const void *)cache_resource->actions, (resource->actions_num * @@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = { cache_resource->verbs_action = mlx5_glue->dv_create_flow_action_modify_header (sh->ctx, cache_resource->ft_type, - ns, 0, + ns, cache_resource->flags, cache_resource->actions_num * sizeof(cache_resource->actions[0]), (uint64_t *)cache_resource->actions); -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BAAD5A05D3 for ; Mon, 22 Apr 2019 20:11:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 869BC1B457; Mon, 22 Apr 2019 20:11:13 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0907C1B2B3 for ; Mon, 22 Apr 2019 20:11:11 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 22 Apr 2019 21:07:20 +0300 Received: from pegasus03.mtr.labs.mlnx (pegasus03.mtr.labs.mlnx [10.210.16.124]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x3MI7Kv0013102; Mon, 22 Apr 2019 21:07:20 +0300 From: Ori Kam To: yskoh@mellanox.com, shahafs@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com Date: Mon, 22 Apr 2019 18:06:56 +0000 Message-Id: <1555956416-79534-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1555935668-81847-1-git-send-email-orika@mellanox.com> References: <1555935668-81847-1-git-send-email-orika@mellanox.com> Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix modification action flags 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190422180656.xyWUYwxCjXPnEFMr3icD20z2khN0O8c3q0MZnzydCwY@z> When creating the modify action using Direct Rules, we need to add flags to mark, if the action will be done on root table or on private table. Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API") Signed-off-by: Ori Kam --- v3: * Address ML comments. v2: * Change title. --- drivers/net/mlx5/mlx5_flow.h | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index c419e6b..b665420 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -255,6 +255,7 @@ struct mlx5_flow_dv_modify_hdr_resource { uint32_t actions_num; /**< Number of modification actions. */ struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM]; /**< Modification actions. */ + uint64_t flags; /**< Flags for RDMA API. */ }; /* Jump action resource structure. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 2f777ec..af2cf33 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -43,6 +43,10 @@ #define MLX5DV_FLOW_TABLE_TYPE_FDB 0 #endif +#ifndef HAVE_MLX5DV_DR +#define MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL 1 +#endif + union flow_dv_attr { struct { uint32_t valid:1; @@ -1830,10 +1834,13 @@ struct field_modify_info modify_tcp[] = { ns = sh->tx_ns; else ns = sh->rx_ns; + resource->flags = + dev_flow->flow->group ? 0 : MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL; /* Lookup a matching resource from cache. */ LIST_FOREACH(cache_resource, &sh->modify_cmds, next) { if (resource->ft_type == cache_resource->ft_type && resource->actions_num == cache_resource->actions_num && + resource->flags == cache_resource->flags && !memcmp((const void *)resource->actions, (const void *)cache_resource->actions, (resource->actions_num * @@ -1856,7 +1863,7 @@ struct field_modify_info modify_tcp[] = { cache_resource->verbs_action = mlx5_glue->dv_create_flow_action_modify_header (sh->ctx, cache_resource->ft_type, - ns, 0, + ns, cache_resource->flags, cache_resource->actions_num * sizeof(cache_resource->actions[0]), (uint64_t *)cache_resource->actions); -- 1.8.3.1