Skip to content

Commit dda585f

Browse files
committed
cxgbe(4): Avoid hang on kldunload on netlink enabled kernels.
netlink(4) calls back into the driver during detach and it attempts to start an internal synchronized op recursively, causing an interruptible hang. Fix it by failing the ioctl if the VI has been marked as DOOMED by cxgbe_detach. Here's the stack for the hang for reference. #6 begin_synchronized_op #7 cxgbe_media_status #8 ifmedia_ioctl #9 cxgbe_ioctl #10 if_ioctl #11 get_operstate_ether #12 get_operstate #13 dump_iface freebsd#14 rtnl_handle_ifevent freebsd#15 rtnl_handle_ifnet_event freebsd#16 rt_ifmsg freebsd#17 if_unroute freebsd#18 if_down freebsd#19 if_detach_internal freebsd#20 if_detach freebsd#21 ether_ifdetach freebsd#22 cxgbe_vi_detach freebsd#23 cxgbe_detach freebsd#24 DEVICE_DETACH Sponsored by: Chelsio Communications Approved by: re (kib) (cherry picked from commit 3814249) (cherry picked from commit 3287f64)
1 parent c1b6110 commit dda585f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/dev/cxgbe/t4_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ cxgbe_media_status(if_t ifp, struct ifmediareq *ifmr)
34593459
struct adapter *sc = pi->adapter;
34603460
struct link_config *lc = &pi->link_cfg;
34613461

3462-
if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4med") != 0)
3462+
if (begin_synchronized_op(sc, vi , SLEEP_OK | INTR_OK, "t4med") != 0)
34633463
return;
34643464
PORT_LOCK(pi);
34653465

0 commit comments

Comments
 (0)