Skip to content

Commit b653a28

Browse files
committed
re: Make sure re_rxeof() is called in net epoch context
It may pass packets up the stack and so needs to be called in a network epoch. When a watchdog timeout happens, we need to enter a section explicitly. Reviewed by: zlei, glebius, adrian MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D51885
1 parent 3877025 commit b653a28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sys/dev/re/if_re.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,6 +3558,7 @@ re_ioctl(if_t ifp, u_long command, caddr_t data)
35583558
static void
35593559
re_watchdog(struct rl_softc *sc)
35603560
{
3561+
struct epoch_tracker et;
35613562
if_t ifp;
35623563

35633564
RL_LOCK_ASSERT(sc);
@@ -3578,7 +3579,9 @@ re_watchdog(struct rl_softc *sc)
35783579
if_printf(ifp, "watchdog timeout\n");
35793580
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
35803581

3582+
NET_EPOCH_ENTER(et);
35813583
re_rxeof(sc, NULL);
3584+
NET_EPOCH_EXIT(et);
35823585
if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
35833586
re_init_locked(sc);
35843587
if (!if_sendq_empty(ifp))

0 commit comments

Comments
 (0)