From nobody Sun Feb 20 18:15:55 2022 X-Original-To: dev-commits-src-branches@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 870F919D012B; Sun, 20 Feb 2022 18:15:58 +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 4K1tsS33S2z4YB6; Sun, 20 Feb 2022 18:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380956; 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=fO2iNRsQp8oMYZA0jUIZ/T7P1QzhH8HCnRnMWEKMscU=; b=cfonxJj3gL2SE77lyqLSZA9e33wBQ/kycNoj4uXJoIxidjov3Fu6J8urlD+i21QhuQHmkl wAV5r114QZg8sbzmPqTOqDcy5d/J5bgqg2LXaJxO6svhnVBy7pXUhXSjHGqtfd4IeMh5H7 p2iiCE0rBRjaoCs4N/ZdH8KWKzhXtiCaU4qiq9II+DO03obSi+GmzK+TM34kcUWBKqB/du NPkbkfpgqt3GM6XLQdecfUIYJtPvZD0CdwQ1FIbo6M6Fkm0ZPrv8PMe3wi3zDpXp7gG8N0 nGjeypn6zcOcVes0ANBQapW1Pr/CyRv7cMgGfC6M1NRAMvbVblkCg+AwKJduWQ== 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 BE63220DFB; Sun, 20 Feb 2022 18:15:55 +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 21KIFto4023336; Sun, 20 Feb 2022 18:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KIFtxW023335; Sun, 20 Feb 2022 18:15:55 GMT (envelope-from git) Date: Sun, 20 Feb 2022 18:15:55 GMT Message-Id: <202202201815.21KIFtxW023335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 999377a66d2e - stable/13 - LinuxKPI: 802.11 simplify beacon checks in rx path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 999377a66d2e21460fc156dd35708d4315fe901b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380956; 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=fO2iNRsQp8oMYZA0jUIZ/T7P1QzhH8HCnRnMWEKMscU=; b=Lp39jANj9XeJJ7IhUfnKVP8Pf3XIisOj8WhfKm9PV03kST40wsqsibBWIiYmxVLE8Qznpf HKISwuBuT38pSQZckHfcpTh0C5VcM9B0xXLvjY4dLG0fMzgmWHF4817awy6bSGkMmslNcH 3eXEsLbCayL0zlVznuiuhOAY1hfLfH6FOkH/ktnyGN+Txvb8K3DjXSfnuAZv/X2IOgGeMO +ugMcaVOLMuG7KN0UgLBpzspE6IbCvs5rPJfJXYrSJ6mOzUL53qTqULiAsC+rYFBvY85JN fnEUdRQI63E/gnmd6q23PGfzueIkCwQ1K6b5pqoIzTW+bqVnoO6oL/rkwgzQ7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645380956; a=rsa-sha256; cv=none; b=v1/I+H7qRufsRICk2mb2CaNzEW9mEClLrZBicuUQw/QOI97ksv1sKDuli4QSRLy8ITMmoM 7ZtU1TpgXVB4NoBKVwj7vJCcYwO2pNPSXWBBruZZx2CxLn/PDBaXLiTSQyJS8g5ruFuuGj 53xMhD1jBJD/9/xwsaW/9+pBzTI9rXiMgMF3F91NFeH8EdM7H5ZQxUS3pO8yXhYOim19Yu DCMDgHHCi7AXjoCv5s/qoTDpVopVi317EELYzuMpF+/MDNbvKPukA0gRzsk2wQnPi+7Yqd YM3Wa9W/4DvJxZRXCUGYFi+E3QP14IVn5XzMrNDHCv7yODn4YHPZ8jHT6vpscg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=999377a66d2e21460fc156dd35708d4315fe901b commit 999377a66d2e21460fc156dd35708d4315fe901b Author: Bjoern A. Zeeb AuthorDate: 2022-02-17 00:58:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-20 16:26:06 +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 (cherry picked from commit c0cadd99d1e36ffe0994f8b30df2939f1d3d0fee) --- 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;