Skip to content

Commit 1708dd5

Browse files
Eli CohenSaeed Mahameed
authored andcommitted
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 <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent ffec970 commit 1708dd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mlx5_eswitch_termtbl_actions_move(struct mlx5_flow_act *src,
181181
static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw,
182182
const struct mlx5_flow_spec *spec)
183183
{
184-
u32 port_mask, port_value;
184+
u16 port_mask, port_value;
185185

186186
if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source))
187187
return spec->flow_context.flow_source ==
@@ -191,7 +191,7 @@ static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw,
191191
misc_parameters.source_port);
192192
port_value = MLX5_GET(fte_match_param, spec->match_value,
193193
misc_parameters.source_port);
194-
return (port_mask & port_value & 0xffff) == MLX5_VPORT_UPLINK;
194+
return (port_mask & port_value) == MLX5_VPORT_UPLINK;
195195
}
196196

197197
bool

0 commit comments

Comments
 (0)