* [v1 2/3] net/mlx5/hws: dump FT icm addresses
2023-03-20 14:12 [v1 1/3] net/mlx5/hws: support dest root table action Hamdan Igbaria
@ 2023-03-20 14:12 ` Hamdan Igbaria
2023-03-20 14:12 ` [v1 3/3] net/mlx5/hws: Enhance forward table and FTE creation Hamdan Igbaria
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Hamdan Igbaria @ 2023-03-20 14:12 UTC (permalink / raw)
To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex
Add the support for query FT command.
Use the query FT command to dump the ICM
addresses of table start anchor and matcher
end anchor.
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
drivers/common/mlx5/mlx5_prm.h | 50 ++++++++++++++++++++---
drivers/net/mlx5/hws/mlx5dr_cmd.c | 28 +++++++++++++
drivers/net/mlx5/hws/mlx5dr_cmd.h | 9 +++++
drivers/net/mlx5/hws/mlx5dr_debug.c | 62 ++++++++++++++++++++++++++---
drivers/net/mlx5/hws/mlx5dr_debug.h | 6 +++
5 files changed, 144 insertions(+), 11 deletions(-)
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 4b0a56f4e5..6b72039bdd 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -1156,6 +1156,7 @@ enum {
MLX5_CMD_OP_CREATE_RQT = 0x916,
MLX5_CMD_OP_MODIFY_RQT = 0x917,
MLX5_CMD_OP_CREATE_FLOW_TABLE = 0x930,
+ MLX5_CMD_OP_QUERY_FLOW_TABLE = 0x932,
MLX5_CMD_OP_CREATE_FLOW_GROUP = 0x933,
MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY = 0x936,
MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c,
@@ -4872,11 +4873,17 @@ struct mlx5_ifc_flow_table_context_bits {
u8 reserved_at_60[0x60];
- u8 rtc_id_0[0x20];
-
- u8 rtc_id_1[0x20];
-
- u8 reserved_at_100[0x40];
+ union {
+ struct {
+ u8 rtc_id_0[0x20];
+ u8 rtc_id_1[0x20];
+ u8 reserved_at_100[0x40];
+ };
+ struct {
+ u8 sw_owner_icm_root_1[0x40];
+ u8 sw_owner_icm_root_0[0x40];
+ };
+ };
};
struct mlx5_ifc_create_flow_table_in_bits {
@@ -4909,6 +4916,39 @@ struct mlx5_ifc_create_flow_table_out_bits {
u8 icm_address_31_0[0x20];
};
+struct mlx5_ifc_query_flow_table_in_bits {
+ u8 opcode[0x10];
+ u8 uid[0x10];
+
+ u8 vhca_tunnel_id[0x10];
+ u8 op_mod[0x10];
+
+ u8 other_vport[0x1];
+ u8 reserved_at_41[0xf];
+ u8 vport_number[0x10];
+
+ u8 reserved_at_60[0x20];
+
+ u8 table_type[0x8];
+ u8 reserved_at_88[0x18];
+
+ u8 reserved_at_a0[0x8];
+ u8 table_id[0x18];
+
+ u8 reserved_at_c0[0x140];
+};
+
+struct mlx5_ifc_query_flow_table_out_bits {
+ u8 status[0x8];
+ u8 reserved_at_8[0x18];
+
+ u8 syndrome[0x20];
+
+ u8 reserved_at_40[0x80];
+
+ struct mlx5_ifc_flow_table_context_bits flow_table_context;
+};
+
enum mlx5_flow_destination_type {
MLX5_FLOW_DESTINATION_TYPE_VPORT = 0x0,
};
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index a444fb4438..6e7d6eb1ac 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -80,6 +80,34 @@ mlx5dr_cmd_flow_table_modify(struct mlx5dr_devx_obj *devx_obj,
return ret;
}
+int
+mlx5dr_cmd_flow_table_query(struct mlx5dr_devx_obj *devx_obj,
+ struct mlx5dr_cmd_ft_query_attr *ft_attr,
+ uint64_t *icm_addr_0, uint64_t *icm_addr_1)
+{
+ uint32_t out[MLX5_ST_SZ_DW(query_flow_table_out)] = {0};
+ uint32_t in[MLX5_ST_SZ_DW(query_flow_table_in)] = {0};
+ void *ft_ctx;
+ int ret;
+
+ MLX5_SET(query_flow_table_in, in, opcode, MLX5_CMD_OP_QUERY_FLOW_TABLE);
+ MLX5_SET(query_flow_table_in, in, table_type, ft_attr->type);
+ MLX5_SET(query_flow_table_in, in, table_id, devx_obj->id);
+
+ ret = mlx5_glue->devx_obj_query(devx_obj->obj, in, sizeof(in), out, sizeof(out));
+ if (ret) {
+ DR_LOG(ERR, "Failed to query FT");
+ rte_errno = errno;
+ return ret;
+ }
+
+ ft_ctx = MLX5_ADDR_OF(query_flow_table_out, out, flow_table_context);
+ *icm_addr_0 = MLX5_GET64(flow_table_context, ft_ctx, sw_owner_icm_root_0);
+ *icm_addr_1 = MLX5_GET64(flow_table_context, ft_ctx, sw_owner_icm_root_1);
+
+ return ret;
+}
+
static struct mlx5dr_devx_obj *
mlx5dr_cmd_flow_group_create(struct ibv_context *ctx,
struct mlx5dr_cmd_fg_attr *fg_attr)
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index 3f40c085be..7d03f3d169 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -22,6 +22,10 @@ struct mlx5dr_cmd_ft_modify_attr {
uint64_t modify_fs;
};
+struct mlx5dr_cmd_ft_query_attr {
+ uint8_t type;
+};
+
struct mlx5dr_cmd_fg_attr {
uint32_t table_id;
uint32_t table_type;
@@ -215,6 +219,11 @@ int
mlx5dr_cmd_flow_table_modify(struct mlx5dr_devx_obj *devx_obj,
struct mlx5dr_cmd_ft_modify_attr *ft_attr);
+int
+mlx5dr_cmd_flow_table_query(struct mlx5dr_devx_obj *devx_obj,
+ struct mlx5dr_cmd_ft_query_attr *ft_attr,
+ uint64_t *icm_addr_0, uint64_t *icm_addr_1);
+
struct mlx5dr_devx_obj *
mlx5dr_cmd_rtc_create(struct ibv_context *ctx,
struct mlx5dr_cmd_rtc_create_attr *rtc_attr);
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index e29122aa98..c49b504317 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -198,9 +198,12 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
bool is_shared = mlx5dr_context_shared_gvmi_used(matcher->tbl->ctx);
bool is_root = matcher->tbl->level == MLX5DR_ROOT_LEVEL;
enum mlx5dr_table_type tbl_type = matcher->tbl->type;
+ struct mlx5dr_cmd_ft_query_attr ft_attr = {0};
struct mlx5dr_devx_obj *ste_0, *ste_1 = NULL;
struct mlx5dr_pool_chunk *ste;
struct mlx5dr_pool *ste_pool;
+ uint64_t icm_addr_0 = 0;
+ uint64_t icm_addr_1 = 0;
int ret;
ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,0x%" PRIx64,
@@ -243,13 +246,25 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
ste_1 = NULL;
}
- ret = fprintf(f, ",%d,%d,%d,%d,%d\n",
+ if (!is_root) {
+ ft_attr.type = matcher->tbl->fw_ft_type;
+ ret = mlx5dr_cmd_flow_table_query(matcher->end_ft,
+ &ft_attr,
+ &icm_addr_0,
+ &icm_addr_1);
+ if (ret)
+ return ret;
+ }
+
+ ret = fprintf(f, ",%d,%d,%d,%d,%d,0x%" PRIx64 ",0x%" PRIx64 "\n",
matcher->action_ste.rtc_0 ? matcher->action_ste.rtc_0->id : 0,
ste_0 ? (int)ste_0->id : -1,
matcher->action_ste.rtc_1 ? matcher->action_ste.rtc_1->id : 0,
ste_1 ? (int)ste_1->id : -1,
is_shared && !is_root ?
- matcher->match_ste.aliased_rtc_0->id : 0);
+ matcher->match_ste.aliased_rtc_0->id : 0,
+ mlx5dr_debug_icm_to_idx(icm_addr_0),
+ mlx5dr_debug_icm_to_idx(icm_addr_1));
if (ret < 0)
goto out_err;
@@ -276,10 +291,15 @@ static int mlx5dr_debug_dump_table(FILE *f, struct mlx5dr_table *tbl)
{
bool is_shared = mlx5dr_context_shared_gvmi_used(tbl->ctx);
bool is_root = tbl->level == MLX5DR_ROOT_LEVEL;
+ struct mlx5dr_cmd_ft_query_attr ft_attr = {0};
struct mlx5dr_matcher *matcher;
+ uint64_t local_icm_addr_0 = 0;
+ uint64_t local_icm_addr_1 = 0;
+ uint64_t icm_addr_0 = 0;
+ uint64_t icm_addr_1 = 0;
int ret;
- ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,%d,%d,%d\n",
+ ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,%d,%d,%d",
MLX5DR_DEBUG_RES_TYPE_TABLE,
(uint64_t)(uintptr_t)tbl,
(uint64_t)(uintptr_t)tbl->ctx,
@@ -288,11 +308,37 @@ static int mlx5dr_debug_dump_table(FILE *f, struct mlx5dr_table *tbl)
is_root ? 0 : tbl->fw_ft_type,
tbl->level,
is_shared && !is_root ? tbl->local_ft->id : 0);
- if (ret < 0) {
- rte_errno = EINVAL;
- return rte_errno;
+ if (ret < 0)
+ goto out_err;
+
+ if (!is_root) {
+ ft_attr.type = tbl->fw_ft_type;
+ ret = mlx5dr_cmd_flow_table_query(tbl->ft,
+ &ft_attr,
+ &icm_addr_0,
+ &icm_addr_1);
+ if (ret)
+ return ret;
+
+ if (is_shared) {
+ ft_attr.type = tbl->fw_ft_type;
+ ret = mlx5dr_cmd_flow_table_query(tbl->local_ft,
+ &ft_attr,
+ &local_icm_addr_0,
+ &local_icm_addr_1);
+ if (ret)
+ return ret;
+ }
}
+ ret = fprintf(f, ",0x%" PRIx64 ",0x%" PRIx64 ",0x%" PRIx64 ",0x%" PRIx64 "\n",
+ mlx5dr_debug_icm_to_idx(icm_addr_0),
+ mlx5dr_debug_icm_to_idx(icm_addr_1),
+ mlx5dr_debug_icm_to_idx(local_icm_addr_0),
+ mlx5dr_debug_icm_to_idx(local_icm_addr_1));
+ if (ret < 0)
+ goto out_err;
+
LIST_FOREACH(matcher, &tbl->head, next) {
ret = mlx5dr_debug_dump_matcher(f, matcher);
if (ret)
@@ -300,6 +346,10 @@ static int mlx5dr_debug_dump_table(FILE *f, struct mlx5dr_table *tbl)
}
return 0;
+
+out_err:
+ rte_errno = EINVAL;
+ return rte_errno;
}
static int
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.h b/drivers/net/mlx5/hws/mlx5dr_debug.h
index 0f88e73186..5cffdb10b5 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.h
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.h
@@ -26,6 +26,12 @@ enum mlx5dr_debug_res_type {
MLX5DR_DEBUG_RES_TYPE_MATCHER_TEMPLATE_RANGE_DEFINER = 4206,
};
+static inline uint64_t
+mlx5dr_debug_icm_to_idx(uint64_t icm_addr)
+{
+ return (icm_addr >> 6) & 0xffffffff;
+}
+
const char *mlx5dr_debug_action_type_to_str(enum mlx5dr_action_type action_type);
#endif /* MLX5DR_DEBUG_H_ */
--
2.26.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [v1 3/3] net/mlx5/hws: Enhance forward table and FTE creation
2023-03-20 14:12 [v1 1/3] net/mlx5/hws: support dest root table action Hamdan Igbaria
2023-03-20 14:12 ` [v1 2/3] net/mlx5/hws: dump FT icm addresses Hamdan Igbaria
@ 2023-03-20 14:12 ` Hamdan Igbaria
2023-05-15 8:24 ` [v1 1/3] net/mlx5/hws: support dest root table action Matan Azrad
2023-05-24 9:01 ` Raslan Darawsheh
3 siblings, 0 replies; 5+ messages in thread
From: Hamdan Igbaria @ 2023-03-20 14:12 UTC (permalink / raw)
To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex
Changed FW FT and FTE creation to allow dynamic creation.
Till now only FTE with vport destination action was supported.
Also enhanced forward table creation to be generic.
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
drivers/common/mlx5/mlx5_prm.h | 20 +++++++--
drivers/net/mlx5/hws/mlx5dr_cmd.c | 66 +++++++++++++++++------------
drivers/net/mlx5/hws/mlx5dr_cmd.h | 28 +++++++++---
drivers/net/mlx5/hws/mlx5dr_table.c | 12 ++++--
4 files changed, 83 insertions(+), 43 deletions(-)
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 6b72039bdd..d6af069fae 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -4951,10 +4951,17 @@ struct mlx5_ifc_query_flow_table_out_bits {
enum mlx5_flow_destination_type {
MLX5_FLOW_DESTINATION_TYPE_VPORT = 0x0,
+ MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE = 0x1,
};
-enum {
- MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 0x4,
+enum mlx5_flow_context_action {
+ MLX5_FLOW_CONTEXT_ACTION_FWD_DEST = 1 << 2,
+};
+
+enum mlx5_flow_context_flow_source {
+ MLX5_FLOW_CONTEXT_FLOW_SOURCE_ANY_VPORT = 0x0,
+ MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK = 0x1,
+ MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT = 0x2,
};
struct mlx5_ifc_set_fte_out_bits {
@@ -4992,11 +4999,16 @@ struct mlx5_ifc_flow_context_bits {
u8 reserved_at_60[0x10];
u8 action[0x10];
u8 extended_destination[0x1];
- u8 reserved_at_81[0x7];
+ u8 reserved_at_81[0x1];
+ u8 flow_source[0x2];
+ u8 encrypt_decrypt_type[0x4];
u8 destination_list_size[0x18];
u8 reserved_at_a0[0x8];
u8 flow_counter_list_size[0x18];
- u8 reserved_at_c0[0x1740];
+ u8 packet_reformat_id[0x20];
+ u8 reserved_at_e0[0x40];
+ u8 encrypt_decrypt_obj_id[0x20];
+ u8 reserved_at_140[0x16c0];
/* Currently only one destnation */
union mlx5_ifc_dest_format_flow_counter_list_auto_bits destination[1];
};
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 6e7d6eb1ac..369bc8bf55 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -140,17 +140,18 @@ mlx5dr_cmd_flow_group_create(struct ibv_context *ctx,
return devx_obj;
}
-static struct mlx5dr_devx_obj *
-mlx5dr_cmd_set_vport_fte(struct ibv_context *ctx,
- uint32_t table_type,
- uint32_t table_id,
- uint32_t group_id,
- uint32_t vport_id)
+struct mlx5dr_devx_obj *
+mlx5dr_cmd_set_fte(struct ibv_context *ctx,
+ uint32_t table_type,
+ uint32_t table_id,
+ uint32_t group_id,
+ struct mlx5dr_cmd_set_fte_attr *fte_attr)
{
uint32_t in[MLX5_ST_SZ_DW(set_fte_in) + MLX5_ST_SZ_DW(dest_format)] = {0};
uint32_t out[MLX5_ST_SZ_DW(set_fte_out)] = {0};
struct mlx5dr_devx_obj *devx_obj;
void *in_flow_context;
+ uint32_t action_flags;
void *in_dests;
devx_obj = simple_malloc(sizeof(*devx_obj));
@@ -166,50 +167,51 @@ mlx5dr_cmd_set_vport_fte(struct ibv_context *ctx,
in_flow_context = MLX5_ADDR_OF(set_fte_in, in, flow_context);
MLX5_SET(flow_context, in_flow_context, group_id, group_id);
- MLX5_SET(flow_context, in_flow_context, destination_list_size, 1);
- MLX5_SET(flow_context, in_flow_context, action, MLX5_FLOW_CONTEXT_ACTION_FWD_DEST);
+ MLX5_SET(flow_context, in_flow_context, flow_source, fte_attr->flow_source);
+
+ action_flags = fte_attr->action_flags;
+ MLX5_SET(flow_context, in_flow_context, action, action_flags);
- in_dests = MLX5_ADDR_OF(flow_context, in_flow_context, destination);
- MLX5_SET(dest_format, in_dests, destination_type,
- MLX5_FLOW_DESTINATION_TYPE_VPORT);
- MLX5_SET(dest_format, in_dests, destination_id, vport_id);
+ if (action_flags & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
+ /* Only destination_list_size of size 1 is supported */
+ MLX5_SET(flow_context, in_flow_context, destination_list_size, 1);
+ in_dests = MLX5_ADDR_OF(flow_context, in_flow_context, destination);
+ MLX5_SET(dest_format, in_dests, destination_type, fte_attr->destination_type);
+ MLX5_SET(dest_format, in_dests, destination_id, fte_attr->destination_id);
+ }
devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
if (!devx_obj->obj) {
DR_LOG(ERR, "Failed to create FTE");
- simple_free(devx_obj);
rte_errno = errno;
- return NULL;
+ goto free_devx;
}
return devx_obj;
-}
-void mlx5dr_cmd_miss_ft_destroy(struct mlx5dr_cmd_forward_tbl *tbl)
-{
- mlx5dr_cmd_destroy_obj(tbl->fte);
- mlx5dr_cmd_destroy_obj(tbl->fg);
- mlx5dr_cmd_destroy_obj(tbl->ft);
+free_devx:
+ simple_free(devx_obj);
+ return NULL;
}
struct mlx5dr_cmd_forward_tbl *
-mlx5dr_cmd_miss_ft_create(struct ibv_context *ctx,
- struct mlx5dr_cmd_ft_create_attr *ft_attr,
- uint32_t vport)
+mlx5dr_cmd_forward_tbl_create(struct ibv_context *ctx,
+ struct mlx5dr_cmd_ft_create_attr *ft_attr,
+ struct mlx5dr_cmd_set_fte_attr *fte_attr)
{
struct mlx5dr_cmd_fg_attr fg_attr = {0};
struct mlx5dr_cmd_forward_tbl *tbl;
tbl = simple_calloc(1, sizeof(*tbl));
if (!tbl) {
- DR_LOG(ERR, "Failed to allocate memory for forward default");
+ DR_LOG(ERR, "Failed to allocate memory");
rte_errno = ENOMEM;
return NULL;
}
tbl->ft = mlx5dr_cmd_flow_table_create(ctx, ft_attr);
if (!tbl->ft) {
- DR_LOG(ERR, "Failed to create FT for miss-table");
+ DR_LOG(ERR, "Failed to create FT");
goto free_tbl;
}
@@ -218,13 +220,13 @@ mlx5dr_cmd_miss_ft_create(struct ibv_context *ctx,
tbl->fg = mlx5dr_cmd_flow_group_create(ctx, &fg_attr);
if (!tbl->fg) {
- DR_LOG(ERR, "Failed to create FG for miss-table");
+ DR_LOG(ERR, "Failed to create FG");
goto free_ft;
}
- tbl->fte = mlx5dr_cmd_set_vport_fte(ctx, ft_attr->type, tbl->ft->id, tbl->fg->id, vport);
+ tbl->fte = mlx5dr_cmd_set_fte(ctx, ft_attr->type, tbl->ft->id, tbl->fg->id, fte_attr);
if (!tbl->fte) {
- DR_LOG(ERR, "Failed to create FTE for miss-table");
+ DR_LOG(ERR, "Failed to create FTE");
goto free_fg;
}
return tbl;
@@ -238,6 +240,14 @@ mlx5dr_cmd_miss_ft_create(struct ibv_context *ctx,
return NULL;
}
+void mlx5dr_cmd_forward_tbl_destroy(struct mlx5dr_cmd_forward_tbl *tbl)
+{
+ mlx5dr_cmd_destroy_obj(tbl->fte);
+ mlx5dr_cmd_destroy_obj(tbl->fg);
+ mlx5dr_cmd_destroy_obj(tbl->ft);
+ simple_free(tbl);
+}
+
void mlx5dr_cmd_set_attr_connect_miss_tbl(struct mlx5dr_context *ctx,
uint32_t fw_ft_type,
enum mlx5dr_table_type type,
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index 7d03f3d169..e57013c309 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -5,6 +5,13 @@
#ifndef MLX5DR_CMD_H_
#define MLX5DR_CMD_H_
+struct mlx5dr_cmd_set_fte_attr {
+ uint32_t action_flags;
+ uint8_t destination_type;
+ uint32_t destination_id;
+ uint8_t flow_source;
+};
+
struct mlx5dr_cmd_ft_create_attr {
uint8_t type;
uint8_t level;
@@ -263,6 +270,20 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
uint32_t pattern_length,
uint8_t *actions);
+struct mlx5dr_devx_obj *
+mlx5dr_cmd_set_fte(struct ibv_context *ctx,
+ uint32_t table_type,
+ uint32_t table_id,
+ uint32_t group_id,
+ struct mlx5dr_cmd_set_fte_attr *fte_attr);
+
+struct mlx5dr_cmd_forward_tbl *
+mlx5dr_cmd_forward_tbl_create(struct ibv_context *ctx,
+ struct mlx5dr_cmd_ft_create_attr *ft_attr,
+ struct mlx5dr_cmd_set_fte_attr *fte_attr);
+
+void mlx5dr_cmd_forward_tbl_destroy(struct mlx5dr_cmd_forward_tbl *tbl);
+
struct mlx5dr_devx_obj *
mlx5dr_cmd_alias_obj_create(struct ibv_context *ctx,
struct mlx5dr_cmd_alias_obj_create_attr *alias_attr);
@@ -275,13 +296,6 @@ int mlx5dr_cmd_query_ib_port(struct ibv_context *ctx,
int mlx5dr_cmd_query_caps(struct ibv_context *ctx,
struct mlx5dr_cmd_query_caps *caps);
-void mlx5dr_cmd_miss_ft_destroy(struct mlx5dr_cmd_forward_tbl *tbl);
-
-struct mlx5dr_cmd_forward_tbl *
-mlx5dr_cmd_miss_ft_create(struct ibv_context *ctx,
- struct mlx5dr_cmd_ft_create_attr *ft_attr,
- uint32_t vport);
-
void mlx5dr_cmd_set_attr_connect_miss_tbl(struct mlx5dr_context *ctx,
uint32_t fw_ft_type,
enum mlx5dr_table_type type,
diff --git a/drivers/net/mlx5/hws/mlx5dr_table.c b/drivers/net/mlx5/hws/mlx5dr_table.c
index 327e2ec710..8474a9cf61 100644
--- a/drivers/net/mlx5/hws/mlx5dr_table.c
+++ b/drivers/net/mlx5/hws/mlx5dr_table.c
@@ -20,6 +20,7 @@ static int
mlx5dr_table_up_default_fdb_miss_tbl(struct mlx5dr_table *tbl)
{
struct mlx5dr_cmd_ft_create_attr ft_attr = {0};
+ struct mlx5dr_cmd_set_fte_attr fte_attr = {0};
struct mlx5dr_cmd_forward_tbl *default_miss;
struct mlx5dr_context *ctx = tbl->ctx;
uint8_t tbl_type = tbl->type;
@@ -40,8 +41,12 @@ mlx5dr_table_up_default_fdb_miss_tbl(struct mlx5dr_table *tbl)
assert(ctx->caps->eswitch_manager);
vport = ctx->caps->eswitch_manager_vport_number;
- default_miss = mlx5dr_cmd_miss_ft_create(mlx5dr_context_get_local_ibv(ctx),
- &ft_attr, vport);
+ fte_attr.action_flags = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+ fte_attr.destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
+ fte_attr.destination_id = vport;
+
+ default_miss = mlx5dr_cmd_forward_tbl_create(mlx5dr_context_get_local_ibv(ctx),
+ &ft_attr, &fte_attr);
if (!default_miss) {
DR_LOG(ERR, "Failed to default miss table type: 0x%x", tbl_type);
return rte_errno;
@@ -66,9 +71,8 @@ static void mlx5dr_table_down_default_fdb_miss_tbl(struct mlx5dr_table *tbl)
if (--default_miss->refcount)
return;
- mlx5dr_cmd_miss_ft_destroy(default_miss);
+ mlx5dr_cmd_forward_tbl_destroy(default_miss);
- simple_free(default_miss);
ctx->common_res[tbl_type].default_miss = NULL;
}
--
2.26.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [v1 1/3] net/mlx5/hws: support dest root table action
2023-03-20 14:12 [v1 1/3] net/mlx5/hws: support dest root table action Hamdan Igbaria
2023-03-20 14:12 ` [v1 2/3] net/mlx5/hws: dump FT icm addresses Hamdan Igbaria
2023-03-20 14:12 ` [v1 3/3] net/mlx5/hws: Enhance forward table and FTE creation Hamdan Igbaria
@ 2023-05-15 8:24 ` Matan Azrad
2023-05-24 9:01 ` Raslan Darawsheh
3 siblings, 0 replies; 5+ messages in thread
From: Matan Azrad @ 2023-05-15 8:24 UTC (permalink / raw)
To: Hamdan Igbaria, Slava Ovsiienko,
NBU-Contact-Thomas Monjalon (EXTERNAL),
Suanming Mou
Cc: dev, Ori Kam, Alex Vesker
From: Hamdan Igbaria
> Add support for dest root table action creation.
> This support will allow to redirect the packets to the kernel from non root
> tables.
>
> Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
> Reviewed-by: Alex Vesker <valex@nvidia.com>
Series-acked-by: Matan Azrad <matan@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [v1 1/3] net/mlx5/hws: support dest root table action
2023-03-20 14:12 [v1 1/3] net/mlx5/hws: support dest root table action Hamdan Igbaria
` (2 preceding siblings ...)
2023-05-15 8:24 ` [v1 1/3] net/mlx5/hws: support dest root table action Matan Azrad
@ 2023-05-24 9:01 ` Raslan Darawsheh
3 siblings, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2023-05-24 9:01 UTC (permalink / raw)
To: Hamdan Igbaria, Hamdan Igbaria, Slava Ovsiienko,
NBU-Contact-Thomas Monjalon (EXTERNAL),
Suanming Mou, Matan Azrad
Cc: dev, Ori Kam, Alex Vesker
Hi,
> -----Original Message-----
> From: Hamdan Igbaria <hamdani@nvidia.com>
> Sent: Monday, March 20, 2023 4:12 PM
> To: Hamdan Igbaria <hamdani@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>; Alex Vesker
> <valex@nvidia.com>
> Subject: [v1 1/3] net/mlx5/hws: support dest root table action
>
> Add support for dest root table action creation.
> This support will allow to redirect the packets to the kernel from non root
> tables.
>
> Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
> Reviewed-by: Alex Vesker <valex@nvidia.com>
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 5+ messages in thread