From nobody Thu Jan 18 22:39:44 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGHk852Rxz57B9T; Thu, 18 Jan 2024 22:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGHk82qyXz4FrQ; Thu, 18 Jan 2024 22:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705617584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tLUm03HIBPMhAdfcV30RefMTzLP3vnhYOv5SPuAcj+k=; b=fLQOinZYmgwHoqNoswZMjLy3aJrWX9zltP4N1cDSAEHjveMmsgxUx+ZiYnwIst3FZPrr2W lBZIyJb43odEC2wn81CcZyl+5H7wNiJJpcL2jwB261aNOpbM7yD+hreyK7ZrW2XLMYVfHO s12MRdZn3p5x6eQY2zZf7fIPIG8BStBPDFGd46sg8mjGuFWtIF7FsLcwFYMkjjFgqULNpJ ptFqpgTh+2So+G+RcuAC7op8vhV+m+F6DSSWX60QRs9Y7hJ3jetwBvDdeWDZUffW6rpPXR NdCuEmhzyMsrz3UEVL4vlXvtvGzvTE4nan2WiRoZYMxPR0X3EGwUUsWbsUp8Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705617584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tLUm03HIBPMhAdfcV30RefMTzLP3vnhYOv5SPuAcj+k=; b=TXv44kn0sef6VNolZn+k/o6xh+w2r7pIjMKIzGF7g1pHq1iamWEeklm/AYGBlQo3bswAcw aHoTmgaXsx1AzFB8pHmN71fkNOdG7At8AjIF7hTgqkHQiiKlIWQaOsociZWUu3euOmwj1v CuiX7rS8FjMbY0oy/fjnygzrStXKwMIywyygaZy+tqLmPJdQssyB5Q1oebTl65xyjJ66Uo kzjw6QnDzowkKmeEE00q3iB+6WXzRlZjKuyeK9BlzpXdQ2C6pf09BPoNsnAFS6xwnzx12U RXq/Dngd5KVTVicmWFNT/lPJA7XRjxjzvkIYsz8caQuj6T4+EUSAzvLiWYjQWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705617584; a=rsa-sha256; cv=none; b=QGLJ74mRJj7RNm/TTBhGjz/ZKZuv4T9MycGL6+GZ5X2GZELVuCqgoO3MNSrmAuwGyWfesj x5FhoHc9croUvLWfbp+GztspnQnJl88/dzjnPh08UuFf1JTGIXg0vIZ0zPdhGzza0jdHzH KHGnWRh/F9xwRcofQIlI3BYfpckHxqYAkaoKSna/SVWeBQnJ/FzBCDv6g53cSXJ4g5KESB I1Z8bUhmMJxBVMF/7WKuN3RIJRP9luu+6fWIWibirx8CBPj+4Qv1pEHp/bkhXW0+GZImi2 3jtHOSr2YcVTH83TX3n6eCmwp3NRs/7ZfFYI5kiKkM6eaFxO+BkPhkPfZfaAbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TGHk81xnQzQqF; Thu, 18 Jan 2024 22:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40IMdiGI009068; Thu, 18 Jan 2024 22:39:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IMdiMQ009065; Thu, 18 Jan 2024 22:39:44 GMT (envelope-from git) Date: Thu, 18 Jan 2024 22:39:44 GMT Message-Id: <202401182239.40IMdiMQ009065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9c50c9b776e3 - stable/14 - sys: Use mbufq_empty instead of comparing mbufq_len against 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9c50c9b776e3023d4b24cce0a5a587a7813c6c54 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9c50c9b776e3023d4b24cce0a5a587a7813c6c54 commit 9c50c9b776e3023d4b24cce0a5a587a7813c6c54 Author: John Baldwin AuthorDate: 2024-01-09 19:00:46 +0000 Commit: John Baldwin CommitDate: 2024-01-18 22:37:29 +0000 sys: Use mbufq_empty instead of comparing mbufq_len against 0 Reviewed by: bz, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43338 (cherry picked from commit 8cb9b68f5821e45c63ee08d8ee3029ca523ac174) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- sys/dev/cxgb/cxgb_sge.c | 4 ++-- sys/dev/cxgbe/tom/t4_tom.c | 4 ++-- sys/net/if_epair.c | 2 +- sys/net80211/ieee80211_ddb.c | 2 +- sys/net80211/ieee80211_ht.c | 6 +++--- sys/netinet/igmp.c | 2 +- sys/netinet6/mld6.c | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 42fb7a60ce57..ffc28e2685de 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3198,7 +3198,7 @@ lkpi_ic_node_free(struct ieee80211_node *ni) /* Flush mbufq (make sure to release ni refs!). */ #ifdef __notyet__ - KASSERT(mbufq_len(&lsta->txq) == 0, ("%s: lsta %p has txq len %d != 0\n", + KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", __func__, lsta, mbufq_len(&lsta->txq))); #endif /* Drain taskq. */ diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index ca5ff3f1d417..f57494065aec 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -1838,7 +1838,7 @@ check_desc_avail(adapter_t *adap, struct sge_txq *q, * the control queue is only used for binding qsets which happens * at init time so we are guaranteed enough descriptors */ - if (__predict_false(mbufq_len(&q->sendq))) { + if (__predict_false(!mbufq_empty(&q->sendq))) { addq_exit: (void )mbufq_enqueue(&q->sendq, m); return 1; } @@ -1954,7 +1954,7 @@ again: reclaim_completed_tx_imm(q); } q->in_use++; } - if (mbufq_len(&q->sendq)) { + if (!mbufq_empty(&q->sendq)) { setbit(&qs->txq_stopped, TXQ_CTRL); if (should_restart_tx(q) && diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index e5b173964451..77b6ba5d4032 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -323,8 +323,8 @@ release_offload_resources(struct toepcb *toep) * that a normal connection's socket's so_snd would have been purged or * drained. Do _not_ clean up here. */ - MPASS(mbufq_len(&toep->ulp_pduq) == 0); - MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0); + MPASS(mbufq_empty(&toep->ulp_pduq)); + MPASS(mbufq_empty(&toep->ulp_pdu_reclaimq)); #ifdef INVARIANTS if (ulp_mode(toep) == ULP_MODE_TCPDDP) ddp_assert_empty(toep); diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 2fa016c8f35c..7bc218321f01 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -177,7 +177,7 @@ epair_tx_start_deferred(void *arg, int pending) * end up starving ourselves in a multi-epair routing configuration. */ mtx_lock(&q->mtx); - if (mbufq_len(&q->q) > 0) { + if (!mbufq_empty(&q->q)) { resched = true; q->state = EPAIR_QUEUE_WAKING; } else { diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index cd4a4f191745..0042d5d4aeb6 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -222,7 +222,7 @@ _db_show_rxampdu(const char *sep, int ix, const struct ieee80211_rx_ampdu *rap) db_printf("%s age %d nframes %d\n", sep, rap->rxa_age, rap->rxa_nframes); for (i = 0; i < IEEE80211_AGGR_BAWMAX; i++) - if (mbufq_len(&rap->rxa_mq[i]) > 0) { + if (!mbufq_empty(&rap->rxa_mq[i])) { db_printf("%s m[%2u:%4u] ", sep, i, IEEE80211_SEQ_ADD(rap->rxa_start, i)); STAILQ_FOREACH(m, &rap->rxa_mq[i].mq_head, diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index a322c21b4673..cb981014fdb9 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -571,7 +571,7 @@ ampdu_rx_add_slot(struct ieee80211_rx_ampdu *rap, int off, int tid, /* * Get the rxs of the final mbuf in the slot, if one exists. */ - if (mbufq_len(&rap->rxa_mq[off]) != 0) { + if (!mbufq_empty(&rap->rxa_mq[off])) { rxs_final = ieee80211_get_rx_params_ptr(mbufq_last(&rap->rxa_mq[off])); } @@ -601,7 +601,7 @@ ampdu_rx_add_slot(struct ieee80211_rx_ampdu *rap, int off, int tid, * If the list is empty OR we have determined we can put more * driver decap'ed AMSDU frames in here, then insert. */ - if ((mbufq_len(&rap->rxa_mq[off]) == 0) || (toss_dup == 0)) { + if (mbufq_empty(&rap->rxa_mq[off]) || (toss_dup == 0)) { if (mbufq_enqueue(&rap->rxa_mq[off], m) != 0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, ni->ni_macaddr, @@ -1079,7 +1079,7 @@ again: /* * Dispatch as many packets as we can. */ - KASSERT((mbufq_len(&rap->rxa_mq[0]) == 0), ("unexpected dup")); + KASSERT(mbufq_empty(&rap->rxa_mq[0]), ("unexpected dup")); ampdu_dispatch(ni, m); ampdu_rx_dispatch(rap, ni); return CONSUMED; diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index c3dd0302fb39..3a60feadcdab 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -3381,7 +3381,7 @@ igmp_v3_dispatch_general_query(struct igmp_ifsoftc *igi) * many packets, we should finish sending them before starting of * queuing the new reply. */ - if (mbufq_len(&igi->igi_gq) != 0) + if (!mbufq_empty(&igi->igi_gq)) goto send; ifp = igi->igi_ifp; diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 309c9d11204f..6a64d1830afd 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -2995,7 +2995,7 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) * many packets, we should finish sending them before starting of * queuing the new reply. */ - if (mbufq_len(&mli->mli_gq) != 0) + if (!mbufq_empty(&mli->mli_gq)) goto send; ifp = mli->mli_ifp;