net/mlx5: support jump FDB Rx
cover net/mlx5: support jump FDB Rx
Before FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This series adds the jump from FDB Tx to FDB Rx support and allows RSS action in FDB domain rule when jump FDB Rx is supported.
Suanming Mou (3):
net/mlx5/hws: support jump FDB Rx
net/mlx5: add jump FDB Rx flag
net/mlx5: allow FDB RSS
drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 9 +++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 ++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++++++++------------- drivers/net/mlx5/mlx5_flow_hw.c | 27 +++++++++++++++++----- 14 files changed, 114 insertions(+), 29 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 net/mlx5/hws: support jump FDB Rx
Before FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This commit adds the JUMP_FDB_RX cap bit check and use JUMP_FDB_RX instead of FT for dest table FDB Rx case.
--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)
drivers/common/mlx5/mlx5_prm.h +8 -1
@@ -2466,7 +2466,8 @@ struct mlx5_ifc_wqe_based_flow_table_cap_bits {u8 reserved_at_60[0x8 ];u8 max_header_modify_pattern_length[0x8 ];u8 ste_format[0x10 ]; -u8 stc_action_type[0x80 ]; +u8 stc_action_type_63_0[0x40 ]; +u8 stc_action_type_127_64[0x40 ];u8 header_insert_type[0x10 ];u8 header_remove_type[0x10 ];u8 trivial_match_definer[0x20 ];
@@ -3543,6 +3544,11 @@ enum mlx5_ifc_rtc_reparse_mode { MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, }; +enum mlx5_ifc_stc_action_type_bit_index { +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX =64 , +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX =71 , +}; +#define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16struct mlx5_ifc_rtc_bits {
@@ -3621,6 +3627,7 @@ enum mlx5_ifc_stc_action_type {MLX5_IFC_STC_ACTION_TYPE_ALLOW =0x84 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT =0x85 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK =0x86 , + MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX = 0x87, }; enum mlx5_ifc_stc_reparse_mode {
drivers/net/mlx5/hws/mlx5dr_action.c +21 -5
@@ -803,6 +803,9 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[],switch (action->type) {case MLX5DR_ACTION_TYP_TBL : + attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; + attr[i].obj = action->dest_tbl.devx_obj->obj; +break ;case MLX5DR_ACTION_TYP_TIR : attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; attr[i].obj = action->devx_obj;
@@ -1097,6 +1100,17 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, }break ;case MLX5DR_ACTION_TYP_TBL : + attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ; + attr->dest_table_id = obj->id; +/* Only for unified FDB Rx case */ +if (mlx5dr_context_cap_stc (action->ctx, +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX ) && + action->dest_tbl.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX ; +else + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; + +break ;case MLX5DR_ACTION_TYP_DEST_ARRAY : attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ;
@@ -1419,17 +1433,19 @@ mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx,if (!action)return NULL ; + action->dest_tbl.type = tbl->type; +if (mlx5dr_action_is_root_flags (flags)) {if (mlx5dr_context_shared_gvmi_used (ctx)) - action->devx_obj = tbl->local_ft->obj; + action->dest_tbl.devx_obj = tbl->local_ft;else - action->devx_obj = tbl->ft->obj; + action->dest_tbl.devx_obj = tbl->ft; }else { + action->dest_tbl.devx_obj = tbl->ft; + ret =mlx5dr_action_create_stcs (action, tbl->ft);if (ret) goto free_action; - - action->devx_dest.devx_obj = tbl->ft; }return action;
@@ -2526,7 +2542,7 @@ mlx5dr_action_create_dest_array(struct mlx5dr_context *ctx,case MLX5DR_ACTION_TYP_TBL : dest_list[i].destination_type =MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE ; - dest_list[i].destination_id = dests[i].dest->devx_dest.devx_obj->id; + dest_list[i].destination_id = dests[i].dest->dest_tbl.devx_obj->id; fte_attr.action_flags |=MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ; fte_attr.ignore_flow_level =1 ;break ;
drivers/net/mlx5/hws/mlx5dr_action.h +4 -0
@@ -226,6 +226,10 @@ struct mlx5dr_action {struct {struct mlx5dr_matcher *matcher; } jump_to_matcher; +struct { +struct mlx5dr_devx_obj *devx_obj; +enum mlx5dr_table_type type; + } dest_tbl; }; };
drivers/net/mlx5/hws/mlx5dr_cmd.c +9 -0
@@ -466,6 +466,7 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr,MLX5_SET (stc_ste_param_tir, stc_param, tirn, stc_attr->dest_tir_num);break ;case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT : +case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX :MLX5_SET (stc_ste_param_table, stc_param, table_id, stc_attr->dest_table_id);break ;case MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST :
@@ -1280,6 +1281,14 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, caps->fdb_unified_en =MLX5_GET (query_hca_cap_out, out, capability.wqe_based_flow_table_cap. fdb_unified_en); + + caps->stc_action_type_63_0 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_63_0); + + caps->stc_action_type_127_64 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_127_64); }if (caps->eswitch_manager) {
drivers/net/mlx5/hws/mlx5dr_cmd.h +2 -0
@@ -250,6 +250,8 @@ struct mlx5dr_cmd_query_caps {bool roce;uint16_t roce_max_src_udp_port;uint16_t roce_min_src_udp_port; +uint64_t stc_action_type_63_0; +uint64_t stc_action_type_127_64;bool fdb_unified_en; };
drivers/net/mlx5/hws/mlx5dr_context.c +17 -0
@@ -140,6 +140,23 @@ static int mlx5dr_context_uninit_pd(struct mlx5dr_context *ctx)return 0 ; } +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit) +{ +uint32_t test_bit = bit; + +if (bit >=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ) + test_bit -=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ; + +switch (bit) { +case MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX : +return ctx->caps->stc_action_type_127_64 & (0x1ull << test_bit); +default : +break ; + } + +return false; +} +static void mlx5dr_context_check_hws_supp (struct mlx5dr_context *ctx) {struct mlx5dr_cmd_query_caps *caps = ctx->caps;
drivers/net/mlx5/hws/mlx5dr_context.h +2 -0
@@ -75,4 +75,6 @@ uint8_t mlx5dr_context_get_reparse_mode(struct mlx5dr_context *ctx);void mlx5dr_context_set_pool_tbl_attr (struct mlx5dr_pool_attr *attr,enum mlx5dr_table_type table_type); +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit); +#endif /* MLX5DR_CONTEXT_H_ */
Signature · 1 line
2.34.1
RE: [PATCH 1/3] net/mlx5/hws: support jump FDB Rx
Hi Suanming,
PSB
Quoted 92 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Alex Vesker <[email protected]>
Subject: [PATCH 1/3]net/mlx5/hws: support jump FDB RxBefore FW introduced the
JUMP_FDB_RXaction feature, jump from FDB Tx to Rx is not allowed.JUMP_FDB_RXfeature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.This commit adds the
JUMP_FDB_RXcap bit check and useJUMP_FDB_RXinstead of FT for dest table FDB Rx case.Signed-off-by Suanming Mou <[email protected]>Signed-off-by Alex Vesker <[email protected]>--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/common/mlx5/mlx5_prm.hindex3fc3b0cd2a..84e3347794100644drivers/common/mlx5/mlx5_prm.h +7
-1@@ -2466,7 +2466,8 @@ struct mlx5_ifc_wqe_based_flow_table_cap_bits {u8 reserved_at_60[0x8 ];u8 max_header_modify_pattern_length[0x8 ];u8 ste_format[0x10 ]; -u8 stc_action_type[0x80 ]; +u8 stc_action_type_63_0[0x40 ]; +u8 stc_action_type_127_64[0x40 ];u8 header_insert_type[0x10 ];u8 header_remove_type[0x10 ];u8 trivial_match_definer[0x20 ];@@ -3543,6 +3544,11 @@ enum mlx5_ifc_rtc_reparse_mode { MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, }; +enum mlx5_ifc_stc_action_type_bit_index { +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX =64 , +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX =71 , }; +#define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16struct mlx5_ifc_rtc_bits {@@ -3621,6 +3627,7 @@ enum mlx5_ifc_stc_action_type {MLX5_IFC_STC_ACTION_TYPE_ALLOW =0x84 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT =0x85 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK =0x86 , + MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX = 0x87, }; enum mlx5_ifc_stc_reparse_mode {drivers/net/mlx5/hws/mlx5dr_action.c +3
-0@@ -803,6 +803,9 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[], switch (action->type) {case MLX5DR_ACTION_TYP_TBL : + attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; + attr[i].obj = action->dest_tbl.devx_obj->obj; +break ;case MLX5DR_ACTION_TYP_TIR : attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ;drivers/net/mlx5/hws/mlx5dr_action.c +5
-0attr[i].obj = action->devx_obj;@@ -1097,6 +1100,17 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, }break ;case MLX5DR_ACTION_TYP_TBL : + attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ; + attr->dest_table_id = obj->id; +/* Only for unified FDB Rx case */ +if (mlx5dr_context_cap_stc (action->ctx, + MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX)&&
drivers/net/mlx5/hws/mlx5dr_action.c +2
-0+ action->dest_tbl.type == MLX5DR_TABLE_TYPE_FDB_RX) + attr->action_type =
MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX;
drivers/net/mlx5/hws/mlx5dr_action.c static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, · line 1111
Quoted 2 lines
drivers/net/mlx5/hws/mlx5dr_action.c +2
-0+else + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ;
Fix the long line warnings, same as other places.
Also mlx5dr_context_cap_stc() seems to contain some calculation inside. If the context and the CAP will not be changed during the runtime on a specific port. Can this CAP BIT checking be done only once and saved for later usage? Since the code is used in the flow insertion.WDYT?
Quoted 149 lines
drivers/net/mlx5/hws/mlx5dr_action.c +10
-5+ +break ;case MLX5DR_ACTION_TYP_DEST_ARRAY : attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; @@ -1419,17 +1433,19 @@ mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx, if (!action) return NULL; + action->dest_tbl.type = tbl->type; +if (mlx5dr_action_is_root_flags (flags)) {if (mlx5dr_context_shared_gvmi_used (ctx)) - action->devx_obj = tbl->local_ft->obj; + action->dest_tbl.devx_obj = tbl->local_ft;else - action->devx_obj = tbl->ft->obj; + action->dest_tbl.devx_obj = tbl->ft; }else { + action->dest_tbl.devx_obj = tbl->ft; + ret =mlx5dr_action_create_stcs (action, tbl->ft);if (ret) goto free_action; - - action->devx_dest.devx_obj = tbl->ft; }return action;@@ -2526,7 +2542,7 @@ mlx5dr_action_create_dest_array(structmlx5dr_context *ctx, case MLX5DR_ACTION_TYP_TBL: dest_list[i].destination_type =MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE ; - dest_list[i].destination_id = dests[i].dest- >devx_dest.devx_obj->id; + dest_list[i].destination_id = dests[i].dest- >dest_tbl.devx_obj->id;fte_attr.action_flags |=
MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;drivers/net/mlx5/hws/mlx5dr_action.c +0
-0fte_attr.ignore_flow_level =1 ;break ;drivers/net/mlx5/hws/mlx5dr_action.h +4
-0@@ -226,6 +226,10 @@ struct mlx5dr_action {struct {struct mlx5dr_matcher *matcher; } jump_to_matcher; +struct { +struct mlx5dr_devx_obj *devx_obj; +enum mlx5dr_table_type type; + } dest_tbl; }; };drivers/net/mlx5/hws/mlx5dr_cmd.c +1
-0@@ -466,6 +466,7 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr,MLX5_SET (stc_ste_param_tir, stc_param, tirn, stc_attr- >dest_tir_num);break ;case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT : +case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX : MLX5_SET(stc_ste_param_table, stc_param, table_id, stc_attr-Quoted 1 line
dest_table_id);drivers/net/mlx5/hws/mlx5dr_cmd.c +8
-0break ;case MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST :@@ -1280,6 +1281,14 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, caps->fdb_unified_en =MLX5_GET (query_hca_cap_out, out, capability.wqe_based_flow_table_cap. fdb_unified_en); + + caps->stc_action_type_63_0 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_63_0); + + caps->stc_action_type_127_64 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_127_64); }drivers/net/mlx5/hws/mlx5dr_cmd.c +0
-0if (caps->eswitch_manager) {drivers/net/mlx5/hws/mlx5dr_cmd.h +2
-0@@ -250,6 +250,8 @@ struct mlx5dr_cmd_query_caps {bool roce;uint16_t roce_max_src_udp_port;uint16_t roce_min_src_udp_port; +uint64_t stc_action_type_63_0; +uint64_t stc_action_type_127_64;bool fdb_unified_en; };drivers/net/mlx5/hws/mlx5dr_context.c +16
-0@@ -140,6 +140,23 @@ static int mlx5dr_context_uninit_pd(struct mlx5dr_context *ctx)return 0 ; } +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit) { +uint32_t test_bit = bit; + +if (bit >=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ) + test_bit -=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ; + +switch (bit) { +case MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX : +return ctx->caps->stc_action_type_127_64 & (0x1ull << test_bit); +default : +break ; + } + +return false; +} +static void mlx5dr_context_check_hws_supp (struct mlx5dr_context *ctx) { struct mlx5dr_cmd_query_caps *caps = ctx->caps; diff --git
a/drivers/net/mlx5/hws/mlx5dr_context.hb/drivers/net/mlx5/hws/mlx5dr_context.h
indexe89a093c77..deb7196e39100644drivers/net/mlx5/hws/mlx5dr_context.h +0
-0@@ -75,4 +75,6 @@ uint8_t mlx5dr_context_get_reparse_mode(struct
mlx5dr_context*ctx); void mlx5dr_context_set_pool_tbl_attr(structmlx5dr_pool_attr*attr,drivers/net/mlx5/hws/mlx5dr_context.h +2
-1enum mlx5dr_table_type table_type); +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit); +#endif /* MLX5DR_CONTEXT_H_ */ --2.34.1
RE: [PATCH 1/3] net/mlx5/hws: support jump FDB Rx
Quoted 46 lines
-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Wednesday, February 26, 2025 6:29 PM
To: Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Alex Vesker <[email protected]>
Subject: RE: [PATCH 1/3]net/mlx5/hws: support jump FDB RxHi Suanming,
PSB
Quoted 14 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Alex Vesker <[email protected]>
Subject: [PATCH 1/3]net/mlx5/hws: support jump FDB RxBefore FW introduced the
JUMP_FDB_RXaction feature, jump from FDB Tx to Rx is not allowed.JUMP_FDB_RXfeature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.Quoted 8 lines
This commit adds the
JUMP_FDB_RXcap bit check and useJUMP_FDB_RXinstead of FT for dest table FDB Rx case.Signed-off-by Suanming Mou <[email protected]>Signed-off-by Alex Vesker <[email protected]>--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26+++++++++++++++++++++-----
Quoted 7 lines
drivers/net/mlx5/hws/mlx5dr_action.h| 4 ++++drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)
[snip]
Quoted 9 lines
MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX)Review
Quoted 6 lines
&&
(quoted diff) +2
-0+ action->dest_tbl.type == MLX5DR_TABLE_TYPE_FDB_RX) + attr->action_type =
MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX;(quoted diff) +2
-0+ else + attr->action_type =
MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT;
Quoted 5 lines
Fix the long line warnings, same as other places.
Alsomlx5dr_context_cap_stc()seems to contain some calculation inside. If the context and the CAP will not be changed during the runtime on a specific port. Can this CAP BIT checking be done only once and saved for later usage? Since the code is used in the flow insertion.WDYT?
Ack for the line. But mlx5dr_context_cap_stc() is planned as get other caps based on the bit as well. And meanwhile that function is called by action creation, the jump action creation is done inside table creation, it is not in the flow insertion routine, so we are OK here.
Quoted 3 lines
Quoted 3 lines
(quoted diff) +2
-0+ + break;
[snip]
PATCH 2/3 net/mlx5: add jump FDB Rx flag
In reply to Suanming MouWhen jump FDB Rx is supported, flow will be able to jump from FDB Tx to FDB Rx, in that case the dest action in FDB Rx table should support FDB Tx as well.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 ++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_hw.c | 8 +++++++- 5 files changed, 18 insertions(+), 1 deletion(-)
drivers/common/mlx5/mlx5_devx_cmds.c +8 -0
@@ -924,6 +924,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,uint32_t out[MLX5_ST_SZ_DW (query_hca_cap_out)] = {0 };bool hca_cap_2_sup;uint64_t general_obj_types_supported =0 ; +uint64_t stc_action_type_127_64;void *hcattr;int rc, i;
@@ -1352,6 +1353,13 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->fdb_unified_en =MLX5_GET (wqe_based_flow_table_cap, hcattr, fdb_unified_en); + stc_action_type_127_64 =MLX5_GET64 (wqe_based_flow_table_cap, + hcattr, + stc_action_type_127_64); +if (stc_action_type_127_64 & + (1 << (MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX - +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ))) + attr->jump_fdb_rx_en = true; }/* Query HCA attribute for ROCE. */ if (attr->roce) {
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -326,6 +326,7 @@ struct mlx5_hca_attr { uint32_t lag_rx_port_affinity:1; uint32_t wqe_based_flow_table_sup:1; uint32_t fdb_unified_en:1; + uint32_t jump_fdb_rx_en:1;uint8_t max_header_modify_pattern_length;uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5;
drivers/net/mlx5/linux/mlx5_os.c +1 -0
@@ -1718,6 +1718,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->unified_fdb_en = !!priv->master;DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled." , eth_dev->data->port_id, priv->unified_fdb_en ?"is" :"isn't" ); + priv->jump_fdb_rx_en = sh->cdev->config.hca_attr.jump_fdb_rx_en;if (priv->sh->config.dv_esw_en) {uint32_t usable_bits;uint32_t required_bits;
drivers/net/mlx5/mlx5.h +1 -0
@@ -1987,6 +1987,7 @@ struct mlx5_priv { uint32_t num_lag_ports:4; /* Number of ports can be bonded. */ uint32_t tunnel_enabled:1; /* If tunnel offloading is enabled on rxqs. */ uint32_t unified_fdb_en:1; /* Unified FDB flag per port. */ + uint32_t jump_fdb_rx_en:1; /* Jump from FDB Tx to FDB Rx flag per port. */uint16_t domain_id;/* Switch domain identifier. */ uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */
drivers/net/mlx5/mlx5_flow_hw.c +7 -1
@@ -9322,6 +9322,7 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)struct mlx5_flow_group *grp_data;struct mlx5dr_table *tbl =NULL ;struct mlx5dr_action *jump; +uint32_t hws_flags;uint32_t idx =0 ; MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list", attr->transfer ? "FDB" : "NIC", attr->egress ? "egress" : "ingress",
@@ -9342,10 +9343,15 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx) goto error; grp_data->tbl = tbl;if (attr->group) { + hws_flags = mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]; +/* For case of jump from FDB Tx to FDB Rx as it is supported now. */ +if (priv->jump_fdb_rx_en && + dr_tbl_attr.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + hws_flags |=MLX5DR_ACTION_FLAG_HWS_FDB_TX ;/* Jump action be used by non-root table. */ jump =mlx5dr_action_create_dest_table (priv->dr_ctx, tbl, - mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]); + hws_flags);if (!jump) goto error; grp_data->jump.hws_action = jump;
Signature · 1 line
2.34.1
RE: [PATCH 2/3] net/mlx5: add jump FDB Rx flag
Hi
Quoted 45 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 2/3] net/mlx5: add jump FDB Rx flagWhen jump FDB Rx is supported, flow will be able to jump from FDB Tx to FDB Rx, in that case the dest action in FDB Rx table should support FDB Tx as well.
Signed-off-by Suanming Mou <[email protected]>--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 ++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_hw.c | 8 +++++++- 5 files changed, 18 insertions(+), 1 deletion(-)drivers/common/mlx5/mlx5_devx_cmds.c +6
-0@@ -924,6 +924,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,uint32_t out[MLX5_ST_SZ_DW (query_hca_cap_out)] = {0 };bool hca_cap_2_sup;uint64_t general_obj_types_supported =0 ; +uint64_t stc_action_type_127_64;void *hcattr;int rc, i;@@ -1352,6 +1353,13 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->fdb_unified_en =MLX5_GET (wqe_based_flow_table_cap, hcattr, fdb_unified_en); + stc_action_type_127_64 =MLX5_GET64 (wqe_based_flow_table_cap, + hcattr, + stc_action_type_127_64); + if (stc_action_type_127_64 & + (1 <<(
MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX-
drivers/common/mlx5/mlx5_devx_cmds.c mlx5_devx_cmd_query_hca_attr(void *ctx, · line 1362
Quoted 2 lines
drivers/common/mlx5/mlx5_devx_cmds.c +2
-0+ MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX))) + attr->jump_fdb_rx_en = true;
I assume integer value 1 is enough, since it is a bit field, no need to use bool type.
Quoted 21 lines
drivers/common/mlx5/mlx5_devx_cmds.c +0
-0}/* Query HCA attribute for ROCE. */ if (attr->roce) {drivers/common/mlx5/mlx5_devx_cmds.h +1
-0@@ -326,6 +326,7 @@ struct mlx5_hca_attr { uint32_t lag_rx_port_affinity:1; uint32_t wqe_based_flow_table_sup:1; uint32_t fdb_unified_en:1; + uint32_t jump_fdb_rx_en:1;uint8_t max_header_modify_pattern_length;uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5; diff --git
a/drivers/net/mlx5/linux/mlx5_os.cb/drivers/net/mlx5/linux/mlx5_os.cindex9410211e3b..4e64026137100644
drivers/net/mlx5/linux/mlx5_os.c mlx5_dev_spawn(struct rte_device *dpdk_dev, · line 1723
Quoted 6 lines
drivers/net/mlx5/linux/mlx5_os.c +1
-0@@ -1718,6 +1718,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->unified_fdb_en = !!priv->master;DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled." , eth_dev->data->port_id, priv->unified_fdb_en ?"is" :"isn't" ); + priv->jump_fdb_rx_en = sh->cdev- >config.hca_attr.jump_fdb_rx_en;
Can we add some INFO or DEBUG level log to indicate this to the user?
Quoted 50 lines
drivers/net/mlx5/linux/mlx5_os.c +0
-0if (priv->sh->config.dv_esw_en) {drivers/net/mlx5/linux/mlx5_os.c +0
-0uint32_t usable_bits;uint32_t required_bits;drivers/net/mlx5/mlx5.h index renamed from drivers/net/mlx5/mlx5.h +0
-0
f73f6e63ff..545ba48b3c100644drivers/net/mlx5/mlx5.h +0
-0@@ -1987,6 +1987,7 @@ struct mlx5_priv { uint32_t num_lag_ports:4; /* Number of ports can be bonded. */ uint32_t tunnel_enabled:1; /* If tunnel offloading is enabled onrxqs. */
drivers/net/mlx5/mlx5.h +2
-0uint32_t unified_fdb_en:1; /* Unified FDB flag per port. */ + uint32_t jump_fdb_rx_en:1; /* Jump from FDB Tx to FDB Rx flag per +port. */ uint16_t domain_id;/* Switch domain identifier. */ uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */ diff --git
a/drivers/net/mlx5/mlx5_flow_hw.cb/drivers/net/mlx5/mlx5_flow_hw.cindexf0888dbf0e..83f55ed3e8100644drivers/net/mlx5/mlx5_flow_hw.c +1
-0@@ -9322,6 +9322,7 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)struct mlx5_flow_group *grp_data;struct mlx5dr_table *tbl =NULL ;struct mlx5dr_action *jump; +uint32_t hws_flags;uint32_t idx =0 ; MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list", attr->transfer ? "FDB" : "NIC", attr->egress ? "egress" :"ingress", @@ -9342,10 +9343,15 @@
flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)drivers/net/mlx5/mlx5_flow_hw.c +2
-0goto error; grp_data->tbl = tbl;if (attr->group) { + hws_flags = mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]; +/* For case of jump from FDB Tx to FDB Rx as it is supported now. */
drivers/net/mlx5/mlx5_flow_hw.c +4
-2+if (priv->jump_fdb_rx_en && + dr_tbl_attr.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + hws_flags |=MLX5DR_ACTION_FLAG_HWS_FDB_TX ;/* Jump action be used by non-root table. */ jump =mlx5dr_action_create_dest_table (priv->dr_ctx, tbl, - mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]); + hws_flags);if (!jump) goto error; grp_data->jump.hws_action = jump; --2.34.1
RE: [PATCH 2/3] net/mlx5: add jump FDB Rx flag
Quoted 54 lines
-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Wednesday, February 26, 2025 6:38 PM
To: Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH 2/3] net/mlx5: add jump FDB Rx flagHi
Quoted 36 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 2/3] net/mlx5: add jump FDB Rx flagWhen jump FDB Rx is supported, flow will be able to jump from FDB Tx to FDB Rx, in that case the dest action in FDB Rx table should support FDB Tx as well.
Signed-off-by Suanming Mou <[email protected]>--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 ++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_hw.c | 8 +++++++- 5 files changed, 18 insertions(+), 1 deletion(-)drivers/common/mlx5/mlx5_devx_cmds.c +1
-0@@ -924,6 +924,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,uint32_t out[MLX5_ST_SZ_DW (query_hca_cap_out)] = {0 };bool hca_cap_2_sup;uint64_t general_obj_types_supported =0 ; +uint64_t stc_action_type_127_64;void *hcattr;int rc, i;drivers/common/mlx5/mlx5_devx_cmds.c mlx5_devx_cmd_query_hca_attr(void *ctx, · line 1356
Quoted 4 lines
drivers/common/mlx5/mlx5_devx_cmds.c +1
-0@@ -1352,6 +1353,13 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->fdb_unified_en =MLX5_GET (wqe_based_flow_table_cap, hcattr, fdb_unified_en); + stc_action_type_127_64 =MLX5_GET64(wqe_based_flow_table_cap,
Quoted 10 lines
drivers/common/mlx5/mlx5_devx_cmds.c mlx5_devx_cmd_query_hca_attr(void *ctx, · line 1362
Quoted 7 lines
drivers/common/mlx5/mlx5_devx_cmds.c +4
-0+ hcattr, + stc_action_type_127_64); + if (stc_action_type_127_64 & + (1 <<(
MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX-drivers/common/mlx5/mlx5_devx_cmds.c +2
-0+ MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX))) + attr->jump_fdb_rx_en = true;I assume integer value 1 is enough, since it is a bit field, no need to use bool type.
Will change it to 1.
Quoted 27 lines
Quoted 27 lines
drivers/common/mlx5/mlx5_devx_cmds.c +0
-0}/* Query HCA attribute for ROCE. */ if (attr->roce) {drivers/common/mlx5/mlx5_devx_cmds.h +1
-0@@ -326,6 +326,7 @@ struct mlx5_hca_attr { uint32_t lag_rx_port_affinity:1; uint32_t wqe_based_flow_table_sup:1; uint32_t fdb_unified_en:1; + uint32_t jump_fdb_rx_en:1;uint8_t max_header_modify_pattern_length;uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5; diff --git
a/drivers/net/mlx5/linux/mlx5_os.cb/drivers/net/mlx5/linux/mlx5_os.cindex9410211e3b..4e64026137100644drivers/net/mlx5/linux/mlx5_os.c +1
-0@@ -1718,6 +1718,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->unified_fdb_en = !!priv->master;DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled." , eth_dev->data->port_id, priv->unified_fdb_en ?"is" :"isn't" ); + priv->jump_fdb_rx_en = sh->cdev-
Quoted 3 lines
drivers/net/mlx5/linux/mlx5_os.c mlx5_dev_spawn(struct rte_device *dpdk_dev, · line 1723
Quoted 1 line
drivers/net/mlx5/linux/mlx5_os.c +0
-0>config.hca_attr.jump_fdb_rx_en;Can we add some INFO or DEBUG level log to indicate this to the user?
Sure, and I think here we have another improvement as if unified_fdb is not enabled, jump_fdb_rx_en does not make any sense. Will update.
Quoted 52 lines
drivers/net/mlx5/mlx5_flow_hw.c flow_hw_grp_create_cb(void *tool_ctx, void
Quoted 23 lines
drivers/net/mlx5/linux/mlx5_os.c +0
-0if (priv->sh->config.dv_esw_en) {drivers/net/mlx5/linux/mlx5_os.c +0
-0uint32_t usable_bits;uint32_t required_bits;drivers/net/mlx5/mlx5.h index renamed from drivers/net/mlx5/mlx5.h +0
-0
f73f6e63ff..545ba48b3c100644drivers/net/mlx5/mlx5.h +0
-0@@ -1987,6 +1987,7 @@ struct mlx5_priv { uint32_t num_lag_ports:4; /* Number of ports can be bonded. */ uint32_t tunnel_enabled:1; /* If tunnel offloading is enabled onrxqs. */
drivers/net/mlx5/mlx5.h +2
-0uint32_t unified_fdb_en:1; /* Unified FDB flag per port. */ + uint32_t jump_fdb_rx_en:1; /* Jump from FDB Tx to FDB Rx flag per +port. */ uint16_t domain_id;/* Switch domain identifier. */ uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */ diff --git
a/drivers/net/mlx5/mlx5_flow_hw.cb/drivers/net/mlx5/mlx5_flow_hw.cindexf0888dbf0e..83f55ed3e8100644drivers/net/mlx5/mlx5_flow_hw.c +0
-0@@ -9322,6 +9322,7 @@ flow_hw_grp_create_cb(void *tool_ctx, void
*cb_ctx)Quoted 28 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0struct mlx5_flow_group *grp_data;struct mlx5dr_table *tbl =NULL ;struct mlx5dr_action *jump; +uint32_t hws_flags;uint32_t idx =0 ; MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list", attr->transfer ? "FDB" : "NIC", attr->egress ? "egress" :"ingress", @@ -9342,10 +9343,15 @@
flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)drivers/net/mlx5/mlx5_flow_hw.c +2
-0goto error; grp_data->tbl = tbl;if (attr->group) { + hws_flags = mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]; +/* For case of jump from FDB Tx to FDB Rx as it is supported now. */
drivers/net/mlx5/mlx5_flow_hw.c +4
-2+if (priv->jump_fdb_rx_en && + dr_tbl_attr.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + hws_flags |=MLX5DR_ACTION_FLAG_HWS_FDB_TX ;/* Jump action be used by non-root table. */ jump =mlx5dr_action_create_dest_table (priv->dr_ctx, tbl, - mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]); + hws_flags);if (!jump) goto error; grp_data->jump.hws_action = jump; --2.34.1
PATCH 3/3 net/mlx5: allow FDB RSS
In reply to Suanming MouRSS can be used in FDB Rx rules when JUMP_FDB_RX action to allow jump from FDB Tx to FDB Rx table.
Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if JUMP_FDB_RX is supported.
--- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 19 ++++++++++++++----- 3 files changed, 33 insertions(+), 22 deletions(-)
drivers/net/mlx5/mlx5_flow.c +2 -2
@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL ,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev))return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL , +RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER ,NULL ,"non-template mark action not supported for transfer" );return 0 ; }
drivers/net/mlx5/mlx5_flow_dv.c +17 -15
@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION ,NULL , "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress) return rte_flow_error_set(error, EINVAL,
drivers/net/mlx5/mlx5_flow_hw.c +14 -5
@@ -7026,6 +7026,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev,uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask->conf; const struct rte_flow_attr attr = { .ingress = template_attr->ingress,
@@ -7034,7 +7035,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev, };bool masked = queue_mask !=NULL && queue_mask->index; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"QUEUE action supported for ingress only" );
@@ -7053,9 +7054,10 @@ mlx5_hw_validate_action_rss(struct rte_eth_dev *dev, __rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"RSS action supported for ingress only" );
@@ -8104,6 +8106,7 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, }if (priv->sh->config.dv_xmeta_en ==MLX5_XMETA_MODE_META32_HWS && priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |MLX5_FLOW_ACTION_RSS ))) {/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action;
@@ -12112,23 +12115,29 @@ __flow_hw_configure(struct rte_eth_dev *dev,/* Add global actions. */ for (i =0 ; i <MLX5_HW_ACTION_FLAG_MAX ; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +if (unified_fdb) { act_flags |= (mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED ]); -else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ]; + }else { act_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; + } } priv->hw_drop[i] =mlx5dr_action_create_dest_drop (priv->dr_ctx, act_flags);if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; }
Signature · 1 line
2.34.1
RE: [PATCH 3/3] net/mlx5: allow FDB RSS
Quoted 165 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 3/3] net/mlx5: allow FDB RSSRSS can be used in FDB Rx rules when
JUMP_FDB_RXaction to allow jump from FDB Tx to FDB Rx table.Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if
JUMP_FDB_RXis supported.Signed-off-by Suanming Mou <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 19 ++++++++++++++----- 3 files changed, 33 insertions(+), 22 deletions(-)drivers/net/mlx5/mlx5_flow.c +2
-2@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev))return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL , +RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER ,NULL , "non-template mark action not supported for transfer");drivers/net/mlx5/mlx5_flow.c +0
-0return 0 ; }(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindex633c41e358..61d3101ce8100644drivers/net/mlx5/mlx5_flow_dv.c +17
-15@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev, conststruct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION , NULL, "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress)return rte_flow_error_set(error, EINVAL, diff --git
a/drivers/net/mlx5/mlx5_flow_hw.cb/drivers/net/mlx5/mlx5_flow_hw.cindex83f55ed3e8..a063e5ac9c100644drivers/net/mlx5/mlx5_flow_hw.c +1
-0@@ -7026,6 +7026,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev, uint64_t action_flags, struct rte_flow_error *error) { +struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask- >conf;drivers/net/mlx5/mlx5_flow_hw.c +2
-1const struct rte_flow_attr attr = { .ingress = template_attr->ingress,@@ -7034,7 +7035,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev, };bool masked = queue_mask !=NULL && queue_mask->index; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR, NULL, "QUEUE action supported for ingressonly"); @@ -7053,9 +7054,10 @@ mlx5_hw_validate_action_rss(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +4
-1__rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"RSS action supported for ingress only" );@@ -8104,6 +8106,7 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, }if (priv->sh->config.dv_xmeta_en ==MLX5_XMETA_MODE_META32_HWS && priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |MLX5_FLOW_ACTION_RSS ))) {drivers/net/mlx5/mlx5_flow_hw.c +3
-1/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action; @@ -12112,23 +12115,29 @@ __flow_hw_configure(struct rte_eth_dev *dev,/* Add global actions. */ for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +if (unified_fdb) { act_flags |=(mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX] |mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX] |
mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED]);
drivers/net/mlx5/mlx5_flow_hw.c +2
-1-else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX];
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ }else { act_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
drivers/net/mlx5/mlx5_flow_hw.c +2
-0+if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
drivers/net/mlx5/mlx5_flow_hw.c __flow_hw_configure(struct rte_eth_dev *dev, · line 12135
Quoted 2 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ } }
One small question about the TAG action flags in this case. If unified FDB is supported, should only FDB_RX sub-domain of all FDB sub-domains support the TAG? Or FDB_UNI also supports it. And if no unified FDB, will the TAG also be supported in the legacy FDB domain? Can we add some code comments here and update the limitation?
Quoted 12 lines
priv->hw_drop[i] = mlx5dr_action_create_dest_drop(priv-
Quoted 1 line
dr_ctx,act_flags);drivers/net/mlx5/mlx5_flow_hw.c +1
-2if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; } --2.34.1
RE: [PATCH 3/3] net/mlx5: allow FDB RSS
Quoted 180 lines
-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Wednesday, February 26, 2025 6:50 PM
To: Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSSQuoted 29 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 3/3] net/mlx5: allow FDB RSSRSS can be used in FDB Rx rules when
JUMP_FDB_RXaction to allow jump from FDB Tx to FDB Rx table.Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if
JUMP_FDB_RXis supported.Signed-off-by Suanming Mou <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 19 ++++++++++++++----- 3 files changed, 33 insertions(+), 22 deletions(-)(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow.cindex3fbe89a9d4..9c6a4f39fb100644drivers/net/mlx5/mlx5_flow.c mlx5_flow_validate_action_mark(struct · line 1984
Quoted 10 lines
drivers/net/mlx5/mlx5_flow.c +2
-2@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL ,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev)) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL, + RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, NULL, "non-template mark action not supported fortransfer");
Quoted 4 lines
drivers/net/mlx5/mlx5_flow.c +0
-0return 0 ;}
(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindex633c41e358..61d3101ce8100644
drivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_queue(struct
Quoted 47 lines
drivers/net/mlx5/mlx5_flow_dv.c +17
-15@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev,const struct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION , NULL, "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress)return rte_flow_error_set(error, EINVAL, diff --git
a/drivers/net/mlx5/mlx5_flow_hw.cb/drivers/net/mlx5/mlx5_flow_hw.cindex83f55ed3e8..a063e5ac9c100644drivers/net/mlx5/mlx5_flow_hw.c +0
-0@@ -7026,6 +7026,7 @@ mlx5_hw_validate_action_queue(struct
rte_eth_devdrivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_queue(struct
Quoted 9 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0*dev, uint64_t action_flags, struct rte_flow_error *error) { +struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask- >conf;const struct rte_flow_attr attr = {drivers/net/mlx5/mlx5_flow_hw.c +0
-0.ingress = template_attr->ingress,@@ -7034,7 +7035,7 @@ mlx5_hw_validate_action_queue(struct
rte_eth_devdrivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_queue(struct rte_eth_dev *dev,
Quoted 10 lines
drivers/net/mlx5/mlx5_flow_hw.c +2
-1*dev, };bool masked = queue_mask !=NULL && queue_mask->index; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL , "QUEUE action supported for ingress only"); @@-7053,9
drivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_rss(struct rte_eth_dev *dev,
Quoted 13 lines
+7054,10 @@ mlx5_hw_validate_action_rss(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +3
-1__rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL , "RSS action supported for ingress only"); @@-8104,6 +8106,7
drivers/net/mlx5/mlx5_flow_hw.c
Quoted 3 lines
@@ __flow_hw_actions_template_create(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +0
-0} if (priv->sh->config.dv_xmeta_en ==
MLX5_XMETA_MODE_META32_HWS&&drivers/net/mlx5/mlx5_flow_hw.c
Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |
MLX5_FLOW_ACTION_RSS))) {drivers/net/mlx5/mlx5_flow_hw.c +0
-0/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action; @@-12112,23
Quoted 28 lines
+12115,29 @@ __flow_hw_configure(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +2
-1/* Add global actions. */ for (i =0 ; i <MLX5_HW_ACTION_FLAG_MAX ; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +if (unified_fdb) { act_flags |=(mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX] |mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX] |
mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED]);
drivers/net/mlx5/mlx5_flow_hw.c +2
-1-else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX];
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ }else { act_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
drivers/net/mlx5/mlx5_flow_hw.c +2
-0+if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
Quoted 8 lines
drivers/net/mlx5/mlx5_flow_hw.c __flow_hw_configure(struct rte_eth_dev *dev, · line 12135
Quoted 2 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ } }One small question about the TAG action flags in this case. If unified FDB is supported, should only
FDB_RXsub-domain of all FDB sub-domains support the TAG? OrFDB_UNIalso supports it. And if no unified FDB, will the TAG also be supported in the legacy FDB domain? Can we add some code comments here and update the limitation?
Yes, it is allowed only in unified FDB Rx domain. Let's do this.
Quoted 13 lines
Quoted 13 lines
priv->hw_drop[i] = mlx5dr_action_create_dest_drop(priv-
Quoted 1 line
dr_ctx,act_flags);drivers/net/mlx5/mlx5_flow_hw.c +1
-2if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; } --2.34.1
RE: [PATCH 3/3] net/mlx5: allow FDB RSS
Hi
Quoted 206 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, February 26, 2025 9:43 PM
To: Bing Zhao <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSSQuoted 36 lines
-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Wednesday, February 26, 2025 6:50 PM
To: Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: RE: [PATCH 3/3] net/mlx5: allow FDB RSSQuoted 25 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, February 25, 2025 8:45 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH 3/3] net/mlx5: allow FDB RSSRSS can be used in FDB Rx rules when
JUMP_FDB_RXaction to allow jump from FDB Tx to FDB Rx table.Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if
JUMP_FDB_RXis supported.Signed-off-by Suanming Mou <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 19 ++++++++++++++----- 3 files changed, 33 insertions(+), 22 deletions(-)Quoted 15 lines
Quoted 5 lines
(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow.cindex3fbe89a9d4..9c6a4f39fb100644drivers/net/mlx5/mlx5_flow.c mlx5_flow_validate_action_mark(struct · line 1984
Quoted 10 lines
drivers/net/mlx5/mlx5_flow.c +2
-2@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL ,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev)) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL, + RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, NULL, "non-template mark action not supportedfor
Quoted 68 lines
transfer");
Quoted 4 lines
drivers/net/mlx5/mlx5_flow.c +0
-0return 0 ;}
(quoted diff) +0
-0
b/drivers/net/mlx5/mlx5_flow_dv.cindex633c41e358..61d3101ce8100644
drivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_queue(struct
Quoted 47 lines
drivers/net/mlx5/mlx5_flow_dv.c +17
-15@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev,const struct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION , NULL, "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress)return rte_flow_error_set(error, EINVAL, diff --git
a/drivers/net/mlx5/mlx5_flow_hw.cb/drivers/net/mlx5/mlx5_flow_hw.cindex83f55ed3e8..a063e5ac9c100644drivers/net/mlx5/mlx5_flow_hw.c +0
-0@@ -7026,6 +7026,7 @@ mlx5_hw_validate_action_queue(struct
rte_eth_devQuoted 9 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0*dev, uint64_t action_flags, struct rte_flow_error *error) { +struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask- >conf;const struct rte_flow_attr attr = {.ingress =
template_attr->ingress, @@ -7034,7 +7035,7 @@
mlx5_hw_validate_action_queue(struct
rte_eth_devQuoted 4 lines
*dev,
drivers/net/mlx5/mlx5_flow_hw.c +0
-0};bool masked = queue_mask !=NULL && queue_mask->index;Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_queue(struct rte_eth_dev *dev,
Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c +2
-1-if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR, NULL, "QUEUE action supported for ingressonly"); @@
Quoted 8 lines
-7053,9
Quoted 7 lines
+7054,10 @@ mlx5_hw_validate_action_rss(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +1
-0__rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf;Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c mlx5_hw_validate_action_rss(struct rte_eth_dev *dev, · line 7063
Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c +2
-1-if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && +!priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"RSS action supported for ingress only" );@@
Quoted 40 lines
-8104,6 +8106,7
drivers/net/mlx5/mlx5_flow_hw.c
Quoted 3 lines
@@ __flow_hw_actions_template_create(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +0
-0} if (priv->sh->config.dv_xmeta_en ==
MLX5_XMETA_MODE_META32_HWS&&drivers/net/mlx5/mlx5_flow_hw.c
Quoted 6 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |
MLX5_FLOW_ACTION_RSS))) {drivers/net/mlx5/mlx5_flow_hw.c +0
-0/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action; @@-12112,23
Quoted 28 lines
+12115,29 @@ __flow_hw_configure(struct
rte_eth_dev*dev,drivers/net/mlx5/mlx5_flow_hw.c +2
-1/* Add global actions. */ for (i =0 ; i <MLX5_HW_ACTION_FLAG_MAX ; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +if (unified_fdb) { act_flags |=(mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX] |mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX] |
mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED]);
drivers/net/mlx5/mlx5_flow_hw.c +2
-1-else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX];
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ }else { act_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
drivers/net/mlx5/mlx5_flow_hw.c +2
-0+if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |=mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB];
Quoted 8 lines
drivers/net/mlx5/mlx5_flow_hw.c __flow_hw_configure(struct rte_eth_dev *dev, · line 12135
Quoted 2 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-0+ } }One small question about the TAG action flags in this case. If unified FDB is supported, should only
FDB_RXsub-domain of all FDB sub-domains support the TAG? OrFDB_UNIalso supports it. And if no unified FDB, will the TAG also be supported in the legacy FDB domain? Can we add some code comments here and update the limitation?Yes, it is allowed only in unified FDB Rx domain. Let's do this.
Quoted 3 lines
Quoted 3 lines
priv->hw_drop[i] = mlx5dr_action_create_dest_drop(priv-
Quoted 1 line
dr_ctx,act_flags);
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
drivers/net/mlx5/mlx5_flow_hw.c +1
-2if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; } --2.34.1
This should be with V2 version prefix.
Series Acked-by: Bing Zhao <[email protected]>
v2 cover net/mlx5: support jump FDB Rx
In reply to Suanming MouBefore FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This series adds the jump from FDB Tx to FDB Rx support and allows RSS action in FDB domain rule when jump FDB Rx is supported.
Suanming Mou (3):
net/mlx5/hws: support jump FDB Rx
net/mlx5: add jump FDB Rx flag
net/mlx5: allow FDB RSS
doc/guides/nics/mlx5.rst | 4 ++++ drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 9 +++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 ++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ drivers/net/mlx5/linux/mlx5_os.c | 9 ++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++++++++------------- drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++----- 15 files changed, 125 insertions(+), 31 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/3 net/mlx5/hws: support jump FDB Rx
Before FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This commit adds the JUMP_FDB_RX cap bit check and use JUMP_FDB_RX instead of FT for dest table FDB Rx case.
---
v2: fix line lengh.
--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)
drivers/common/mlx5/mlx5_prm.h +8 -1
@@ -2466,7 +2466,8 @@ struct mlx5_ifc_wqe_based_flow_table_cap_bits {u8 reserved_at_60[0x8 ];u8 max_header_modify_pattern_length[0x8 ];u8 ste_format[0x10 ]; -u8 stc_action_type[0x80 ]; +u8 stc_action_type_63_0[0x40 ]; +u8 stc_action_type_127_64[0x40 ];u8 header_insert_type[0x10 ];u8 header_remove_type[0x10 ];u8 trivial_match_definer[0x20 ];
@@ -3543,6 +3544,11 @@ enum mlx5_ifc_rtc_reparse_mode { MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, }; +enum mlx5_ifc_stc_action_type_bit_index { +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX =64 , +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX =71 , +}; +#define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16struct mlx5_ifc_rtc_bits {
@@ -3621,6 +3627,7 @@ enum mlx5_ifc_stc_action_type {MLX5_IFC_STC_ACTION_TYPE_ALLOW =0x84 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT =0x85 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK =0x86 , + MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX = 0x87, }; enum mlx5_ifc_stc_reparse_mode {
drivers/net/mlx5/hws/mlx5dr_action.c +21 -5
@@ -803,6 +803,9 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[],switch (action->type) {case MLX5DR_ACTION_TYP_TBL : + attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; + attr[i].obj = action->dest_tbl.devx_obj->obj; +break ;case MLX5DR_ACTION_TYP_TIR : attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; attr[i].obj = action->devx_obj;
@@ -1097,6 +1100,17 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, }break ;case MLX5DR_ACTION_TYP_TBL : + attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ; + attr->dest_table_id = obj->id; +/* Only for unified FDB Rx case */ +if (mlx5dr_context_cap_stc (action->ctx, +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX ) && + action->dest_tbl.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX ; +else + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; + +break ;case MLX5DR_ACTION_TYP_DEST_ARRAY : attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ;
@@ -1419,17 +1433,19 @@ mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx,if (!action)return NULL ; + action->dest_tbl.type = tbl->type; +if (mlx5dr_action_is_root_flags (flags)) {if (mlx5dr_context_shared_gvmi_used (ctx)) - action->devx_obj = tbl->local_ft->obj; + action->dest_tbl.devx_obj = tbl->local_ft;else - action->devx_obj = tbl->ft->obj; + action->dest_tbl.devx_obj = tbl->ft; }else { + action->dest_tbl.devx_obj = tbl->ft; + ret =mlx5dr_action_create_stcs (action, tbl->ft);if (ret) goto free_action; - - action->devx_dest.devx_obj = tbl->ft; }return action;
@@ -2526,7 +2542,7 @@ mlx5dr_action_create_dest_array(struct mlx5dr_context *ctx,case MLX5DR_ACTION_TYP_TBL : dest_list[i].destination_type =MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE ; - dest_list[i].destination_id = dests[i].dest->devx_dest.devx_obj->id; + dest_list[i].destination_id = dests[i].dest->dest_tbl.devx_obj->id; fte_attr.action_flags |=MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ; fte_attr.ignore_flow_level =1 ;break ;
drivers/net/mlx5/hws/mlx5dr_action.h +4 -0
@@ -226,6 +226,10 @@ struct mlx5dr_action {struct {struct mlx5dr_matcher *matcher; } jump_to_matcher; +struct { +struct mlx5dr_devx_obj *devx_obj; +enum mlx5dr_table_type type; + } dest_tbl; }; };
drivers/net/mlx5/hws/mlx5dr_cmd.c +9 -0
@@ -466,6 +466,7 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr,MLX5_SET (stc_ste_param_tir, stc_param, tirn, stc_attr->dest_tir_num);break ;case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT : +case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX :MLX5_SET (stc_ste_param_table, stc_param, table_id, stc_attr->dest_table_id);break ;case MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST :
@@ -1280,6 +1281,14 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, caps->fdb_unified_en =MLX5_GET (query_hca_cap_out, out, capability.wqe_based_flow_table_cap. fdb_unified_en); + + caps->stc_action_type_63_0 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_63_0); + + caps->stc_action_type_127_64 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_127_64); }if (caps->eswitch_manager) {
drivers/net/mlx5/hws/mlx5dr_cmd.h +2 -0
@@ -250,6 +250,8 @@ struct mlx5dr_cmd_query_caps {bool roce;uint16_t roce_max_src_udp_port;uint16_t roce_min_src_udp_port; +uint64_t stc_action_type_63_0; +uint64_t stc_action_type_127_64;bool fdb_unified_en; };
drivers/net/mlx5/hws/mlx5dr_context.c +17 -0
@@ -140,6 +140,23 @@ static int mlx5dr_context_uninit_pd(struct mlx5dr_context *ctx)return 0 ; } +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit) +{ +uint32_t test_bit = bit; + +if (bit >=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ) + test_bit -=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ; + +switch (bit) { +case MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX : +return ctx->caps->stc_action_type_127_64 & (0x1ull << test_bit); +default : +break ; + } + +return false; +} +static void mlx5dr_context_check_hws_supp (struct mlx5dr_context *ctx) {struct mlx5dr_cmd_query_caps *caps = ctx->caps;
drivers/net/mlx5/hws/mlx5dr_context.h +2 -0
@@ -75,4 +75,6 @@ uint8_t mlx5dr_context_get_reparse_mode(struct mlx5dr_context *ctx);void mlx5dr_context_set_pool_tbl_attr (struct mlx5dr_pool_attr *attr,enum mlx5dr_table_type table_type); +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit); +#endif /* MLX5DR_CONTEXT_H_ */
Signature · 1 line
2.34.1
RE: [PATCH v2 1/3] net/mlx5/hws: support jump FDB Rx
Quoted 248 lines
-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, February 26, 2025 10:01 PM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Alex Vesker <[email protected]>
Subject: [PATCH v2 1/3]net/mlx5/hws: support jump FDB RxBefore FW introduced the
JUMP_FDB_RXaction feature, jump from FDB Tx to Rx is not allowed.JUMP_FDB_RXfeature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.This commit adds the
JUMP_FDB_RXcap bit check and useJUMP_FDB_RXinstead of FT for dest table FDB Rx case.Signed-off-by Suanming Mou <[email protected]>Signed-off-by Alex Vesker <[email protected]>---
v2: fix line lengh.
--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/drivers/common/mlx5/mlx5_prm.hindex3fc3b0cd2a..84e3347794100644drivers/common/mlx5/mlx5_prm.h +7
-1@@ -2466,7 +2466,8 @@ struct mlx5_ifc_wqe_based_flow_table_cap_bits {u8 reserved_at_60[0x8 ];u8 max_header_modify_pattern_length[0x8 ];u8 ste_format[0x10 ]; -u8 stc_action_type[0x80 ]; +u8 stc_action_type_63_0[0x40 ]; +u8 stc_action_type_127_64[0x40 ];u8 header_insert_type[0x10 ];u8 header_remove_type[0x10 ];u8 trivial_match_definer[0x20 ];@@ -3543,6 +3544,11 @@ enum mlx5_ifc_rtc_reparse_mode { MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, }; +enum mlx5_ifc_stc_action_type_bit_index { +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX =64 , +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX =71 , }; +#define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16struct mlx5_ifc_rtc_bits {@@ -3621,6 +3627,7 @@ enum mlx5_ifc_stc_action_type {MLX5_IFC_STC_ACTION_TYPE_ALLOW =0x84 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT =0x85 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK =0x86 , + MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX = 0x87, }; enum mlx5_ifc_stc_reparse_mode {drivers/net/mlx5/hws/mlx5dr_action.c +3
-0@@ -803,6 +803,9 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[], switch (action->type) {case MLX5DR_ACTION_TYP_TBL : + attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; + attr[i].obj = action->dest_tbl.devx_obj->obj; +break ;case MLX5DR_ACTION_TYP_TIR : attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ;drivers/net/mlx5/hws/mlx5dr_action.c +5
-0attr[i].obj = action->devx_obj;@@ -1097,6 +1100,17 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, }break ;case MLX5DR_ACTION_TYP_TBL : + attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ; + attr->dest_table_id = obj->id; +/* Only for unified FDB Rx case */ +if (mlx5dr_context_cap_stc (action->ctx, + MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX)&&
drivers/net/mlx5/hws/mlx5dr_action.c +2
-0+ action->dest_tbl.type == MLX5DR_TABLE_TYPE_FDB_RX) + attr->action_type =
MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX;drivers/net/mlx5/hws/mlx5dr_action.c +12
-5+else + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; + +break ;case MLX5DR_ACTION_TYP_DEST_ARRAY : attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; @@ -1419,17 +1433,19 @@ mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx, if (!action) return NULL; + action->dest_tbl.type = tbl->type; +if (mlx5dr_action_is_root_flags (flags)) {if (mlx5dr_context_shared_gvmi_used (ctx)) - action->devx_obj = tbl->local_ft->obj; + action->dest_tbl.devx_obj = tbl->local_ft;else - action->devx_obj = tbl->ft->obj; + action->dest_tbl.devx_obj = tbl->ft; }else { + action->dest_tbl.devx_obj = tbl->ft; + ret =mlx5dr_action_create_stcs (action, tbl->ft);if (ret) goto free_action; - - action->devx_dest.devx_obj = tbl->ft; }return action;@@ -2526,7 +2542,7 @@ mlx5dr_action_create_dest_array(structmlx5dr_context *ctx, case MLX5DR_ACTION_TYP_TBL: dest_list[i].destination_type =MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE ; - dest_list[i].destination_id = dests[i].dest- >devx_dest.devx_obj->id; + dest_list[i].destination_id = dests[i].dest- >dest_tbl.devx_obj->id;fte_attr.action_flags |=
MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;drivers/net/mlx5/hws/mlx5dr_action.c +0
-0fte_attr.ignore_flow_level =1 ;break ;drivers/net/mlx5/hws/mlx5dr_action.h +4
-0@@ -226,6 +226,10 @@ struct mlx5dr_action {struct {struct mlx5dr_matcher *matcher; } jump_to_matcher; +struct { +struct mlx5dr_devx_obj *devx_obj; +enum mlx5dr_table_type type; + } dest_tbl; }; };drivers/net/mlx5/hws/mlx5dr_cmd.c +1
-0@@ -466,6 +466,7 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr,MLX5_SET (stc_ste_param_tir, stc_param, tirn, stc_attr- >dest_tir_num);break ;case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT : +case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX : MLX5_SET(stc_ste_param_table, stc_param, table_id, stc_attr-Quoted 1 line
dest_table_id);drivers/net/mlx5/hws/mlx5dr_cmd.c +8
-0break ;case MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST :@@ -1280,6 +1281,14 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, caps->fdb_unified_en =MLX5_GET (query_hca_cap_out, out, capability.wqe_based_flow_table_cap. fdb_unified_en); + + caps->stc_action_type_63_0 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_63_0); + + caps->stc_action_type_127_64 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_127_64); }drivers/net/mlx5/hws/mlx5dr_cmd.c +0
-0if (caps->eswitch_manager) {drivers/net/mlx5/hws/mlx5dr_cmd.h +2
-0@@ -250,6 +250,8 @@ struct mlx5dr_cmd_query_caps {bool roce;uint16_t roce_max_src_udp_port;uint16_t roce_min_src_udp_port; +uint64_t stc_action_type_63_0; +uint64_t stc_action_type_127_64;bool fdb_unified_en; };drivers/net/mlx5/hws/mlx5dr_context.c +16
-0@@ -140,6 +140,23 @@ static int mlx5dr_context_uninit_pd(struct mlx5dr_context *ctx)return 0 ; } +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit) { +uint32_t test_bit = bit; + +if (bit >=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ) + test_bit -=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ; + +switch (bit) { +case MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX : +return ctx->caps->stc_action_type_127_64 & (0x1ull << test_bit); +default : +break ; + } + +return false; +} +static void mlx5dr_context_check_hws_supp (struct mlx5dr_context *ctx) { struct mlx5dr_cmd_query_caps *caps = ctx->caps; diff --git
a/drivers/net/mlx5/hws/mlx5dr_context.hb/drivers/net/mlx5/hws/mlx5dr_context.h
indexe89a093c77..deb7196e39100644drivers/net/mlx5/hws/mlx5dr_context.h +0
-0@@ -75,4 +75,6 @@ uint8_t mlx5dr_context_get_reparse_mode(struct
mlx5dr_context*ctx); void mlx5dr_context_set_pool_tbl_attr(structmlx5dr_pool_attr*attr,drivers/net/mlx5/hws/mlx5dr_context.h +2
-1enum mlx5dr_table_type table_type); +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit); +#endif /* MLX5DR_CONTEXT_H_ */ --
Quoted 1 line
2.34.1
PATCH v2 2/3 net/mlx5: add jump FDB Rx flag
In reply to Suanming MouWhen jump FDB Rx is supported, flow will be able to jump from FDB Tx to FDB Rx, in that case the dest action in FDB Rx table should support FDB Tx as well.
---
v2: fix bool and update log info.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 ++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 9 +++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_hw.c | 8 +++++++- 5 files changed, 24 insertions(+), 3 deletions(-)
drivers/common/mlx5/mlx5_devx_cmds.c +8 -0
@@ -924,6 +924,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,uint32_t out[MLX5_ST_SZ_DW (query_hca_cap_out)] = {0 };bool hca_cap_2_sup;uint64_t general_obj_types_supported =0 ; +uint64_t stc_action_type_127_64;void *hcattr;int rc, i;
@@ -1352,6 +1353,13 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->fdb_unified_en =MLX5_GET (wqe_based_flow_table_cap, hcattr, fdb_unified_en); + stc_action_type_127_64 =MLX5_GET64 (wqe_based_flow_table_cap, + hcattr, + stc_action_type_127_64); +if (stc_action_type_127_64 & + (1 << (MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX - +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ))) + attr->jump_fdb_rx_en =1 ; }/* Query HCA attribute for ROCE. */ if (attr->roce) {
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -326,6 +326,7 @@ struct mlx5_hca_attr { uint32_t lag_rx_port_affinity:1; uint32_t wqe_based_flow_table_sup:1; uint32_t fdb_unified_en:1; + uint32_t jump_fdb_rx_en:1;uint8_t max_header_modify_pattern_length;uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5;
drivers/net/mlx5/linux/mlx5_os.c +7 -2
@@ -1716,8 +1716,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,* 4. all representors in HWS */ priv->unified_fdb_en = !!priv->master; -DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled." , - eth_dev->data->port_id, priv->unified_fdb_en ?"is" :"isn't" ); +/* Jump FDB Rx works only with unified FDB enabled. */ +if (priv->unified_fdb_en) + priv->jump_fdb_rx_en = sh->cdev->config.hca_attr.jump_fdb_rx_en; +DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled, jump_fdb_rx %s enabled." , + eth_dev->data->port_id, + priv->unified_fdb_en ?"is" :"isn't" , + priv->jump_fdb_rx_en ?"is" :"isn't" );if (priv->sh->config.dv_esw_en) {uint32_t usable_bits;uint32_t required_bits;
drivers/net/mlx5/mlx5.h +1 -0
@@ -1987,6 +1987,7 @@ struct mlx5_priv { uint32_t num_lag_ports:4; /* Number of ports can be bonded. */ uint32_t tunnel_enabled:1; /* If tunnel offloading is enabled on rxqs. */ uint32_t unified_fdb_en:1; /* Unified FDB flag per port. */ + uint32_t jump_fdb_rx_en:1; /* Jump from FDB Tx to FDB Rx flag per port. */uint16_t domain_id;/* Switch domain identifier. */ uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */
drivers/net/mlx5/mlx5_flow_hw.c +7 -1
@@ -9350,6 +9350,7 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)struct mlx5_flow_group *grp_data;struct mlx5dr_table *tbl =NULL ;struct mlx5dr_action *jump; +uint32_t hws_flags;uint32_t idx =0 ; MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list", attr->transfer ? "FDB" : "NIC", attr->egress ? "egress" : "ingress",
@@ -9370,10 +9371,15 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx) goto error; grp_data->tbl = tbl;if (attr->group) { + hws_flags = mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]; +/* For case of jump from FDB Tx to FDB Rx as it is supported now. */ +if (priv->jump_fdb_rx_en && + dr_tbl_attr.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + hws_flags |=MLX5DR_ACTION_FLAG_HWS_FDB_TX ;/* Jump action be used by non-root table. */ jump =mlx5dr_action_create_dest_table (priv->dr_ctx, tbl, - mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]); + hws_flags);if (!jump) goto error; grp_data->jump.hws_action = jump;
Signature · 1 line
2.34.1
PATCH v2 3/3 net/mlx5: allow FDB RSS
In reply to Suanming MouRSS can be used in FDB Rx rules when JUMP_FDB_RX action to allow jump from FDB Tx to FDB Rx table.
Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if JUMP_FDB_RX is supported.
---
v2: update limitation.
--- doc/guides/nics/mlx5.rst | 4 ++++ drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 20 +++++++++++++++----- 4 files changed, 38 insertions(+), 22 deletions(-)
doc/guides/nics/mlx5.rst +4 -0
@@ -968,6 +968,10 @@ Limitations The flow engine of a process cannot move from active to standby mode if preceding active application rules are still present and vice versa. +- Since only when unified FDB is enabled, there will be FDB Rx/Tx, jump FDB Rx + is valid only when unfied is enabled. And in unified FDB mode, the tag and RSS + actions are only allowed in FDB Rx domain. + Statistics ----------
drivers/net/mlx5/mlx5_flow.c +2 -2
@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL ,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev))return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL , +RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER ,NULL ,"non-template mark action not supported for transfer" );return 0 ; }
drivers/net/mlx5/mlx5_flow_dv.c +17 -15
@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION ,NULL , "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress) return rte_flow_error_set(error, EINVAL,
drivers/net/mlx5/mlx5_flow_hw.c +15 -5
@@ -7036,6 +7036,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev,uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask->conf; const struct rte_flow_attr attr = { .ingress = template_attr->ingress,
@@ -7044,7 +7045,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev, };bool masked = queue_mask !=NULL && queue_mask->index; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"QUEUE action supported for ingress only" );
@@ -7063,9 +7064,10 @@ mlx5_hw_validate_action_rss(struct rte_eth_dev *dev, __rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"RSS action supported for ingress only" );
@@ -8114,6 +8116,7 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, }if (priv->sh->config.dv_xmeta_en ==MLX5_XMETA_MODE_META32_HWS && priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |MLX5_FLOW_ACTION_RSS ))) {/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action;
@@ -12140,23 +12143,30 @@ __flow_hw_configure(struct rte_eth_dev *dev,/* Add global actions. */ for (i =0 ; i <MLX5_HW_ACTION_FLAG_MAX ; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +/* Tag action is valid only in FDB_Rx domain. */ +if (unified_fdb) { act_flags |= (mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED ]); -else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ]; + }else { act_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; + } } priv->hw_drop[i] =mlx5dr_action_create_dest_drop (priv->dr_ctx, act_flags);if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; }
Signature · 1 line
2.34.1
v3 cover net/mlx5: support jump FDB Rx
In reply to Suanming MouBefore FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This series adds the jump from FDB Tx to FDB Rx support and allows RSS action in FDB domain rule when jump FDB Rx is supported.
v3:
- Rebased on v2 of mlx5 Unified FDB patches (series 34723)
Suanming Mou (3):
net/mlx5/hws: support jump FDB Rx
net/mlx5: add jump FDB Rx flag
net/mlx5: allow FDB RSS
doc/guides/nics/mlx5.rst | 4 ++++ drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 9 +++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 ++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ drivers/net/mlx5/linux/mlx5_os.c | 9 ++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++++++++------------- drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++----- 15 files changed, 125 insertions(+), 31 deletions(-)
--
2.39.5
PATCH v3 1/3 net/mlx5/hws: support jump FDB Rx
From: Suanming Mou <[email protected]>
Before FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This commit adds the JUMP_FDB_RX cap bit check and use JUMP_FDB_RX instead of FT for dest table FDB Rx case.
--- drivers/common/mlx5/mlx5_prm.h | 9 ++++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 +++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 +++++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ 7 files changed, 63 insertions(+), 6 deletions(-)
drivers/common/mlx5/mlx5_prm.h +8 -1
@@ -2466,7 +2466,8 @@ struct mlx5_ifc_wqe_based_flow_table_cap_bits {u8 reserved_at_60[0x8 ];u8 max_header_modify_pattern_length[0x8 ];u8 ste_format[0x10 ]; -u8 stc_action_type[0x80 ]; +u8 stc_action_type_63_0[0x40 ]; +u8 stc_action_type_127_64[0x40 ];u8 header_insert_type[0x10 ];u8 header_remove_type[0x10 ];u8 trivial_match_definer[0x20 ];
@@ -3543,6 +3544,11 @@ enum mlx5_ifc_rtc_reparse_mode { MLX5_IFC_RTC_REPARSE_BY_STC = 0x2, }; +enum mlx5_ifc_stc_action_type_bit_index { +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX =64 , +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX =71 , +}; +#define MLX5_IFC_RTC_LINEAR_LOOKUP_TBL_LOG_MAX 16struct mlx5_ifc_rtc_bits {
@@ -3621,6 +3627,7 @@ enum mlx5_ifc_stc_action_type {MLX5_IFC_STC_ACTION_TYPE_ALLOW =0x84 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_VPORT =0x85 ,MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_UPLINK =0x86 , + MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX = 0x87, }; enum mlx5_ifc_stc_reparse_mode {
drivers/net/mlx5/hws/mlx5dr_action.c +21 -5
@@ -803,6 +803,9 @@ int mlx5dr_action_root_build_attr(struct mlx5dr_rule_action rule_actions[],switch (action->type) {case MLX5DR_ACTION_TYP_TBL : + attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; + attr[i].obj = action->dest_tbl.devx_obj->obj; +break ;case MLX5DR_ACTION_TYP_TIR : attr[i].type =MLX5DV_FLOW_ACTION_DEST_DEVX ; attr[i].obj = action->devx_obj;
@@ -1097,6 +1100,17 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, }break ;case MLX5DR_ACTION_TYP_TBL : + attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ; + attr->dest_table_id = obj->id; +/* Only for unified FDB Rx case */ +if (mlx5dr_context_cap_stc (action->ctx, +MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX ) && + action->dest_tbl.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX ; +else + attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; + +break ;case MLX5DR_ACTION_TYP_DEST_ARRAY : attr->action_type =MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT ; attr->action_offset =MLX5DR_ACTION_OFFSET_HIT ;
@@ -1419,17 +1433,19 @@ mlx5dr_action_create_dest_table(struct mlx5dr_context *ctx,if (!action)return NULL ; + action->dest_tbl.type = tbl->type; +if (mlx5dr_action_is_root_flags (flags)) {if (mlx5dr_context_shared_gvmi_used (ctx)) - action->devx_obj = tbl->local_ft->obj; + action->dest_tbl.devx_obj = tbl->local_ft;else - action->devx_obj = tbl->ft->obj; + action->dest_tbl.devx_obj = tbl->ft; }else { + action->dest_tbl.devx_obj = tbl->ft; + ret =mlx5dr_action_create_stcs (action, tbl->ft);if (ret) goto free_action; - - action->devx_dest.devx_obj = tbl->ft; }return action;
@@ -2526,7 +2542,7 @@ mlx5dr_action_create_dest_array(struct mlx5dr_context *ctx,case MLX5DR_ACTION_TYP_TBL : dest_list[i].destination_type =MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE ; - dest_list[i].destination_id = dests[i].dest->devx_dest.devx_obj->id; + dest_list[i].destination_id = dests[i].dest->dest_tbl.devx_obj->id; fte_attr.action_flags |=MLX5_FLOW_CONTEXT_ACTION_FWD_DEST ; fte_attr.ignore_flow_level =1 ;break ;
drivers/net/mlx5/hws/mlx5dr_action.h +4 -0
@@ -226,6 +226,10 @@ struct mlx5dr_action {struct {struct mlx5dr_matcher *matcher; } jump_to_matcher; +struct { +struct mlx5dr_devx_obj *devx_obj; +enum mlx5dr_table_type type; + } dest_tbl; }; };
drivers/net/mlx5/hws/mlx5dr_cmd.c +9 -0
@@ -470,6 +470,7 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr,MLX5_SET (stc_ste_param_tir, stc_param, tirn, stc_attr->dest_tir_num);break ;case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT : +case MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FLOW_TABLE_FDB_RX :MLX5_SET (stc_ste_param_table, stc_param, table_id, stc_attr->dest_table_id);break ;case MLX5_IFC_STC_ACTION_TYPE_ACC_MODIFY_LIST :
@@ -1284,6 +1285,14 @@ int mlx5dr_cmd_query_caps(struct ibv_context *ctx, caps->fdb_unified_en =MLX5_GET (query_hca_cap_out, out, capability.wqe_based_flow_table_cap. fdb_unified_en); + + caps->stc_action_type_63_0 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_63_0); + + caps->stc_action_type_127_64 =MLX5_GET64 (query_hca_cap_out, + out, + capability.wqe_based_flow_table_cap.stc_action_type_127_64); }if (caps->eswitch_manager) {
drivers/net/mlx5/hws/mlx5dr_cmd.h +2 -0
@@ -250,6 +250,8 @@ struct mlx5dr_cmd_query_caps {bool roce;uint16_t roce_max_src_udp_port;uint16_t roce_min_src_udp_port; +uint64_t stc_action_type_63_0; +uint64_t stc_action_type_127_64;bool fdb_unified_en; };
drivers/net/mlx5/hws/mlx5dr_context.c +17 -0
@@ -140,6 +140,23 @@ static int mlx5dr_context_uninit_pd(struct mlx5dr_context *ctx)return 0 ; } +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit) +{ +uint32_t test_bit = bit; + +if (bit >=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ) + test_bit -=MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ; + +switch (bit) { +case MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX : +return ctx->caps->stc_action_type_127_64 & (0x1ull << test_bit); +default : +break ; + } + +return false; +} +static void mlx5dr_context_check_hws_supp (struct mlx5dr_context *ctx) {struct mlx5dr_cmd_query_caps *caps = ctx->caps;
drivers/net/mlx5/hws/mlx5dr_context.h +2 -0
@@ -75,4 +75,6 @@ uint8_t mlx5dr_context_get_reparse_mode(struct mlx5dr_context *ctx);void mlx5dr_context_set_pool_tbl_attr (struct mlx5dr_pool_attr *attr,enum mlx5dr_table_type table_type); +bool mlx5dr_context_cap_stc (struct mlx5dr_context *ctx,uint32_t bit); +#endif /* MLX5DR_CONTEXT_H_ */
Signature · 1 line
2.39.5
PATCH v3 2/3 net/mlx5: add jump FDB Rx flag
In reply to Dariusz SosnowskiFrom: Suanming Mou <[email protected]>
When jump FDB Rx is supported, flow will be able to jump from FDB Tx to FDB Rx, in that case the dest action in FDB Rx table should support FDB Tx as well.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 ++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 9 +++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_hw.c | 8 +++++++- 5 files changed, 24 insertions(+), 3 deletions(-)
drivers/common/mlx5/mlx5_devx_cmds.c +8 -0
@@ -924,6 +924,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,uint32_t out[MLX5_ST_SZ_DW (query_hca_cap_out)] = {0 };bool hca_cap_2_sup;uint64_t general_obj_types_supported =0 ; +uint64_t stc_action_type_127_64;void *hcattr;int rc, i;
@@ -1352,6 +1353,13 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->fdb_unified_en =MLX5_GET (wqe_based_flow_table_cap, hcattr, fdb_unified_en); + stc_action_type_127_64 =MLX5_GET64 (wqe_based_flow_table_cap, + hcattr, + stc_action_type_127_64); +if (stc_action_type_127_64 & + (1 << (MLX5_IFC_STC_ACTION_TYPE_JUMP_FLOW_TABLE_FDB_RX_BIT_INDEX - +MLX5_IFC_STC_ACTION_TYPE_BIT_64_INDEX ))) + attr->jump_fdb_rx_en =1 ; }/* Query HCA attribute for ROCE. */ if (attr->roce) {
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -326,6 +326,7 @@ struct mlx5_hca_attr { uint32_t lag_rx_port_affinity:1; uint32_t wqe_based_flow_table_sup:1; uint32_t fdb_unified_en:1; + uint32_t jump_fdb_rx_en:1;uint8_t max_header_modify_pattern_length;uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5;
drivers/net/mlx5/linux/mlx5_os.c +7 -2
@@ -1716,8 +1716,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,* 4. all representors in HWS */ priv->unified_fdb_en = !!priv->master && sh->cdev->config.hca_attr.fdb_unified_en; -DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled." , - eth_dev->data->port_id, priv->unified_fdb_en ?"is" :"isn't" ); +/* Jump FDB Rx works only with unified FDB enabled. */ +if (priv->unified_fdb_en) + priv->jump_fdb_rx_en = sh->cdev->config.hca_attr.jump_fdb_rx_en; +DRV_LOG (DEBUG ,"port %u: unified FDB %s enabled, jump_fdb_rx %s enabled." , + eth_dev->data->port_id, + priv->unified_fdb_en ?"is" :"isn't" , + priv->jump_fdb_rx_en ?"is" :"isn't" );if (priv->sh->config.dv_esw_en) {uint32_t usable_bits;uint32_t required_bits;
drivers/net/mlx5/mlx5.h +1 -0
@@ -1987,6 +1987,7 @@ struct mlx5_priv { uint32_t num_lag_ports:4; /* Number of ports can be bonded. */ uint32_t tunnel_enabled:1; /* If tunnel offloading is enabled on rxqs. */ uint32_t unified_fdb_en:1; /* Unified FDB flag per port. */ + uint32_t jump_fdb_rx_en:1; /* Jump from FDB Tx to FDB Rx flag per port. */uint16_t domain_id;/* Switch domain identifier. */ uint16_t vport_id;/* Associated VF vport index (if any). */ uint32_t vport_meta_tag;/* Used for vport index match ove VF LAG. */
drivers/net/mlx5/mlx5_flow_hw.c +7 -1
@@ -9350,6 +9350,7 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx)struct mlx5_flow_group *grp_data;struct mlx5dr_table *tbl =NULL ;struct mlx5dr_action *jump; +uint32_t hws_flags;uint32_t idx =0 ; MKSTR(matcher_name, "%s_%s_%u_%u_matcher_list", attr->transfer ? "FDB" : "NIC", attr->egress ? "egress" : "ingress",
@@ -9370,10 +9371,15 @@ flow_hw_grp_create_cb(void *tool_ctx, void *cb_ctx) goto error; grp_data->tbl = tbl;if (attr->group) { + hws_flags = mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]; +/* For case of jump from FDB Tx to FDB Rx as it is supported now. */ +if (priv->jump_fdb_rx_en && + dr_tbl_attr.type ==MLX5DR_TABLE_TYPE_FDB_RX ) + hws_flags |=MLX5DR_ACTION_FLAG_HWS_FDB_TX ;/* Jump action be used by non-root table. */ jump =mlx5dr_action_create_dest_table (priv->dr_ctx, tbl, - mlx5_hw_act_dest_table_flag[dr_tbl_attr.type]); + hws_flags);if (!jump) goto error; grp_data->jump.hws_action = jump;
Signature · 1 line
2.39.5
PATCH v3 3/3 net/mlx5: allow FDB RSS
In reply to Dariusz SosnowskiFrom: Suanming Mou <[email protected]>
RSS can be used in FDB Rx rules when JUMP_FDB_RX action to allow jump from FDB Tx to FDB Rx table.
Different with NIC RSS, FDB RSS will not do the internal implicit metadata copy.
This commit enables the FDB RSS if JUMP_FDB_RX is supported.
--- doc/guides/nics/mlx5.rst | 4 ++++ drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 +++++++++++++++++--------------- drivers/net/mlx5/mlx5_flow_hw.c | 20 +++++++++++++++----- 4 files changed, 38 insertions(+), 22 deletions(-)
doc/guides/nics/mlx5.rst +4 -0
@@ -970,6 +970,10 @@ Limitations The flow engine of a process cannot move from active to standby mode if preceding active application rules are still present and vice versa. +- Since only when unified FDB is enabled, there will be FDB Rx/Tx, jump FDB Rx + is valid only when unfied is enabled. And in unified FDB mode, the tag and RSS + actions are only allowed in FDB Rx domain. + Statistics ----------
drivers/net/mlx5/mlx5_flow.c +2 -2
@@ -1977,9 +1977,9 @@ mlx5_flow_validate_action_mark(struct rte_eth_dev *dev,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL ,"mark action not supported for " "egress"); -if (attr->transfer &&mlx5_hws_active (dev)) +if (attr->transfer && !mlx5_hws_active (dev))return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ATTR_EGRESS ,NULL , +RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER ,NULL ,"non-template mark action not supported for transfer" );return 0 ; }
drivers/net/mlx5/mlx5_flow_dv.c +17 -15
@@ -8939,21 +8939,23 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,RTE_FLOW_ERROR_TYPE_ACTION ,NULL , "unsupported action MARK"); -if (action_flags &MLX5_FLOW_ACTION_QUEUE ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action QUEUE" ); -if (action_flags &MLX5_FLOW_ACTION_RSS ) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ACTION , -NULL , -"unsupported action RSS" ); -if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) -return rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_ACTION , - actions, -"no fate action is found" ); +if (!priv->jump_fdb_rx_en) { +if (action_flags &MLX5_FLOW_ACTION_QUEUE ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action QUEUE" ); +if (action_flags &MLX5_FLOW_ACTION_RSS ) +return rte_flow_error_set (error,ENOTSUP , +RTE_FLOW_ERROR_TYPE_ACTION , +NULL , +"unsupported action RSS" ); +if (!(action_flags &MLX5_FLOW_FATE_ESWITCH_ACTIONS )) +return rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_ACTION , + actions, +"no fate action is found" ); + } }else {if (!(action_flags &MLX5_FLOW_FATE_ACTIONS ) && attr->ingress) return rte_flow_error_set(error, EINVAL,
drivers/net/mlx5/mlx5_flow_hw.c +15 -5
@@ -7036,6 +7036,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev,uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_queue *queue_mask = template_mask->conf; const struct rte_flow_attr attr = { .ingress = template_attr->ingress,
@@ -7044,7 +7045,7 @@ mlx5_hw_validate_action_queue(struct rte_eth_dev *dev, };bool masked = queue_mask !=NULL && queue_mask->index; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"QUEUE action supported for ingress only" );
@@ -7063,9 +7064,10 @@ mlx5_hw_validate_action_rss(struct rte_eth_dev *dev, __rte_unused uint64_t action_flags, struct rte_flow_error *error) { + struct mlx5_priv *priv = dev->data->dev_private;const struct rte_flow_action_rss *mask = template_mask->conf; -if (template_attr->egress || template_attr->transfer) +if (template_attr->egress || (template_attr->transfer && !priv->jump_fdb_rx_en))return rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR ,NULL ,"RSS action supported for ingress only" );
@@ -8114,6 +8116,7 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, }if (priv->sh->config.dv_xmeta_en ==MLX5_XMETA_MODE_META32_HWS && priv->sh->config.dv_esw_en && + !attr->transfer && (action_flags & (MLX5_FLOW_ACTION_QUEUE |MLX5_FLOW_ACTION_RSS ))) {/* Insert META copy */ mf_actions[expand_mf_num] = rx_meta_copy_action;
@@ -12140,23 +12143,30 @@ __flow_hw_configure(struct rte_eth_dev *dev,/* Add global actions. */ for (i =0 ; i <MLX5_HW_ACTION_FLAG_MAX ; i++) {uint32_t act_flags =0 ; +uint32_t tag_flags = mlx5_hw_act_flag[i][0 ]; act_flags = mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_NIC_TX ];if (is_proxy) { -if (unified_fdb) +/* Tag action is valid only in FDB_Rx domain. */ +if (unified_fdb) { act_flags |= (mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_TX ] | mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_UNIFIED ]); -else +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB_RX ]; + }else { act_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; +if (i ==MLX5_HW_ACTION_FLAG_NONE_ROOT ) + tag_flags |= mlx5_hw_act_flag[i][MLX5DR_TABLE_TYPE_FDB ]; + } } priv->hw_drop[i] =mlx5dr_action_create_dest_drop (priv->dr_ctx, act_flags);if (!priv->hw_drop[i]) goto err; priv->hw_tag[i] =mlx5dr_action_create_tag - (priv->dr_ctx, mlx5_hw_act_flag[i][0 ]); + (priv->dr_ctx, tag_flags);if (!priv->hw_tag[i]) goto err; }
Signature · 1 line
2.39.5
Hi,
From: Dariusz Sosnowski <[email protected]>
Sent: Wednesday, February 26, 2025 6:04 PM
To: Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad
Cc: [email protected]; Raslan Darawsheh
Subject: [PATCH v3 0/3] net/mlx5: support jump FDB Rx
Before FW introduced the JUMP_FDB_RX action feature, jump from FDB Tx to Rx is not allowed. JUMP_FDB_RX feature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.
This series adds the jump from FDB Tx to FDB Rx support and allows RSS action in FDB domain rule when jump FDB Rx is supported.
v3:
- Rebased on v2 of mlx5 Unified FDB patches (series 34723)
Suanming Mou (3):
net/mlx5/hws: support jump FDB Rx
net/mlx5: add jump FDB Rx flag
net/mlx5: allow FDB RSS
doc/guides/nics/mlx5.rst | 4 ++++ drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 9 +++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 ++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ drivers/net/mlx5/linux/mlx5_os.c | 9 ++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++++++++------------- drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++----- 15 files changed, 125 insertions(+), 31 deletions(-)
--
2.39.5
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
Thanks a lot, Dariusz.
Quoted 44 lines
-----Original Message-----
From: Dariusz Sosnowski <[email protected]>
Sent: Thursday, February 27, 2025 12:04 AM
To: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH v3 0/3] net/mlx5: support jump FDB RxBefore FW introduced the
JUMP_FDB_RXaction feature, jump from FDB Tx to Rx is not allowed.JUMP_FDB_RXfeature introduces the internal loopback for Tx case and allow the REG C0 C1 B be preserved as well.This series adds the jump from FDB Tx to FDB Rx support and allows RSS action in FDB domain rule when jump FDB Rx is supported.
v3:
- Rebased on v2 of mlx5 Unified FDB patches (series 34723)Suanming Mou (3):
net/mlx5/hws: support jump FDB Rx
net/mlx5: add jump FDB Rx flag
net/mlx5: allow FDB RSSdoc/guides/nics/mlx5.rst | 4 ++++ drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 9 +++++++- drivers/net/mlx5/hws/mlx5dr_action.c | 26 +++++++++++++++++----- drivers/net/mlx5/hws/mlx5dr_action.h | 4 ++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 9 ++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 2 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 17 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_context.h | 2 ++ drivers/net/mlx5/linux/mlx5_os.c | 9 ++++++-- drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++++++++------------- drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++----- 15 files changed, 125 insertions(+), 31 deletions(-)--
2.39.5