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)
Jan 11 2024, 10:52 PM
Unknown Object (File)
Dec 23 2023, 6:57 PM
Unknown Object (File)
Dec 20 2023, 3:25 AM
Unknown Object (File)
Dec 19 2023, 9:55 PM
Unknown Object (File)
Dec 18 2023, 9:05 AM
Unknown Object (File)
Dec 13 2023, 4:37 PM
Unknown Object (File)
Nov 13 2023, 3:38 PM
Unknown Object (File)
Nov 13 2023, 3:35 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 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.