[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1451995051-21920-3-git-send-email-jakub.kicinski@netronome.com>
Date: Tue, 5 Jan 2016 11:57:29 +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: [PATCHv2 net-next 2/4] 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 006d9600240f..b381682de3d6 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1921,17 +1921,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))
ret = nfp_net_netdev_open(netdev);
- }
return ret;
}
--
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