From: Eugenia Emantayev Date: Thu, 11 Apr 2013 01:56:42 +0000 (+0000) Subject: net/mlx4_en: set correct MTU in SRIOV X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c59fec207bc73612c9a124539b99d186ad6d2a99;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git net/mlx4_en: set correct MTU in SRIOV When setting MTU in SRIOV mode add ETH, VLAN and FCS header length to the maximum MTU obtained from QUERY_DEV_CAP. Signed-off-by: Eugenia Emantayev Signed-off-by: Jack Morgenstein Signed-off-by: Amir Vadai Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 10c57c86388b..4b6aad39e72c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -517,7 +518,8 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, /* Mtu is configured as the max MTU among all the * the functions on the port. */ mtu = be16_to_cpu(gen_context->mtu); - mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port]); + mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port] + + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); prev_mtu = slave_st->mtu[port]; slave_st->mtu[port] = mtu; if (mtu > master->max_mtu[port])