net/mlx5: Eswitch, avoid redundant mask
misc_params.source_port is a 16 bit field already so no need for redundant masking against 0xffff. Also change local variables type to u16. Signed-off-by: Eli Cohen <eli@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
ffec97020f
commit
1708dd5468
@ -181,7 +181,7 @@ mlx5_eswitch_termtbl_actions_move(struct mlx5_flow_act *src,
|
|||||||
static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw,
|
static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw,
|
||||||
const struct mlx5_flow_spec *spec)
|
const struct mlx5_flow_spec *spec)
|
||||||
{
|
{
|
||||||
u32 port_mask, port_value;
|
u16 port_mask, port_value;
|
||||||
|
|
||||||
if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source))
|
if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source))
|
||||||
return spec->flow_context.flow_source ==
|
return spec->flow_context.flow_source ==
|
||||||
@ -191,7 +191,7 @@ static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw,
|
|||||||
misc_parameters.source_port);
|
misc_parameters.source_port);
|
||||||
port_value = MLX5_GET(fte_match_param, spec->match_value,
|
port_value = MLX5_GET(fte_match_param, spec->match_value,
|
||||||
misc_parameters.source_port);
|
misc_parameters.source_port);
|
||||||
return (port_mask & port_value & 0xffff) == MLX5_VPORT_UPLINK;
|
return (port_mask & port_value) == MLX5_VPORT_UPLINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Loading…
Reference in New Issue
Block a user