Page MenuHomeFreeBSD

iflib: cleanup memory leaks on driver detach
ClosedPublic

Authored by jacob.e.keller_intel.com on Oct 25 2019, 11:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 3, 6:31 AM
Unknown Object (File)
Wed, Jul 1, 3:54 PM
Unknown Object (File)
Tue, Jun 30, 11:18 PM
Unknown Object (File)
Sat, Jun 27, 6:24 AM
Unknown Object (File)
Jun 4 2026, 4:10 PM
Unknown Object (File)
May 28 2026, 6:33 AM
Unknown Object (File)
May 25 2026, 9:28 PM
Unknown Object (File)
May 25 2026, 9:23 PM
Subscribers

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
Lint Not Applicable
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.