Index: ifq.c =================================================================== RCS file: /cvs/src/sys/net/ifq.c,v retrieving revision 1.49 diff -u -p -r1.49 ifq.c --- ifq.c 9 Jan 2023 03:39:14 -0000 1.49 +++ ifq.c 28 Jul 2023 13:02:06 -0000 @@ -148,6 +148,20 @@ ifq_start_task(void *p) } void +ifq_set_oactive(struct ifqueue *ifq) +{ + if (ifq->ifq_oactive) + return; + + mtx_enter(&ifq->ifq_mtx); + if (!ifq->ifq_oactive) { + ifq->ifq_oactive = 1; + ifq->ifq_oactives++; + } + mtx_leave(&ifq->ifq_mtx); +} + +void ifq_restart_task(void *p) { struct ifqueue *ifq = p; @@ -202,6 +216,7 @@ struct ifq_kstat_data { struct kstat_kv kd_qlen; struct kstat_kv kd_maxqlen; struct kstat_kv kd_oactive; + struct kstat_kv kd_oactives; }; static const struct ifq_kstat_data ifq_kstat_tpl = { @@ -218,6 +233,7 @@ static const struct ifq_kstat_data ifq_k KSTAT_KV_UNIT_INITIALIZER("maxqlen", KSTAT_KV_T_UINT32, KSTAT_KV_U_PACKETS), KSTAT_KV_INITIALIZER("oactive", KSTAT_KV_T_BOOL), + KSTAT_KV_INITIALIZER("oactives", KSTAT_KV_T_COUNTER32), }; int @@ -234,6 +250,7 @@ ifq_kstat_copy(struct kstat *ks, void *d kstat_kv_u32(&kd->kd_qlen) = ifq->ifq_len; kstat_kv_u32(&kd->kd_maxqlen) = ifq->ifq_maxlen; kstat_kv_bool(&kd->kd_oactive) = ifq->ifq_oactive; + kstat_kv_u32(&kd->kd_oactives) = ifq->ifq_oactives; return (0); } @@ -243,7 +260,7 @@ void ifq_init(struct ifqueue *ifq, struct ifnet *ifp, unsigned int idx) { ifq->ifq_if = ifp; - ifq->ifq_softnet = net_tq(ifp->if_index + idx); + ifq->ifq_softnet = net_tq(idx); ifq->ifq_softc = NULL; mtx_init(&ifq->ifq_mtx, IPL_NET); @@ -635,7 +652,7 @@ void ifiq_init(struct ifiqueue *ifiq, struct ifnet *ifp, unsigned int idx) { ifiq->ifiq_if = ifp; - ifiq->ifiq_softnet = net_tq(ifp->if_index + idx); + ifiq->ifiq_softnet = net_tq(idx); ifiq->ifiq_softc = NULL; mtx_init(&ifiq->ifiq_mtx, IPL_NET); Index: ifq.h =================================================================== RCS file: /cvs/src/sys/net/ifq.h,v retrieving revision 1.37 diff -u -p -r1.37 ifq.h --- ifq.h 9 Jan 2023 03:37:44 -0000 1.37 +++ ifq.h 28 Jul 2023 13:02:06 -0000 @@ -54,6 +54,7 @@ struct ifqueue { uint64_t ifq_qdrops; uint64_t ifq_errors; uint64_t ifq_mcasts; + uint32_t ifq_oactives; struct kstat *ifq_kstat; @@ -441,7 +442,7 @@ void *ifq_q_enter(struct ifqueue *, con 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 *); int ifq_deq_sleep(struct ifqueue *, struct mbuf **, int, int, const char *, volatile unsigned int *, @@ -455,12 +456,6 @@ static inline int ifq_is_priq(struct ifqueue *ifq) { return (ifq->ifq_ops == ifq_priq_ops); -} - -static inline void -ifq_set_oactive(struct ifqueue *ifq) -{ - ifq->ifq_oactive = 1; } static inline void