Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5b8dff0 authored by Yishai Hadas's avatar Yishai Hadas Committed by David S. Miller
Browse files

net/mlx4_en: Do not count LLC/SNAP in MTU calculation



LLC/SNAP 8 bytes should not be added as part of header calculation.
If used, payload will be decreased accordingly. For MTU of 1500
we'll set 1522 instead of 1523.

Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
Reviewed-by: default avatarLiran Liss <liranl@mellanox.com>
Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>

Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49a1e4f6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ static const int frag_sizes[] = {
void mlx4_en_calc_rx_buf(struct net_device *dev)
{
	struct mlx4_en_priv *priv = netdev_priv(dev);
	int eff_mtu = dev->mtu + ETH_HLEN + VLAN_HLEN + ETH_LLC_SNAP_SIZE;
	int eff_mtu = dev->mtu + ETH_HLEN + VLAN_HLEN;
	int buf_size = 0;
	int i = 0;

+0 −2
Original line number Diff line number Diff line
@@ -152,8 +152,6 @@ enum {
#define MLX4_EN_TX_POLL_MODER	16
#define MLX4_EN_TX_POLL_TIMEOUT	(HZ / 4)

#define ETH_LLC_SNAP_SIZE	8

#define SMALL_PACKET_SIZE      (256 - NET_IP_ALIGN)
#define HEADER_COPY_SIZE       (128 - NET_IP_ALIGN)
#define MLX4_LOOPBACK_TEST_PAYLOAD (HEADER_COPY_SIZE - ETH_HLEN)