Thread (142 messages) 142 messages, 6 authors, 2016-05-26
STALE3680d REVIEWED: 1 (1M)

[PATCH 34/40] bnxt: add device close operation

From: Stephen Hurd <hidden>
Date: 2016-05-06 19:26:56
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Frees all resources except the hwrm ones, which are required to notify
the HWRM that the driver is unloaded (these are freed in uninit()).

Signed-off-by: Stephen Hurd <redacted>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 97ef0b4..edb7427 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -390,6 +390,16 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	bnxt_shutdown_nic(bp);
 }
 
+static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
+{
+	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+
+	bnxt_free_tx_mbufs(bp);
+	bnxt_free_rx_mbufs(bp);
+	bnxt_free_mem(bp);
+	rte_free(eth_dev->data->mac_addrs);
+}
+
 static int bnxt_link_update_op(struct rte_eth_dev *eth_dev,
 			       int wait_to_complete)
 {
@@ -492,6 +502,7 @@ static struct eth_dev_ops bnxt_dev_ops = {
 	.dev_configure = bnxt_dev_configure_op,
 	.dev_start = bnxt_dev_start_op,
 	.dev_stop = bnxt_dev_stop_op,
+	.dev_close = bnxt_dev_close_op,
 	.stats_get = bnxt_stats_get_op,
 	.stats_reset = bnxt_stats_reset_op,
 	.rx_queue_setup = bnxt_rx_queue_setup_op,
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help