Page MenuHomeFreeBSD

iflib: Use CPU_FFS correctly
AbandonedPublic

Authored by cem on Sep 6 2016, 5:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 29 2025, 5:05 PM
Unknown Object (File)
Jan 29 2025, 1:21 AM
Unknown Object (File)
Jan 27 2025, 4:45 AM
Unknown Object (File)
Jan 14 2025, 9:10 PM
Unknown Object (File)
Dec 15 2024, 2:19 AM
Unknown Object (File)
Nov 29 2024, 9:26 PM
Unknown Object (File)
Nov 22 2024, 7:58 AM
Unknown Object (File)
Nov 22 2024, 6:16 AM

Details

Summary

Add some asserts and invariants checking to be sure we do not index with
a bogus qid.

PR: 212418

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5060
Build 5140: arc lint + arc unit

Event Timeline

cem retitled this revision from to iflib: Use CPU_FFS correctly.
cem updated this object.
cem edited the test plan for this revision. (Show Details)

Fix assert message to match pasted-to function.

kmacy edited edge metadata.
This revision is now accepted and ready to land.Sep 7 2016, 3:59 AM
sys/net/iflib.c
4306–4307

Check CPU_ABSENT(cpuid) here, too, I think.

4369

This would be another good place to assert !CPU_ABSENT(cpu)

sys/net/iflib.c
4306–4307

ifc_cpus comes from bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus), unless that call fails, and then it's just used uninitialized (but M_ZERO from iflib_device_register).

So... does bus_get_cpus(..., INTR_CPUS, ...) return absent CPUs?

sys/net/iflib.c
4306–4307

It shouldn't, but it seems good to check out of paranoia in some KASSERT -- we've had so many bugs like that in other parts of the kernel. I don't think it's something you need to check for beyond an assertion.

cem edited edge metadata.

Add !CPU_ABSENT KASSERTs as well.

This revision now requires review to proceed.Sep 7 2016, 4:38 PM
cem marked 2 inline comments as done.Sep 7 2016, 4:41 PM

So, I don't think the CPU_FFS stuff is actually causing the issue from the PR, unfortunately.

cem edited edge metadata.

Log the gtask cpu index we failed to find a taskgroup for on panic.

cem added a reviewer: cem.
cem added a subscriber: sbruno.

@sbruno committed something similar in r307560, r307561, r307566, r307567, obsoleting this review.

This revision is now accepted and ready to land.Oct 18 2016, 3:58 PM