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
F160462297: D17979.id50382.diff
Wed, Jun 24, 6:07 PM
F160387055: D17979.id50377.diff
Wed, Jun 24, 12:23 AM
Unknown Object (File)
Tue, Jun 23, 9:44 PM
Unknown Object (File)
Mon, Jun 22, 4:32 PM
Unknown Object (File)
Sun, Jun 21, 5:30 AM
Unknown Object (File)
Sat, Jun 13, 1:03 PM
Unknown Object (File)
Sat, Jun 13, 9:17 AM
Unknown Object (File)
Sat, Jun 13, 9:12 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.