Skip to content

Commit d85fc17

Browse files
caildavem330
authored andcommitted
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: 5513e16 ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu") Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 62b982e commit d85fc17

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

drivers/net/ethernet/aquantia/atlantic/aq_nic.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
214214
SET_NETDEV_DEV(ndev, dev);
215215

216216
ndev->if_port = port;
217-
ndev->min_mtu = ETH_MIN_MTU;
218217
self->ndev = ndev;
219218

220219
self->aq_pci_func = aq_pci_func;
@@ -283,6 +282,7 @@ int aq_nic_ndev_init(struct aq_nic_s *self)
283282
self->ndev->features = aq_hw_caps->hw_features;
284283
self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
285284
self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN;
285+
self->ndev->max_mtu = self->aq_hw_caps.mtu - ETH_FCS_LEN - ETH_HLEN;
286286

287287
return 0;
288288
}
@@ -693,16 +693,9 @@ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev)
693693

694694
int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu)
695695
{
696-
int err = 0;
697-
698-
if (new_mtu > self->aq_hw_caps.mtu) {
699-
err = -EINVAL;
700-
goto err_exit;
701-
}
702696
self->aq_nic_cfg.mtu = new_mtu;
703697

704-
err_exit:
705-
return err;
698+
return 0;
706699
}
707700

708701
int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev)

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "../aq_common.h"
1818

19-
#define HW_ATL_B0_MTU_JUMBO (16000U)
19+
#define HW_ATL_B0_MTU_JUMBO 16352U
2020
#define HW_ATL_B0_MTU 1514U
2121

2222
#define HW_ATL_B0_TX_RINGS 4U

0 commit comments

Comments
 (0)