diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-06-05 17:01:44 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-07 12:51:38 -0400 |
commit | 4621199dbfb188e4871520569233f7c7528ab439 (patch) | |
tree | 8bf840ced8f4353a736418a87f33833e94c98197 /drivers | |
parent | ee26756d01cbff9e8b9ef9635f58b05b27492a49 (diff) | |
download | linux-4621199dbfb188e4871520569233f7c7528ab439.tar.bz2 |
nfp: reuse ring free code on close
On the close path reuse the ring free helpers introduced for runtime
reconfiguration.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index bec51f4a9299..23419883cfd4 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -2303,20 +2303,12 @@ static void nfp_net_close_free_all(struct nfp_net *nn) { unsigned int r; - for (r = 0; r < nn->dp.num_rx_rings; r++) { - nfp_net_rx_ring_bufs_free(&nn->dp, &nn->dp.rx_rings[r]); - nfp_net_rx_ring_free(&nn->dp.rx_rings[r]); - } - for (r = 0; r < nn->dp.num_tx_rings; r++) { - nfp_net_tx_ring_bufs_free(&nn->dp, &nn->dp.tx_rings[r]); - nfp_net_tx_ring_free(&nn->dp.tx_rings[r]); - } + nfp_net_tx_rings_free(&nn->dp); + nfp_net_rx_rings_free(&nn->dp); + for (r = 0; r < nn->dp.num_r_vecs; r++) nfp_net_cleanup_vector(nn, &nn->r_vecs[r]); - kfree(nn->dp.rx_rings); - kfree(nn->dp.tx_rings); - nfp_net_aux_irq_free(nn, NFP_NET_CFG_LSC, NFP_NET_IRQ_LSC_IDX); nfp_net_aux_irq_free(nn, NFP_NET_CFG_EXN, NFP_NET_IRQ_EXN_IDX); } |