mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 16:41:58 +00:00
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>
This commit is contained in:
parent
fab1e24ab8
commit
c59fec207b
@ -32,6 +32,7 @@
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/export.h>
|
||||
|
||||
#include <linux/mlx4/cmd.h>
|
||||
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user