Skip to contentSkip to conversation

net/gve: free device resources in gve_dev_close

PATCH New Jasper Tran O'Leary 1 participant 1 message Jul 18, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/gve: free device resources in gve_dev_close

Previously, upon a device close, the driver would only stop its queues, whereas a device remove would cause the driver to free its resources. However, expected behavior in DPDK is to have a device close free all of its resources because ports are not reused.

This patch adds all device teardown functionality within the device close function. It also flattens and refactors steps related to freeing device resources such that gve_dev_close reads more linearly.

Fixes 457967cd2b2d ("net/gve: support device initialization")
---
 drivers/net/gve/base/gve_adminq.c |   2 -
 drivers/net/gve/gve_ethdev.c      | 139 +++++++++++++++++++++--------------------
 2 files changed, 72 insertions(+), 69 deletions(-)
drivers/net/gve/base/gve_adminq.c +0 -2
index 4b250a9..15a05da 100644
@@ -276,8 +276,6 @@ void gve_adminq_release(struct gve_priv *priv)
 			msleep(GVE_ADMINQ_SLEEP_LEN);
 		}
 	}
-	gve_clear_device_rings_ok(priv);
-	gve_clear_device_resources_ok(priv);
 	gve_clear_admin_queue_ok(priv);
 }
 
drivers/net/gve/gve_ethdev.c +72 -67

212 lines not on this page · raw message

--
2.50.0.727.gbf7dc18ff4-goog