[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1451923395-24533-2-git-send-email-jakub.kicinski@netronome.com>
Date: Mon, 4 Jan 2016 16:03:13 +0000
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: netdev@...r.kernel.org
Cc: simon.horman@...ronome.com, rolf.neugebauer@...ronome.com,
Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH net-next 1/3] nfp: free buffers before changing MTU
For freeing DMA buffers we depend on nfp_net.fl_bufsz having the same
value as during allocation therefore in .ndo_change_mtu we must first
free the buffers and then change the setting.
Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: Rolf Neugebauer <rolf.neugebauer@...ronome.com>
---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 43c618bafdb6..2826166547fd 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1920,17 +1920,17 @@ static int nfp_net_change_mtu(struct net_device *netdev, int new_mtu)
return -EINVAL;
}
+ if (netif_running(netdev))
+ nfp_net_netdev_close(netdev);
+
netdev->mtu = new_mtu;
/* Freelist buffer size rounded up to the nearest 1K */
tmp = new_mtu + ETH_HLEN + VLAN_HLEN + NFP_NET_MAX_PREPEND;
nn->fl_bufsz = roundup(tmp, 1024);
- /* restart if running */
- if (netif_running(netdev)) {
- nfp_net_netdev_close(netdev);
+ if (netif_running(netdev))
nfp_net_netdev_open(netdev);
- }
return 0;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists