Page MenuHomeFreeBSD

cxgbe(4): Do not report link state change during interface detach.
ClosedPublic

Authored by np on Jul 3 2024, 7:33 PM.
Tags
None
Referenced Files
F102914499: D45864.id140728.diff
Mon, Nov 18, 4:54 PM
Unknown Object (File)
Wed, Nov 13, 3:34 PM
Unknown Object (File)
Thu, Nov 7, 3:54 AM
Unknown Object (File)
Wed, Nov 6, 11:54 PM
Unknown Object (File)
Oct 18 2024, 8:34 AM
Unknown Object (File)
Oct 17 2024, 8:28 AM
Unknown Object (File)
Oct 15 2024, 5:32 PM
Unknown Object (File)
Oct 13 2024, 12:20 PM
Subscribers

Details

Summary

This fixes a panic when multiple VIs are configured on an interface and
only the non-primary VI is up at the time of drive detach. The problem
was that the driver would queue a link state change notification for an
interface about to be freed.

To reproduce the panic, add "hw.cxgbe.num_vis=2" to loader.conf and

  1. kldload if_cxgbe
  2. ifconfig vcc0 up
  3. devctl detach t6nex0
    • trap 0x9, rip = 0xffffffff8107db70, rsp = 0xfffffe0055263d60, rbp = 0xfffffe0055263dd0 --- taskqueue_run_locked() at taskqueue_run_locked+0x2a0/frame 0xfffffe0055263dd0 taskqueue_run() at taskqueue_run+0x72/frame 0xfffffe0055263df0 taskqueue_swi_run() at taskqueue_swi_run+0x18/frame 0xfffffe0055263e10 intr_event_execute_handlers() at intr_event_execute_handlers+0x249/frame 0xfffffe0055263e50 ithread_execute_handlers() at ithread_execute_handlers+0x9e/frame 0xfffffe0055263e70

MFC after: 1 week
Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

np requested review of this revision.Jul 3 2024, 7:33 PM
sys/dev/cxgbe/t4_main.c
12115

I don't think vi can ever be NULL here. I'm also not a super fan of assignment side effects inside of if statements, so I would probably just add:

if (IS_DETACHING(vi)
   continue;

before the existing check, or maybe

if (ifp == NULL || IS_DETACHING(vi))
   continuel

Incorporate feedback from jhb.

np marked an inline comment as done.Jul 9 2024, 4:52 PM
This revision is now accepted and ready to land.Jul 10 2024, 7:38 PM