From nobody Mon Apr 22 19:44:04 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 4VNbKc301Tz5HltD; Mon, 22 Apr 2024 19:44:04 +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 4VNbKc1HXpz4mVN; Mon, 22 Apr 2024 19:44:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713815044; 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=6M8HIJfKoTvwTZeu+J3kZQtTF2RTq7zW1Nrmk1ICyZs=; b=FHMVS5WfYcn6R316ugm5gHzHztLsulRh3BQsdaoHk5BXPaNI+2t08cfx5blQRzVVcQZpy3 abWZGvHr8vfQFZPVWbM+pGzpOldjMUo3PwTZ0LXl26V4YbE54Prx00yUg2hlK0iO/wb378 acsEhxMNOYCOBkXtYDPpGxysEsDGN/+scodyqXxcGICf5iw9Wo9wue5hw9+WVzhyeSdVpm KiwcgvGmLF4l6kgI7psxqPGbe5DOWFIKT0Uf++XofqTw9vRjfwij/lObbAJqxNZvA80AVI hhL4emnM+P0AdVZPBVUFudTeosFDa4+Rd+02nHqV+gQVoKaL8eRgnBcO/WNpKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713815044; a=rsa-sha256; cv=none; b=HA7NMHAOc8nOOhVL4TTYgyiRlWuEEymhI771E4G8ON3y2gTLPqY+O92oxv7t8xtj1CqunN 1+kgEl+3tLWv1/TYccQ6S7y+eSMESVazbjxf7IZhP1h0fhfemkFMHACaX8Ev/cERkHyKOo UqXv+y1gjt36Iu1lbqENLzTokKF7jthRKhsvMwG5kvLJTIix9OZ5jNW1HELVipcel9RKM4 W1NgBDd+otLA8SbyObvCit2dGx6rrRP09fKuTt/WCOwEFDnq9ykqr4Y9U4UsCB5fTvZhLW 48vjo0oepIJKC8fZtEtOUa9NUeFyuF21V6AhIQZWpd3ptGJZlQBVT0bcHAyv+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713815044; 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=6M8HIJfKoTvwTZeu+J3kZQtTF2RTq7zW1Nrmk1ICyZs=; b=daFEc16pt7Q/AaOSgLSkyBmxGgn9Kdss/vHx4bS424qT6CTJXwX57dw2ZPh/ptX2W1aVDt JHD/yca0sejyuqxeyvf2Ds7ADn+KqDYqzP+zxSXEk2rBp5Fo8RdgX+GgpzdgYq9podUGKu 0kyrr2KwuFi45oIx/S/t5f2AlksWt7FpPyQFeoKJN77cp8x/dRr/JXCsk0/STSJLx4+not wisNGOzDU+a/KMJBoPN+7qGZFORFq812kSjq4cVbE+LhiDg5YuTkhTjBZ4wDxdXnYwDGrK EPRanTQEZ0seNs9FRlIFbMerivww+W5grXUmVtBiCSiOsrWi4KNEWMbmPX1TMw== 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 4VNbKc0thRz11x1; Mon, 22 Apr 2024 19:44:04 +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 43MJi4R6032323; Mon, 22 Apr 2024 19:44:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43MJi4pK032320; Mon, 22 Apr 2024 19:44:04 GMT (envelope-from git) Date: Mon, 22 Apr 2024 19:44:04 GMT Message-Id: <202404221944.43MJi4pK032320@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: fb94767f7863 - stable/14 - LinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: fb94767f7863ff6d05cb8fddd39a1f464d9fb7b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fb94767f7863ff6d05cb8fddd39a1f464d9fb7b9 commit fb94767f7863ff6d05cb8fddd39a1f464d9fb7b9 Author: Bjoern A. Zeeb AuthorDate: 2024-02-18 18:07:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-22 17:00:16 +0000 LinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one() Given we are passed the lsta in as a function argument there is no need to re-lookup the sta by ni and possibly not find it. We know the sta and ni from the lsta and whether it is uploaded to firmware or not we can check directly from the local lsta flag. Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43965 (cherry picked from commit ac867c20e67423e5019ab90148c387ea127eeffb) --- sys/compat/linuxkpi/common/src/linux_80211.c | 76 +++++++++++++--------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d5a97009200f..daf7eb7a5661 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -142,8 +142,10 @@ const struct cfg80211_ops linuxkpi_mac80211cfgops = { */ }; +#if 0 static struct lkpi_sta *lkpi_find_lsta_by_ni(struct lkpi_vif *, struct ieee80211_node *); +#endif static void lkpi_80211_txq_task(void *, int); static void lkpi_80211_lhw_rxq_task(void *, int); static void lkpi_ieee80211_free_skb_mbuf(void *); @@ -3584,6 +3586,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) struct ieee80211_tx_info *info; struct ieee80211_sta *sta; struct ieee80211_hdr *hdr; + struct lkpi_txq *ltxq; void *buf; uint8_t ac, tid; @@ -3694,54 +3697,45 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) #endif #endif - lsta = lkpi_find_lsta_by_ni(lvif, ni); - if (lsta != NULL) { - sta = LSTA_TO_STA(lsta); + sta = LSTA_TO_STA(lsta); #ifdef LKPI_80211_HW_CRYPTO - info->control.hw_key = lsta->kc; + info->control.hw_key = lsta->kc; #endif - } else { - sta = NULL; - } IMPROVE(); - if (sta != NULL) { - struct lkpi_txq *ltxq; - - ltxq = NULL; - if (!ieee80211_is_data_present(hdr->frame_control)) { - if (vif->type == NL80211_IFTYPE_STATION && - lsta->added_to_drv && - sta->txq[IEEE80211_NUM_TIDS] != NULL) - ltxq = TXQ_TO_LTXQ(sta->txq[IEEE80211_NUM_TIDS]); - } else if (lsta->added_to_drv && - sta->txq[skb->priority] != NULL) { - ltxq = TXQ_TO_LTXQ(sta->txq[skb->priority]); - } - if (ltxq == NULL) - goto ops_tx; + ltxq = NULL; + if (!ieee80211_is_data_present(hdr->frame_control)) { + if (vif->type == NL80211_IFTYPE_STATION && + lsta->added_to_drv && + sta->txq[IEEE80211_NUM_TIDS] != NULL) + ltxq = TXQ_TO_LTXQ(sta->txq[IEEE80211_NUM_TIDS]); + } else if (lsta->added_to_drv && + sta->txq[skb->priority] != NULL) { + ltxq = TXQ_TO_LTXQ(sta->txq[skb->priority]); + } + if (ltxq == NULL) + goto ops_tx; - KASSERT(ltxq != NULL, ("%s: lsta %p sta %p m %p skb %p " - "ltxq %p != NULL\n", __func__, lsta, sta, m, skb, ltxq)); + KASSERT(ltxq != NULL, ("%s: lsta %p sta %p m %p skb %p " + "ltxq %p != NULL\n", __func__, lsta, sta, m, skb, ltxq)); - LKPI_80211_LTXQ_LOCK(ltxq); - skb_queue_tail(<xq->skbq, skb); + LKPI_80211_LTXQ_LOCK(ltxq); + skb_queue_tail(<xq->skbq, skb); #ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE_TX) - printf("%s:%d mo_wake_tx_queue :: %d %u lsta %p sta %p " - "ni %p %6D skb %p lxtq %p { qlen %u, ac %d tid %u } " - "WAKE_TX_Q ac %d prio %u qmap %u\n", - __func__, __LINE__, - curthread->td_tid, (unsigned int)ticks, - lsta, sta, ni, ni->ni_macaddr, ":", skb, ltxq, - skb_queue_len(<xq->skbq), ltxq->txq.ac, - ltxq->txq.tid, ac, skb->priority, skb->qmap); + if (linuxkpi_debug_80211 & D80211_TRACE_TX) + printf("%s:%d mo_wake_tx_queue :: %d %u lsta %p sta %p " + "ni %p %6D skb %p lxtq %p { qlen %u, ac %d tid %u } " + "WAKE_TX_Q ac %d prio %u qmap %u\n", + __func__, __LINE__, + curthread->td_tid, (unsigned int)ticks, + lsta, sta, ni, ni->ni_macaddr, ":", skb, ltxq, + skb_queue_len(<xq->skbq), ltxq->txq.ac, + ltxq->txq.tid, ac, skb->priority, skb->qmap); #endif - LKPI_80211_LTXQ_UNLOCK(ltxq); - lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); - return; - } + LKPI_80211_LTXQ_UNLOCK(ltxq); + lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); + return; ops_tx: #ifdef LINUXKPI_DEBUG_80211 @@ -3753,9 +3747,7 @@ ops_tx: #endif memset(&control, 0, sizeof(control)); control.sta = sta; - lkpi_80211_mo_tx(hw, &control, skb); - return; } static void @@ -5225,6 +5217,7 @@ linuxkpi_ieee80211_frequency_to_channel(uint32_t freq, uint32_t flags __unused) return (ieee80211_mhz2ieee(freq, 0)); } +#if 0 static struct lkpi_sta * lkpi_find_lsta_by_ni(struct lkpi_vif *lvif, struct ieee80211_node *ni) { @@ -5241,6 +5234,7 @@ lkpi_find_lsta_by_ni(struct lkpi_vif *lvif, struct ieee80211_node *ni) return (NULL); } +#endif struct ieee80211_sta * linuxkpi_ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer)