net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change
authorAdham Faris <afaris@nvidia.com>
Sun, 8 Jan 2023 16:09:32 +0000 (18:09 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 8 Feb 2023 03:01:04 +0000 (19:01 -0800)
commit1e66220948df815d7b37e0ff8b4627ce10433738
treec5abafc4e62c95c24e3adf93f23c6640739fa0c8
parent565b4824c39fa335cba2028a09d7beb7112f3c9a
net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change

rq->hw_mtu is used in function en_rx.c/mlx5e_skb_from_cqe_mpwrq_linear()
to catch oversized packets. If FCS is concatenated to the end of the
packet then the check should be updated accordingly.

Rx rings initialization (mlx5e_init_rxq_rq()) invoked for every new set
of channels, as part of mlx5e_safe_switch_params(), unknowingly if it
runs with default configuration or not. Current rq->hw_mtu
initialization assumes default configuration and ignores
params->scatter_fcs_en flag state.
Fix this, by accounting for params->scatter_fcs_en flag state during
rq->hw_mtu initialization.

In addition, updating rq->hw_mtu value during ingress traffic might
lead to packets drop and oversize_pkts_sw_drop counter increase with no
good reason. Hence we remove this optimization and switch the set of
channels with a new one, to make sure we don't get false positives on
the oversize_pkts_sw_drop counter.

Fixes: 102722fc6832 ("net/mlx5e: Add support for RXFCS feature flag")
Signed-off-by: Adham Faris <afaris@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c