From 1d2d8e408bcf33f6b7c26e79e01b605de63d762b Mon Sep 17 00:00:00 2001 From: mvs Date: Tue, 16 May 2023 20:09:27 +0000 Subject: [PATCH] Always set maximum queue length to passed in the IFQCTL_MAXLEN case. This is not the fast path, so dropping mq->mq_maxlen check doesn't introduce any performance impact, but makes code MP consistent. Discussed with and ok from bluhm@ --- sys/kern/uipc_mbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 6f0ea19b014..440a1ec5ecb 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.285 2023/05/05 01:19:51 bluhm Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.286 2023/05/16 20:09:27 mvs Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -1801,7 +1801,7 @@ sysctl_mq(int *name, u_int namelen, void *oldp, size_t *oldlenp, case IFQCTL_MAXLEN: maxlen = mq->mq_maxlen; error = sysctl_int(oldp, oldlenp, newp, newlen, &maxlen); - if (!error && maxlen != mq->mq_maxlen) + if (error == 0) mq_set_maxlen(mq, maxlen); return (error); case IFQCTL_DROPS: -- 2.20.1