From nobody Thu Feb 17 01:01:01 2022 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 7339119CF854; Thu, 17 Feb 2022 01:01:02 +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 4Jzc2k04Fgz4frb; Thu, 17 Feb 2022 01:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645059662; 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=+lR7tRvmk5TNYaF+oI/G/QUJEwhPPrz0xI2ZEI8v+X8=; b=hq9qYgiyKKOWqAAqMWusQ1gn4Zb33a0WVNX5phxN5RRUTS1ldKgsPulWcFmqiINhso6Z3r CYGycKMPLb9OH+EDzIhl62uo5/9zYWJTfiwdojMS372EOq3Ht3fr8Ty8KriJ3BBsJLYo+s OQ2nbb+M+Se7ukxRLSPfIJEEmYcOYjP9f4qiNBRUStOPKVmsbio5KgB3+jlNOipVxR+CWb rbsn/fM+73omanK2THJAOuHBeKfev3wxHdNfv191Dx4vEalsWr1SEBKNH0OulZ3vxEv8OA GQ2QpCEfWgOVCcwOUqcg22vrty7Js+C+sHE/C/hs7hfcPkBljKXZepl5OOyhSw== 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 9692F20148; Thu, 17 Feb 2022 01:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21H111gV024147; Thu, 17 Feb 2022 01:01:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21H111BD024146; Thu, 17 Feb 2022 01:01:01 GMT (envelope-from git) Date: Thu, 17 Feb 2022 01:01:01 GMT Message-Id: <202202170101.21H111BD024146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c0cadd99d1e3 - main - LinuxKPI: 802.11 simplify beacon checks in rx path 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0cadd99d1e36ffe0994f8b30df2939f1d3d0fee Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645059662; 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=+lR7tRvmk5TNYaF+oI/G/QUJEwhPPrz0xI2ZEI8v+X8=; b=H1CA0xUaxHgQOxnVmMb4h2hayeBWkFCcm48gDSKrw5yWVaEo9lG2PR+W5FGcbqIK/SRe/+ 0qQMYl0GRmguisxam3oGxcF3C/Fj32rjHfuMB/JyNlB5caRvCHMly3PdtYTkzrdbKzkYhF 08PwWfHbaaQlnJrDyyWgkoDiCjqCTZLe6rgqSFBoqKLxcK706q2BVbMoPvvzO4bKyF1TFh 1qcv62YjIf8XsdtWlYZyY3rMT8dcVyxW7K/3NokFvJ7biBgALmZhUQDAmoa+1Uawtqmr+M QcfyihMpGQW6K2c7KjKDyVwpD+70CnbH9c2Q03zQ0bTAdz8UjzhevPrjgRXvYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645059662; a=rsa-sha256; cv=none; b=jJgTb8WTyVqnCH8kVejnisoNj3svGVJRQYGVQSUzKI1EWLYG3EuTFN+7x2ndWoBFNt1h8c 1lhbEtcvgrsYrZ0TuGzwrjPPzmCFXvHIVYyaCytG1kqot1D1KX3QyOqRsG3rhFhwvqHP1V BMV52nLiq+wLfw5NbY5cHwyMxtkWcxmy7yXMzbcbJm/AEwq0mvzjsNYBhz4eLdXzfY4l8e J9oXWk68+zeRFjIFbY1uib8VEMG5fl0AGnM7uB9nJDjK627YUIxGVHh6z8YjEY3VUsy1a0 GXC4lo5vzRV0gl/t1GGjPSZkM6FSD6UlZsIVgBZRi8OlClo73OKHoxCWdKwciQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c0cadd99d1e36ffe0994f8b30df2939f1d3d0fee commit c0cadd99d1e36ffe0994f8b30df2939f1d3d0fee Author: Bjoern A. Zeeb AuthorDate: 2022-02-17 00:58:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-17 00:58:12 +0000 LinuxKPI: 802.11 simplify beacon checks in rx path In linuxkpi_ieee80211_rx() check if the frame is a beacon once upfront and use the result for enhanced debugging and further checks. This was done intially for rx_status->device_timestamp debugging. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b5fde7e10781..2fe8b4ebddd0 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3165,6 +3165,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, struct ieee80211_hdr *hdr; struct lkpi_sta *lsta; int i, offset, ok, type; + bool is_beacon; if (skb->len < 2) { /* Need 80211 stats here. */ @@ -3192,19 +3193,20 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, rx_status = IEEE80211_SKB_RXCB(skb); -#ifdef LINUXKPI_DEBUG_80211 hdr = (void *)skb->data; - if ((debug_80211 & D80211_TRACE_RX_BEACONS) == 0 && - ieee80211_is_beacon(hdr->frame_control)) + is_beacon = ieee80211_is_beacon(hdr->frame_control); + +#ifdef LINUXKPI_DEBUG_80211 + if (is_beacon && (debug_80211 & D80211_TRACE_RX_BEACONS) == 0) goto no_trace_beacons; if (debug_80211 & D80211_TRACE_RX) printf("TRACE-RX: %s: skb %p a/l/d/t-len (%u/%u/%u/%u) " - "h %p d %p t %p e %p sh %p (%u) m %p plen %u len %u\n", + "h %p d %p t %p e %p sh %p (%u) m %p plen %u len %u%s\n", __func__, skb, skb->_alloc_len, skb->len, skb->data_len, skb->truesize, skb->head, skb->data, skb->tail, skb->end, shinfo, shinfo->nr_frags, - m, m->m_pkthdr.len, m->m_len); + m, m->m_pkthdr.len, m->m_len, is_beacon ? " beacon" : ""); if (debug_80211 & D80211_TRACE_RX_DUMP) hexdump(mtod(m, const void *), m->m_len, "RX (raw) ", 0); @@ -3288,10 +3290,11 @@ no_trace_beacons: vap = TAILQ_FIRST(&ic->ic_vaps); if (debug_80211 & D80211_TRACE_RX) - printf("TRACE %s: sta %p lsta %p ni %p vap %p\n", __func__, sta, lsta, ni, vap); + printf("TRACE %s: sta %p lsta %p state %d ni %p vap %p%s\n", + __func__, sta, lsta, (lsta != NULL) ? lsta->state : -1, + ni, vap, is_beacon ? " beacon" : ""); - if (ni != NULL && vap != NULL && - ieee80211_is_beacon(hdr->frame_control) && + if (ni != NULL && vap != NULL && is_beacon && rx_status->device_timestamp > 0 && m->m_pkthdr.len >= sizeof(struct ieee80211_frame)) { struct lkpi_vif *lvif;