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)
Thu, Dec 26, 4:35 PM
Unknown Object (File)
Tue, Dec 17, 9:13 PM
Unknown Object (File)
Dec 10 2024, 2:57 PM
Unknown Object (File)
Dec 2 2024, 5:58 AM
Unknown Object (File)
Dec 2 2024, 5:57 AM
Unknown Object (File)
Nov 21 2024, 6:26 AM
Unknown Object (File)
Nov 5 2024, 12:20 PM
Unknown Object (File)
Oct 31 2024, 4:47 AM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 20793
Build 20189: arc lint + arc unit

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.