mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 21:31:51 +00:00
net/mlx5: E-Switch, Provide flow dest when creating vport rx rule
Currently the destination for the representor e-switch rx rule is a TIR number. Towards changing that to potentially be a flow table, as part of enabling RSS for representors, modify the signature of the related e-switch API to get a flow destination. Signed-off-by: Gavi Teitz <gavi@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
092297e09a
commit
c966f7d55d
3 changed files with 9 additions and 7 deletions
|
@ -1009,10 +1009,13 @@ static int mlx5e_create_rep_vport_rx_rule(struct mlx5e_priv *priv)
|
||||||
struct mlx5e_rep_priv *rpriv = priv->ppriv;
|
struct mlx5e_rep_priv *rpriv = priv->ppriv;
|
||||||
struct mlx5_eswitch_rep *rep = rpriv->rep;
|
struct mlx5_eswitch_rep *rep = rpriv->rep;
|
||||||
struct mlx5_flow_handle *flow_rule;
|
struct mlx5_flow_handle *flow_rule;
|
||||||
|
struct mlx5_flow_destination dest;
|
||||||
|
|
||||||
|
dest.type = MLX5_FLOW_DESTINATION_TYPE_TIR;
|
||||||
|
dest.tir_num = priv->direct_tir[0].tirn;
|
||||||
flow_rule = mlx5_eswitch_create_vport_rx_rule(esw,
|
flow_rule = mlx5_eswitch_create_vport_rx_rule(esw,
|
||||||
rep->vport,
|
rep->vport,
|
||||||
priv->direct_tir[0].tirn);
|
&dest);
|
||||||
if (IS_ERR(flow_rule))
|
if (IS_ERR(flow_rule))
|
||||||
return PTR_ERR(flow_rule);
|
return PTR_ERR(flow_rule);
|
||||||
rpriv->vport_rx_rule = flow_rule;
|
rpriv->vport_rx_rule = flow_rule;
|
||||||
|
|
|
@ -230,7 +230,8 @@ mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
|
||||||
struct mlx5_esw_flow_attr *attr);
|
struct mlx5_esw_flow_attr *attr);
|
||||||
|
|
||||||
struct mlx5_flow_handle *
|
struct mlx5_flow_handle *
|
||||||
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
|
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport,
|
||||||
|
struct mlx5_flow_destination *dest);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SET_VLAN_STRIP = BIT(0),
|
SET_VLAN_STRIP = BIT(0),
|
||||||
|
|
|
@ -775,10 +775,10 @@ static void esw_destroy_vport_rx_group(struct mlx5_eswitch *esw)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mlx5_flow_handle *
|
struct mlx5_flow_handle *
|
||||||
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
|
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport,
|
||||||
|
struct mlx5_flow_destination *dest)
|
||||||
{
|
{
|
||||||
struct mlx5_flow_act flow_act = {0};
|
struct mlx5_flow_act flow_act = {0};
|
||||||
struct mlx5_flow_destination dest = {};
|
|
||||||
struct mlx5_flow_handle *flow_rule;
|
struct mlx5_flow_handle *flow_rule;
|
||||||
struct mlx5_flow_spec *spec;
|
struct mlx5_flow_spec *spec;
|
||||||
void *misc;
|
void *misc;
|
||||||
|
@ -796,12 +796,10 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn)
|
||||||
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
|
MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
|
||||||
|
|
||||||
spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS;
|
spec->match_criteria_enable = MLX5_MATCH_MISC_PARAMETERS;
|
||||||
dest.type = MLX5_FLOW_DESTINATION_TYPE_TIR;
|
|
||||||
dest.tir_num = tirn;
|
|
||||||
|
|
||||||
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
|
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
|
||||||
flow_rule = mlx5_add_flow_rules(esw->offloads.ft_offloads, spec,
|
flow_rule = mlx5_add_flow_rules(esw->offloads.ft_offloads, spec,
|
||||||
&flow_act, &dest, 1);
|
&flow_act, dest, 1);
|
||||||
if (IS_ERR(flow_rule)) {
|
if (IS_ERR(flow_rule)) {
|
||||||
esw_warn(esw->dev, "fs offloads: Failed to add vport rx rule err %ld\n", PTR_ERR(flow_rule));
|
esw_warn(esw->dev, "fs offloads: Failed to add vport rx rule err %ld\n", PTR_ERR(flow_rule));
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue