[PATCH 4/4] net/gve: add minor fixes to flow rule code

Jasper Tran O'Leary
2026-03-27T00:19:49Z

Replace an unneeded goto statement with an early return. Add a comment
about the lifetime of the flow rule lock.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_ethdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 6ce3ef3..fce90ad 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -521,8 +521,7 @@ gve_setup_flow_subsystem(struct gve_priv *priv)
priv->flow_rule_bmp_size, 0);
if (!priv->avail_flow_rule_bmp_mem) {
PMD_DRV_LOG(ERR, "Failed to alloc bitmap for flow rules.");
- err = -ENOMEM;
- goto free_flow_rule_bmp;
+ return -ENOMEM;
}

err = gve_flow_init_bmp(priv);
@@ -619,6 +618,11 @@ gve_dev_reset(struct rte_eth_dev *dev)
if (gve_get_flow_subsystem_ok(priv))
gve_teardown_flow_subsystem(priv);

+ /*
+ * Note that gve_teardown_flow_subsystem does not destroy the
+ * flow_rule_lock. The lock is preserved across device resets and only
+ * destroyed on dev_close.
+ */
gve_free_queues(dev);
gve_teardown_device_resources(priv);
gve_adminq_free(priv);
--
2.53.0.1118.gaef5881109-goog