aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4
diff options
context:
space:
mode:
authorEugenia Emantayev <eugenia@mellanox.co.il>2013-04-10 21:56:42 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-11 16:12:40 -0400
commitc59fec207bc73612c9a124539b99d186ad6d2a99 (patch)
tree2f20d530371ea09279fd40e19e6976d562a74d87 /drivers/net/ethernet/mellanox/mlx4
parentfab1e24ab84a0ca2f12599b5d4349576d9a3664f (diff)
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 <eugenia@mellanox.com> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/port.c4
1 files changed, 3 insertions, 1 deletions
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 @@
32 32
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/if_ether.h> 34#include <linux/if_ether.h>
35#include <linux/if_vlan.h>
35#include <linux/export.h> 36#include <linux/export.h>
36 37
37#include <linux/mlx4/cmd.h> 38#include <linux/mlx4/cmd.h>
@@ -517,7 +518,8 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
517 /* Mtu is configured as the max MTU among all the 518 /* Mtu is configured as the max MTU among all the
518 * the functions on the port. */ 519 * the functions on the port. */
519 mtu = be16_to_cpu(gen_context->mtu); 520 mtu = be16_to_cpu(gen_context->mtu);
520 mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port]); 521 mtu = min_t(int, mtu, dev->caps.eth_mtu_cap[port] +
522 ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
521 prev_mtu = slave_st->mtu[port]; 523 prev_mtu = slave_st->mtu[port];
522 slave_st->mtu[port] = mtu; 524 slave_st->mtu[port] = mtu;
523 if (mtu > master->max_mtu[port]) 525 if (mtu > master->max_mtu[port])