Message ID | 20210206050240.48410-2-saeed@kernel.org |
---|---|
State | New |
Headers | show |
Series | mlx5 updates 2021-02-04 | expand |
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Fri, 5 Feb 2021 21:02:24 -0800 you wrote: > From: Mark Bloch <mbloch@nvidia.com> > > Setting the source port requires only the E-Switch and vport number. > Refactor the function to get those parameters instead of passing the full > attribute. > > Signed-off-by: Mark Bloch <mbloch@nvidia.com> > Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> > Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> > > [...] Here is the summary with links: - [net-next,V2,01/17] net/mlx5: E-Switch, Refactor setting source port https://git.kernel.org/netdev/net-next/c/b055ecf5827d - [net-next,V2,02/17] net/mlx5e: E-Switch, Maintain vhca_id to vport_num mapping https://git.kernel.org/netdev/net-next/c/84ae9c1f29c0 - [net-next,V2,03/17] net/mlx5e: Always set attr mdev pointer https://git.kernel.org/netdev/net-next/c/275c21d6cbe2 - [net-next,V2,04/17] net/mlx5: E-Switch, Refactor rule offload forward action processing https://git.kernel.org/netdev/net-next/c/9e51c0a62492 - [net-next,V2,05/17] net/mlx5e: VF tunnel TX traffic offloading https://git.kernel.org/netdev/net-next/c/10742efc20a4 - [net-next,V2,06/17] net/mlx5e: Refactor tun routing helpers https://git.kernel.org/netdev/net-next/c/6717986e15a0 - [net-next,V2,07/17] net/mlx5: E-Switch, Indirect table infrastructure https://git.kernel.org/netdev/net-next/c/34ca65352ddf - [net-next,V2,08/17] net/mlx5e: Remove redundant match on tunnel destination mac https://git.kernel.org/netdev/net-next/c/4ad9116c84ed - [net-next,V2,09/17] net/mlx5e: VF tunnel RX traffic offloading https://git.kernel.org/netdev/net-next/c/a508728a4c8b - [net-next,V2,10/17] net/mlx5e: Refactor reg_c1 usage https://git.kernel.org/netdev/net-next/c/48d216e5596a - [net-next,V2,11/17] net/mlx5e: Match recirculated packet miss in slow table using reg_c1 https://git.kernel.org/netdev/net-next/c/8e404fefa58b - [net-next,V2,12/17] net/mlx5e: Extract tc tunnel encap/decap code to dedicated file https://git.kernel.org/netdev/net-next/c/0d9f96471493 - [net-next,V2,13/17] net/mlx5e: Create route entry infrastructure https://git.kernel.org/netdev/net-next/c/777bb800c696 - [net-next,V2,14/17] net/mlx5e: Refactor neigh update infrastructure https://git.kernel.org/netdev/net-next/c/2221d954d984 - [net-next,V2,15/17] net/mlx5e: TC preparation refactoring for routing update event https://git.kernel.org/netdev/net-next/c/c7b9038d8af6 - [net-next,V2,16/17] net/mlx5e: Rename some encap-specific API to generic names https://git.kernel.org/netdev/net-next/c/021905f8067d - [net-next,V2,17/17] net/mlx5e: Handle FIB events to update tunnel endpoint device https://git.kernel.org/netdev/net-next/c/8914add2c9e5 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 7f09f2bbf7c1..416ede2fe5d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -257,7 +257,8 @@ mlx5_eswitch_set_rule_flow_source(struct mlx5_eswitch *esw, static void mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, struct mlx5_flow_spec *spec, - struct mlx5_esw_flow_attr *attr) + struct mlx5_eswitch *src_esw, + u16 vport) { void *misc2; void *misc; @@ -268,8 +269,8 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, if (mlx5_eswitch_vport_match_metadata_enabled(esw)) { misc2 = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters_2); MLX5_SET(fte_match_set_misc2, misc2, metadata_reg_c_0, - mlx5_eswitch_get_vport_metadata_for_match(attr->in_mdev->priv.eswitch, - attr->in_rep->vport)); + mlx5_eswitch_get_vport_metadata_for_match(src_esw, + vport)); misc2 = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters_2); MLX5_SET(fte_match_set_misc2, misc2, metadata_reg_c_0, @@ -278,12 +279,12 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw, spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS_2; } else { misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters); - MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport); + MLX5_SET(fte_match_set_misc, misc, source_port, vport); if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) MLX5_SET(fte_match_set_misc, misc, source_eswitch_owner_vhca_id, - MLX5_CAP_GEN(attr->in_mdev, vhca_id)); + MLX5_CAP_GEN(src_esw->dev, vhca_id)); misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters); MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port); @@ -407,7 +408,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, fdb = attr->ft; if (!(attr->flags & MLX5_ESW_ATTR_FLAG_NO_IN_PORT)) - mlx5_eswitch_set_rule_source_port(esw, spec, esw_attr); + mlx5_eswitch_set_rule_source_port(esw, spec, + esw_attr->in_mdev->priv.eswitch, + esw_attr->in_rep->vport); } if (IS_ERR(fdb)) { rule = ERR_CAST(fdb); @@ -487,7 +490,9 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw, dest[i].ft = fwd_fdb; i++; - mlx5_eswitch_set_rule_source_port(esw, spec, esw_attr); + mlx5_eswitch_set_rule_source_port(esw, spec, + esw_attr->in_mdev->priv.eswitch, + esw_attr->in_rep->vport); if (attr->outer_match_level != MLX5_MATCH_NONE) spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;