From nobody Sun Aug 24 19:44:29 2025 X-Original-To: dev-commits-src-main@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 4c94BP3pBcz65wMp; Sun, 24 Aug 2025 19:44:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c94BP3FXPz3FY8; Sun, 24 Aug 2025 19:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756064669; 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=NqzL9qH/Wv8e2j4mD1izpqzuF1WLIL+NgxBz34T3uHo=; b=bJIi3pgGr+DC9iKUL6r15zoAKwxAXcBupkL4o8kBO0s4mP99kX8dRVKo/GTgTNOcponbmj 794AWdSsWB2l5BMaijYkHz0jlyMYMe8WZSuvGXWKKAmP2Rn1wrKWnViRTUs94FFL0kdYm8 XtENPceC3pCfWgYbdlEaF7wrvj4B1DHAjbcwFclMSKigAZocqeh6kd78e6fbgSYEFITA+u axoet4C8Z+SQzSlsc/pjYIosnxRb2XTX53Y51Wkb1SlqieYr3iZiytQ0qs6Hzq+SYPcJit i258Qs30dU8PC/0hS+jedrNYHZx3RbS+rf+x9dKJIyrzD3cP5t9nOeaz5s78Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756064669; 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=NqzL9qH/Wv8e2j4mD1izpqzuF1WLIL+NgxBz34T3uHo=; b=wbq8IlJzpleagyWHSrks82Q6H9uNf9GIZf/aO2DA//niDA2G6d5KIGmen8o2BYhse0T+HT FZ0rjchN8Mt5DJiC+hT0sv5KRQDl2GcktN84pVyq2TCw2d6w3CL/GShkSt/GaMNSeiaWyK G2hMFxeodAC/blecjac0VRrzkj3zzlFneudgn97JZzEqkUsFNBYQo1cEBbHCzv2MFDvoP1 fVxEYN6+iFdSketdbPFN+Sjht+r2E+IwO8e1kOwamsaKmJz7mO2xvNfZ9iqaSuXB1LWsSM EH2qiTJH8Na4amjPtdNICqtc/s3KRZr268KqIBQa183dIH0O4MHQX6lxef4t2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756064669; a=rsa-sha256; cv=none; b=qSvoPTGDSpnhf1+PMbrZyGhZ7ducvGvHy9zC4f4Y+xa5SG4kttdfNkJIf3Ye1Lfg9znfiZ FfimET7IPWBgqM8mW5PjUIEP6NUt5BIfeGBwiKHGzHltIwQlYjESXT8t5Rn7NjpRqQWjQ7 viHWSoSTtZ7KRyPWMNUiuH7o9r5AZWkPPdNb0d6PyeCGxCsScV0ve2/pNZBDPXKrMgpVzw TUG28x7jNFmiCCMsvMx1HUlnAkOjL+/2RE1FYp8NAGE4rD3Q56zRlVh4Gzqxjn9Caq+kRO jQF934STwnmsqKxAjdIrwgy6+BVjEf3UJk3RgWKDd+Jg/CuEHF1UPSvVRi+x2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4c94BP2j9Lz2Hw; Sun, 24 Aug 2025 19:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57OJiTIk024931; Sun, 24 Aug 2025 19:44:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57OJiTVx024928; Sun, 24 Aug 2025 19:44:29 GMT (envelope-from git) Date: Sun, 24 Aug 2025 19:44:29 GMT Message-Id: <202508241944.57OJiTVx024928@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: eabcd1773fa3 - main - net80211: add support for sequence number offloading List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eabcd1773fa3e4bf12ee053540a90fad79a6f81b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=eabcd1773fa3e4bf12ee053540a90fad79a6f81b commit eabcd1773fa3e4bf12ee053540a90fad79a6f81b Author: Adrian Chadd AuthorDate: 2025-06-05 00:17:45 +0000 Commit: Adrian Chadd CommitDate: 2025-08-24 19:43:27 +0000 net80211: add support for sequence number offloading Add support for sequence number offloading - * Check IEEE80211_CONF_SEQNO_OFFLOAD() before doing TX lock manipulation; * Don't call ieee80211_output_seqno_assign() if IEEE80211_CONF_SEQNO_OFFLOAD() is true. TODO: * this doesn't yet do beacon sequence number allocation offloading; I'll tackle that later. Differential Revision: https://reviews.freebsd.org/D50692 Reviewed by: bz --- sys/net80211/ieee80211_freebsd.h | 22 ++++++++++++++++------ sys/net80211/ieee80211_output.c | 11 ++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index 141b13f9f740..3684fba52c5c 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -93,12 +93,22 @@ typedef struct { } while (0) #define IEEE80211_TX_LOCK_OBJ(_ic) (&(_ic)->ic_txlock.mtx) #define IEEE80211_TX_LOCK_DESTROY(_ic) mtx_destroy(IEEE80211_TX_LOCK_OBJ(_ic)) -#define IEEE80211_TX_LOCK(_ic) mtx_lock(IEEE80211_TX_LOCK_OBJ(_ic)) -#define IEEE80211_TX_UNLOCK(_ic) mtx_unlock(IEEE80211_TX_LOCK_OBJ(_ic)) -#define IEEE80211_TX_LOCK_ASSERT(_ic) \ - mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_OWNED) -#define IEEE80211_TX_UNLOCK_ASSERT(_ic) \ - mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_NOTOWNED) +#define IEEE80211_TX_LOCK(_ic) do { \ + if (!IEEE80211_CONF_SEQNO_OFFLOAD(_ic)) \ + mtx_lock(IEEE80211_TX_LOCK_OBJ(_ic)); \ + } while (0); +#define IEEE80211_TX_UNLOCK(_ic) do { \ + if (!IEEE80211_CONF_SEQNO_OFFLOAD(_ic)) \ + mtx_unlock(IEEE80211_TX_LOCK_OBJ(_ic)); \ + } while (0); +#define IEEE80211_TX_LOCK_ASSERT(_ic) do { \ + if (!IEEE80211_CONF_SEQNO_OFFLOAD(_ic)) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_OWNED); \ + } while (0) +#define IEEE80211_TX_UNLOCK_ASSERT(_ic) { \ + if (!IEEE80211_CONF_SEQNO_OFFLOAD(_ic)) \ + mtx_assert(IEEE80211_TX_LOCK_OBJ(_ic), MA_NOTOWNED); \ + } while (0) /* * Stageq / ni_tx_superg lock diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index afe83ea0805c..57fe687adffe 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -974,7 +974,7 @@ ieee80211_send_setup( /* NB: zero out i_seq field (for s/w encryption etc) */ *(uint16_t *)&wh->i_seq[0] = 0; - } else + } else if (!IEEE80211_CONF_SEQNO_OFFLOAD(ni->ni_ic)) ieee80211_output_seqno_assign(ni, tid, m); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) @@ -1810,7 +1810,8 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, * and we don't need the TX lock held. */ if ((m->m_flags & M_AMPDU_MPDU) == 0) { - ieee80211_output_seqno_assign(ni, tid, m); + if (!IEEE80211_CONF_SEQNO_OFFLOAD(ic)) + ieee80211_output_seqno_assign(ni, tid, m); } else { /* * NB: don't assign a sequence # to potential @@ -1828,7 +1829,9 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, *(uint16_t *)wh->i_seq = 0; } } else { - ieee80211_output_seqno_assign(ni, IEEE80211_NONQOS_TID, m); + if (!IEEE80211_CONF_SEQNO_OFFLOAD(ic)) + ieee80211_output_seqno_assign(ni, IEEE80211_NONQOS_TID, + m); /* * XXX TODO: we shouldn't allow EAPOL, etc that would * be forced to be non-QoS traffic to be A-MSDU encapsulated. @@ -3856,6 +3859,8 @@ ieee80211_beacon_update(struct ieee80211_node *ni, struct mbuf *m, int mcast) * If the driver identifies it does its own TX seqno management then * we can skip this (and still not do the TX seqno.) */ + + /* TODO: IEEE80211_CONF_SEQNO_OFFLOAD() */ ieee80211_output_beacon_seqno_assign(ni, m); /* XXX faster to recalculate entirely or just changes? */