From 9bb5f5946fe1bfd777b4367d0843d238d951f801 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Wed, 20 Nov 2024 02:18:46 +0000 Subject: provide ifq_deq_set_oactive. ifq_deq_set_oactive is a variation on ifq_set_oactive that can be called inside an if_deq_begin "transaction". afresh@ found de(4) was calling ifq_set_oactive while holding the ifq mutex via ifq_deq_begin, which led to a panic because ifq_set_oactive also tries to take the ifq mutex. ifq_deq_set_oactive assumes the caller is already holding the mutex. de(4) is confusing, so it seemed simpler to add a small tweak to ifqs than try and do major surgery on such a hairy driver. tested by afresh@ --- sys/net/ifq.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/net/ifq.h') diff --git a/sys/net/ifq.h b/sys/net/ifq.h index e7ee259e3ab..18fdb4180ef 100644 --- a/sys/net/ifq.h +++ b/sys/net/ifq.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.h,v 1.41 2023/11/10 15:51:24 bluhm Exp $ */ +/* $OpenBSD: ifq.h,v 1.42 2024/11/20 02:18:45 dlg Exp $ */ /* * Copyright (c) 2015 David Gwynne @@ -444,6 +444,7 @@ void ifq_q_leave(struct ifqueue *, void *); void ifq_serialize(struct ifqueue *, struct task *); void ifq_barrier(struct ifqueue *); void ifq_set_oactive(struct ifqueue *); +void ifq_deq_set_oactive(struct ifqueue *); int ifq_deq_sleep(struct ifqueue *, struct mbuf **, int, int, const char *, volatile unsigned int *, -- cgit v1.2.3