diff options
author | Igor Russkikh <igor.russkikh@aquantia.com> | 2017-09-25 03:48:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-26 16:44:31 -0400 |
commit | d85fc17beeb06f9979d63fe4d9fbffbb1a00bba4 (patch) | |
tree | 869e9cae7b1689814a1247d4a26de581aa85dab5 | |
parent | 62b982eeb4589b2e6d7c01a90590e3a4c2b2ca19 (diff) |
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: 5513e16421cb ("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>
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index 6ac9e2602d6d..bf26a59a9d8e 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c | |||
@@ -214,7 +214,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops, | |||
214 | SET_NETDEV_DEV(ndev, dev); | 214 | SET_NETDEV_DEV(ndev, dev); |
215 | 215 | ||
216 | ndev->if_port = port; | 216 | ndev->if_port = port; |
217 | ndev->min_mtu = ETH_MIN_MTU; | ||
218 | self->ndev = ndev; | 217 | self->ndev = ndev; |
219 | 218 | ||
220 | self->aq_pci_func = aq_pci_func; | 219 | self->aq_pci_func = aq_pci_func; |
@@ -283,6 +282,7 @@ int aq_nic_ndev_init(struct aq_nic_s *self) | |||
283 | self->ndev->features = aq_hw_caps->hw_features; | 282 | self->ndev->features = aq_hw_caps->hw_features; |
284 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; | 283 | self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; |
285 | self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN; | 284 | self->ndev->mtu = aq_nic_cfg->mtu - ETH_HLEN; |
285 | self->ndev->max_mtu = self->aq_hw_caps.mtu - ETH_FCS_LEN - ETH_HLEN; | ||
286 | 286 | ||
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
@@ -693,16 +693,9 @@ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev) | |||
693 | 693 | ||
694 | int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu) | 694 | int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu) |
695 | { | 695 | { |
696 | int err = 0; | ||
697 | |||
698 | if (new_mtu > self->aq_hw_caps.mtu) { | ||
699 | err = -EINVAL; | ||
700 | goto err_exit; | ||
701 | } | ||
702 | self->aq_nic_cfg.mtu = new_mtu; | 696 | self->aq_nic_cfg.mtu = new_mtu; |
703 | 697 | ||
704 | err_exit: | 698 | return 0; |
705 | return err; | ||
706 | } | 699 | } |
707 | 700 | ||
708 | int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev) | 701 | int aq_nic_set_mac(struct aq_nic_s *self, struct net_device *ndev) |
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h index f3957e930340..fcf89e25a773 100644 --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include "../aq_common.h" | 17 | #include "../aq_common.h" |
18 | 18 | ||
19 | #define HW_ATL_B0_MTU_JUMBO (16000U) | 19 | #define HW_ATL_B0_MTU_JUMBO 16352U |
20 | #define HW_ATL_B0_MTU 1514U | 20 | #define HW_ATL_B0_MTU 1514U |
21 | 21 | ||
22 | #define HW_ATL_B0_TX_RINGS 4U | 22 | #define HW_ATL_B0_TX_RINGS 4U |