On Wed, 2 Sept 2026 at 11:47, B T Dhanush <[email protected]> wrote: > > t4_free_sge_resources() frees ctrl Tx queue and firmware event queue > DMA memzones using adapter->eth_dev, read at teardown time. This > runs only once, when the last port on the adapter closes. > > rte_eth_dev_close() frees a port's eth_dev->data right after that > port's own dev_close() returns, regardless of other ports' state. If > port 0 is not the last port closed, adapter->eth_dev->data is already > freed by the time t4_free_sge_resources() runs, causing a NULL > pointer dereference in rte_eth_dma_zone_free() and a crash on exit. > > Fix by not dereferencing eth_dev at teardown. Store the port_id used > for each queue's memzone name at allocation time instead, and free > each memzone directly via rte_memzone_lookup()/rte_memzone_free(). > > Fixes: 36c46e738120 ("ethdev: cleanup shared data with the last port")
This commit may have made the bug more visible but I doubt this is the reason for the reported issue. > Cc: [email protected] > > Signed-off-by: B T Dhanush <[email protected]> > Signed-off-by: Potnuri Bharat Teja <[email protected]> I don't understand the issue for now. Something looks wrong in the driver, and the description above. The adapter object seems to embed shared resources across multiple eth_dev objects, is that correct? If so, any function taking only a adapter pointer as input can only deal with the first port related. This is probably the reported crash and then I would point at: Fixes: 6b78a629954c ("net/cxgbe: fix queue DMA ring leaks during port close"). Which releases only the first port DMA resources even for another port. If those DMA resources are shared, the driver should not use rte_eth_dma_zone_reserve() and this driver should come with its own helper. But otherwise, if each eth_dev object has its DMA resources (which seems more likely to me), then my suggestion is to pass a eth_dev object to the related functions. And a followup cleanup would be to remove the back reference to the first eth_dev in the adapter object which I find really confusing and could be a source of bugs. -- David Marchand

