提交 d85fc17b 编写于 作者: I Igor Russkikh 提交者: David S. Miller

aquantia: Setup max_mtu in ndev to enable jumbo frames

Although hardware is capable for almost 16K MTU, without max_mtu field
correctly set it only allows standard MTU to be used.
This patch enables max MTU, calculating it from hardware maximum frame size
of 16352 octets (including FCS).

Fixes: 5513e164 ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")
Signed-off-by: NPavel Belous <Pavel.Belous@aquantia.com>
Signed-off-by: NIgor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 62b982ee
...@@ -214,7 +214,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops, ...@@ -214,7 +214,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
SET_NETDEV_DEV(ndev, dev); SET_NETDEV_DEV(ndev, dev);
ndev->if_port = port; ndev->if_port = port;
ndev->min_mtu = ETH_MIN_MTU;
self->ndev = ndev; self->ndev = ndev;
self->aq_pci_func = aq_pci_func; self->aq_pci_func = aq_pci_func;
...@@ -283,6 +282,7 @@ int aq_nic_ndev_init(struct aq_nic_s *self) ...@@ -283,6 +282,7 @@ int aq_nic_ndev_init(struct aq_nic_s *self)
self->ndev->features = aq_hw_caps->hw_features; self->ndev->features = aq_hw_caps->hw_features;
self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN; self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
self->ndev->max_mtu = self->aq_hw_caps.mtu - ETH_FCS_LEN - ETH_HLEN;
return 0; return 0;
} }
...@@ -693,16 +693,9 @@ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev) ...@@ -693,16 +693,9 @@ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev)
int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu) int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu)
{ {
int err = 0;
if (new_mtu > self->aq_hw_caps.mtu) {
err = -EINVAL;
goto err_exit;
}
self->aq_nic_cfg.mtu = new_mtu; self->aq_nic_cfg.mtu = new_mtu;
err_exit: return 0;
return err;
} }
int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev) int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "../aq_common.h" #include "../aq_common.h"
#define HW_ATL_B0_MTU_JUMBO (16000U) #define HW_ATL_B0_MTU_JUMBO 16352U
#define HW_ATL_B0_MTU 1514U #define HW_ATL_B0_MTU 1514U
#define HW_ATL_B0_TX_RINGS 4U #define HW_ATL_B0_TX_RINGS 4U
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册