Commit 5a2c09b1 authored by Si-Wei Liu's avatar Si-Wei Liu Committed by Zheng Zengkai
Browse files

vdpa/mlx5: should exclude header length and fcs from mtu



stable inclusion
from stable-5.10.30
commit 0ddb34c2ccce5e4c5c1566f6fa8ed20af3a3b858
bugzilla: 51791

--------------------------------

[ Upstream commit d084d996 ]

When feature VIRTIO_NET_F_MTU is negotiated on mlx5_vdpa,
22 extra bytes worth of MTU length is shown in guest.
This is because the mlx5_query_port_max_mtu API returns
the "hardware" MTU value, which does not just contain the
 Ethernet payload, but includes extra lengths starting
from the Ethernet header up to the FCS altogether.

Fix the MTU so packets won't get dropped silently.

Fixes: 1a86b377 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: default avatarSi-Wei Liu <si-wei.liu@oracle.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarEli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210408091047.4269-2-elic@nvidia.com


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent a9df3800
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment