[PATCH v8 17/26] net/iavf: decouple hash uninit from parser uninit

Anatoly Burakov
2026-02-24T12:25:50Z

Currently, parser deinitialization will trigger removal of current RSS
configuration. This should not be done as part of parser deinitialization,
but should rather be a separate step in dev close flow.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/iavf/iavf.h | 1 +
drivers/net/intel/iavf/iavf_ethdev.c | 3 +++
drivers/net/intel/iavf/iavf_hash.c | 12 ++++++++----
3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 39949acc11..6054321771 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -566,4 +566,5 @@ void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
void iavf_handle_hw_reset(struct rte_eth_dev *dev, bool vf_initiated_reset);
void iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change);
bool is_iavf_supported(struct rte_eth_dev *dev);
+void iavf_hash_uninit(struct iavf_adapter *ad);
#endif /* _IAVF_ETHDEV_H_ */
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 954bce723d..b45da4d8b1 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2977,6 +2977,9 @@ iavf_dev_close(struct rte_eth_dev *dev)
/* free iAVF security device context all related resources */
iavf_security_ctx_destroy(adapter);

+ /* remove RSS configuration */
+ iavf_hash_uninit(adapter);
+
iavf_flow_flush(dev, NULL);
iavf_flow_uninit(adapter);

diff --git a/drivers/net/intel/iavf/iavf_hash.c b/drivers/net/intel/iavf/iavf_hash.c
index a40fed7542..cb10eeab78 100644
--- a/drivers/net/intel/iavf/iavf_hash.c
+++ b/drivers/net/intel/iavf/iavf_hash.c
@@ -77,7 +77,7 @@ static int
iavf_hash_destroy(struct iavf_adapter *ad, struct rte_flow *flow,
struct rte_flow_error *error);
static void
-iavf_hash_uninit(struct iavf_adapter *ad);
+iavf_hash_uninit_parser(struct iavf_adapter *ad);
static void
iavf_hash_free(struct rte_flow *flow);
static int
@@ -680,7 +680,7 @@ static struct iavf_flow_engine iavf_hash_engine = {
.init = iavf_hash_init,
.create = iavf_hash_create,
.destroy = iavf_hash_destroy,
- .uninit = iavf_hash_uninit,
+ .uninit = iavf_hash_uninit_parser,
.free = iavf_hash_free,
.type = IAVF_FLOW_ENGINE_HASH,
};
@@ -1641,6 +1641,12 @@ iavf_hash_destroy(__rte_unused struct iavf_adapter *ad,
}

static void
+iavf_hash_uninit_parser(struct iavf_adapter *ad)
+{
+ iavf_unregister_parser(&iavf_hash_parser, ad);
+}
+
+void
iavf_hash_uninit(struct iavf_adapter *ad)
{
struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
@@ -1658,8 +1664,6 @@ iavf_hash_uninit(struct iavf_adapter *ad)
rss_conf = &ad->dev_data->dev_conf.rx_adv_conf.rss_conf;
if (iavf_rss_hash_set(ad, rss_conf->rss_hf, false))
PMD_DRV_LOG(ERR, "fail to delete default RSS");
-
- iavf_unregister_parser(&iavf_hash_parser, ad);
}

static void
--
2.47.3