Skip to content

Commit

Permalink
net/mlx5: fix LACP redirection in Rx domain
Browse files Browse the repository at this point in the history
[ upstream commit 49dffad ]

When the "lacp_by_user" is not set from the application in bond
mode, the LACP traffic should be handled by the kernel driver by
default.

This commit adds the missing support in the template API when
"dv_flow_en=2". The behavior will be the same as that in the DV
mode with "dv_flow_en=1". The LACP packets will be redirected to the
kernel when starting the steering in the NIC Rx domain.

With this commit, the DEFAULT_MISS action usage is refactored a bit.
In the HWS, one unique action can be created with supported bits set
in the "flag" per port. The *ROOT_FDB and *HWS_FDB flag bits will
only be set when the port is in switchdev mode and working as the
E-Switch manager proxy port. The SF/VF and all other representors
won't have the FDB flag bits when creating the DEFAULT_MISS action.

Fixes: 9fa7c1c ("net/mlx5: create control flow rules with HWS")
Cc: [email protected]

Signed-off-by: Bing Zhao <[email protected]>
Acked-by: Suanming Mou <[email protected]>
  • Loading branch information
zorrohahaha authored and steevenlee committed Dec 18, 2023
1 parent 6ef77f2 commit 4307659
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 9 deletions.
8 changes: 4 additions & 4 deletions drivers/net/mlx5/linux/mlx5_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
err = mlx5_alloc_table_hash_list(priv);
if (err)
goto error;
sh->default_miss_action =
mlx5_glue->dr_create_flow_action_default_miss();
if (!sh->default_miss_action)
DRV_LOG(WARNING, "Default miss action is not supported.");
if (priv->sh->config.dv_flow_en == 2)
return 0;
/* The resources below are only valid with DV support. */
Expand Down Expand Up @@ -597,10 +601,6 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)

__mlx5_discovery_misc5_cap(priv);
#endif /* HAVE_MLX5DV_DR */
sh->default_miss_action =
mlx5_glue->dr_create_flow_action_default_miss();
if (!sh->default_miss_action)
DRV_LOG(WARNING, "Default miss action is not supported.");
LIST_INIT(&sh->shared_rxqs);
return 0;
error:
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/mlx5/mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,7 @@ struct mlx5_priv {
struct rte_flow_template_table *hw_esw_sq_miss_tbl;
struct rte_flow_template_table *hw_esw_zero_tbl;
struct rte_flow_template_table *hw_tx_meta_cpy_tbl;
struct rte_flow_template_table *hw_lacp_rx_tbl;
struct rte_flow_pattern_template *hw_tx_repr_tagging_pt;
struct rte_flow_actions_template *hw_tx_repr_tagging_at;
struct rte_flow_template_table *hw_tx_repr_tagging_tbl;
Expand Down Expand Up @@ -1814,6 +1815,8 @@ struct mlx5_priv {
struct mlx5dr_action *hw_drop[2];
/* HW steering global tag action. */
struct mlx5dr_action *hw_tag[2];
/* HW steering global default miss action. */
struct mlx5dr_action *hw_def_miss;
/* HW steering create ongoing rte flow table list header. */
LIST_HEAD(flow_hw_tbl_ongo, rte_flow_template_table) flow_hw_tbl_ongo;
struct mlx5_indexed_pool *acts_ipool; /* Action data indexed pool. */
Expand Down
1 change: 1 addition & 0 deletions drivers/net/mlx5/mlx5_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,7 @@ int mlx5_flow_hw_esw_destroy_sq_miss_flow(struct rte_eth_dev *dev,
int mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev);
int mlx5_flow_hw_create_tx_default_mreg_copy_flow(struct rte_eth_dev *dev);
int mlx5_flow_hw_tx_repr_matching_flow(struct rte_eth_dev *dev, uint32_t sqn, bool external);
int mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev);
int mlx5_flow_actions_validate(struct rte_eth_dev *dev,
const struct rte_flow_actions_template_attr *attr,
const struct rte_flow_action actions[],
Expand Down
Loading

0 comments on commit 4307659

Please sign in to comment.