Page MenuHomeFreeBSD

iflib: cleanup memory leaks on driver detach
ClosedPublic

Authored by jacob.e.keller_intel.com on Oct 25 2019, 11:22 PM.

Details

Summary

The iflib stack failed to release all of the memory allocated under
M_IFLIB during device detach.

Specifically, the ifmp_ring, the ift_ifdi Tx DMA info, and the ifr_ifdi Rx
DMA info were not being released.

Release this memory so that iflib won't leak memory when a device
detaches.

Since we're freeing the ift_ifdi pointer during iflib_txq_destroy we
need to call this only after iflib_dma_free in iflib_tx_structures_free.

Additionally, also ensure that we destroy the callout mutex associated
with each Tx queue when we free it.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

We should be able to MFC this to 12-STABLE and 11-STABLE. Since the issue has existed since the beginning of iflib in-tree, I don't really think it's worth trying to rush it into 12.1... although it is a relatively small fix.

This revision is now accepted and ready to land.Oct 25 2019, 11:37 PM
This revision was automatically updated to reflect the committed changes.