summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cavium/thunder
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2016-10-17 15:54:13 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-18 11:34:20 -0400
commit109cc16526c6d5551f7735683f7985b2b0300bb5 (patch)
tree55b731da919991907cbc7b83f4c1a8dfac0d3fa4 /drivers/net/ethernet/cavium/thunder
parent18c310fb9583a9c69b0316b7907759017f2e152a (diff)
downloadblackbird-op-linux-109cc16526c6d5551f7735683f7985b2b0300bb5.tar.gz
blackbird-op-linux-109cc16526c6d5551f7735683f7985b2b0300bb5.zip
ethernet/cavium: use core min/max MTU checking
liquidio: min_mtu 68, max_mtu 16000 thunder: min_mtu 64, max_mtu 9200 CC: netdev@vger.kernel.org CC: Sunil Goutham <sgoutham@cavium.com> CC: Robert Richter <rric@kernel.org> CC: Derek Chickles <derek.chickles@caviumnetworks.com> CC: Satanand Burla <satananda.burla@caviumnetworks.com> CC: Felix Manlunas <felix.manlunas@caviumnetworks.com> CC: Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/thunder')
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 45a13f718863..b192712c93b7 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -1312,12 +1312,6 @@ static int nicvf_change_mtu(struct net_device *netdev, int new_mtu)
{
struct nicvf *nic = netdev_priv(netdev);
- if (new_mtu > NIC_HW_MAX_FRS)
- return -EINVAL;
-
- if (new_mtu < NIC_HW_MIN_FRS)
- return -EINVAL;
-
if (nicvf_update_hw_max_frs(nic, new_mtu))
return -EINVAL;
netdev->mtu = new_mtu;
@@ -1630,6 +1624,10 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->netdev_ops = &nicvf_netdev_ops;
netdev->watchdog_timeo = NICVF_TX_TIMEOUT;
+ /* MTU range: 64 - 9200 */
+ netdev->min_mtu = NIC_HW_MIN_FRS;
+ netdev->max_mtu = NIC_HW_MAX_FRS;
+
INIT_WORK(&nic->reset_task, nicvf_reset_task);
err = register_netdev(netdev);
OpenPOWER on IntegriCloud