On Fri, Aug 18, 2023 at 11:13 AM David Marchand <david.march...@redhat.com> wrote: > @@ -253,6 +255,10 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) > rte_free(eth_dev->data->dev_private); > pthread_mutex_destroy(ð_dev->data->flow_ops_mutex); > memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data));
At device cleanup stage (rte_eal_cleanup -> bus -> device), eth_dev_allocated() may still be called and use a leftover reference to (freed) data. So here, we need to reset it to NULL (caught by ASan with test-null.sh in the CI). This will be in v2. > + > + eth_dev_shared_data->allocated_count--; > + if (eth_dev_shared_data->allocated_count == 0) > + eth_dev_shared_data_release(); > } > > rte_spinlock_unlock(rte_mcfg_ethdev_get_lock()); -- David Marchand