Page MenuHomeFreeBSD

Fix leaks caused by ifc_nhwtxqs never being initialized
ClosedPublic

Authored by shurd on Nov 13 2018, 7:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 19, 9:50 PM
Unknown Object (File)
Thu, Apr 17, 11:46 PM
Unknown Object (File)
Mar 22 2025, 2:06 AM
Unknown Object (File)
Mar 7 2025, 3:15 PM
Unknown Object (File)
Mar 6 2025, 12:09 PM
Unknown Object (File)
Mar 5 2025, 12:27 PM
Unknown Object (File)
Feb 4 2025, 8:54 AM
Unknown Object (File)
Jan 30 2025, 4:09 PM
Subscribers

Details

Summary

r333502 removed initialization of ifc_nhwtxqs, and it's not clear
there's a need to copy it into the struct iflib_ctx at all. Use
ctx->ifc_sctx->isc_ntxqs instead.

Further, iflib_stop() did not clear the last ring in the case where
isc_nfl != isc_nrxqs (such as when IFLIB_HAS_RXCQ is set). Use
ctx->ifc_sctx->isc_nrxqs here instead of isc_nfl.

Reported by: pkelsey

Test Plan

Test with ixgbe, bnxt, and e1000 including use as a module.
Load/unload the module multiple times.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks good to me.

Style-wise, would it be better to set up an sctx local at the top of these routines and then dereference that to avoid the double-dereference noise in the code?

This revision is now accepted and ready to land.Nov 13 2018, 7:36 PM
This revision now requires review to proceed.Nov 13 2018, 8:08 PM

Style-wise, would it be better to set up an sctx local at the top of these routines and then dereference that to avoid the double-dereference noise in the code?

I'm not sure it's any better, but I don't mind doing it.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 14 2018, 3:17 PM
This revision was automatically updated to reflect the committed changes.