From nobody Fri Jul 01 14:57:40 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 405668A3757; Fri, 1 Jul 2022 14:57:41 +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 4LZJGF1KYYz4dtc; Fri, 1 Jul 2022 14:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656687461; 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=5iZpz64HShkyEP29BvlTfOpL9fzPCXDLXlQ4bDGZUIY=; b=GoKTmYByliTBRrORytaYJUvGhE+C2gBazHHn1llkOKcLmj18xtQopjeLBJd9E8BW2LDnfX V1R4KmEeHj5Zz6jGk1dkdToOWWsTPdVWCCEsHUq1VzaAMYZQ2dpkHQ82vpUNxrEIro1XOd CPxQyUct+OANbNR2qzls2oWhh9EofNBSVgU2Xf5T1SXDNoyUM6CJRAFNl6NpqhehYCXyoL ugPhhFenhNW7VFywEr7t7GnIzXdV4xgl6FXJsdIu0yfNmf06pPVkJTFExFk8+CwWaoyvIt dSMyyUgL91R3egxSPbyPMbE5riqkMSEwTnVeUDgwDjCHwvXaMEpj5Du6wgtQKA== 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 0D4B61DA00; Fri, 1 Jul 2022 14:57:41 +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 261Eve6W057816; Fri, 1 Jul 2022 14:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 261Evepj057815; Fri, 1 Jul 2022 14:57:40 GMT (envelope-from git) Date: Fri, 1 Jul 2022 14:57:40 GMT Message-Id: <202207011457.261Evepj057815@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: 74cedb5e9016 - stable/13 - LinuxKPI: 802.11: rework handling of the special IEEE80211_NUM_TIDS queue 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: 74cedb5e90166d8d579a74444b8c72fd430045af Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656687461; 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=5iZpz64HShkyEP29BvlTfOpL9fzPCXDLXlQ4bDGZUIY=; b=E/uW1rcztGnGeedClhT/WxE3BGYBI2RCcfBOQBkpQ0CjaDokb/B90jJtNUxY1iRFEDIwCt 9/tQq057tjAuxiFKSWlgLDw2j05rSgnu4U1FuEkCUStsU6scSVGZ5PmV4IfLMX62RseYHo zgQVcl4PyYG2joTbQiC1Zr0X2skFmSSIfCSO7dJ2O2l7Sb0siq7l5bop7wReUtE5e0gCrN 7FPTh7j3wHUieG3G3boj2jXZaxoB15RFzIGFMTJHT90deIK5BeqK3jne4bF5xCzLM+FnzB J5B6W9/JZC3RmNxyWHTmZirpl95rcIqKng68IBf0CVn9FUrrDpGK8Zx6uemong== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656687461; a=rsa-sha256; cv=none; b=IWIYODqs8GsixLZS64P2bi+iZ5RSJRPm1o8dPVsb0VWaJ/o6bvIcidoJFeGnzr6pbnJZcM NMDZUX8b6Zl7isytkM5qi9YCizXUDfYRcBDrzskJqj6dXpuyCdvXHV0a0UsXnMS3KuNytW z8Yc+GSd66+FwdVSxYWTK0UsyjryXtyFKOXN0r717I2llNLaQxGIUyjzNgakmPoUYQt8WF DxdgPMEu8cNsATnu0vedjyxurp1CuaALQ2toCwd1C+w27S42Tgae6NgyhvWxsVnGuqkeOU nOqIpj5si7gkZnQ0Jch6O39WaxA2jlzKW6ZCcZsr9zxBYxOAgp5mYvopHW0YpA== 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=74cedb5e90166d8d579a74444b8c72fd430045af commit 74cedb5e90166d8d579a74444b8c72fd430045af Author: Bjoern A. Zeeb AuthorDate: 2022-06-10 14:18:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-07-01 13:45:09 +0000 LinuxKPI: 802.11: rework handling of the special IEEE80211_NUM_TIDS queue Rework the way we are dealing with the last queue. If the driver opts in to STA_MMPDU_TXQ then preferably send all non-data frames via the last (IEEE80211_NUM_TIDS) queue which otherwise is not used in station mode. If we do not have that queue we do individual tx() calls for non-data frames now. Everything else goes via the selected queue if possible for as long as we have a ni (sta) and otherwise resorts to direct tx. Tested on: Intel AX200 and AX210 Sponsored by: The FreeBSD Foundation (cherry picked from commit d0d2911035192473e8bd3f6b99ed5ca9b1b29e47) (cherry picked from commit fb6eaf74e9ead477be1f25cba88273ab65ece0d1) --- sys/compat/linuxkpi/common/src/linux_80211.c | 55 +++++++++++++++++++--------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 094724c57d10..8a6ddf63e3f5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -219,27 +219,27 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], for (tid = 0; tid < nitems(sta->txq); tid++) { struct lkpi_txq *ltxq; - /* - * We are neither limiting ourselves to hw.queues here, - * nor do we check if driver wants IEEE80211_NUM_TIDS queue. - */ - + /* We are not limiting ourselves to hw.queues here. */ ltxq = malloc(sizeof(*ltxq) + hw->txq_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); if (ltxq == NULL) goto cleanup; - ltxq->seen_dequeue = false; - skb_queue_head_init(<xq->skbq); /* iwlwifi//mvm/sta.c::tid_to_mac80211_ac[] */ if (tid == IEEE80211_NUM_TIDS) { - IMPROVE(); + if (!ieee80211_hw_check(hw, STA_MMPDU_TXQ)) { + free(ltxq, M_LKPI80211); + continue; + } + IMPROVE("AP/if we support non-STA here too"); ltxq->txq.ac = IEEE80211_AC_VO; } else { ltxq->txq.ac = tid_to_mac80211_ac[tid & 7]; } + ltxq->seen_dequeue = false; + ltxq->txq.vif = vif; ltxq->txq.tid = tid; ltxq->txq.sta = sta; - ltxq->txq.vif = vif; + skb_queue_head_init(<xq->skbq); sta->txq[tid] = <xq->txq; } @@ -3043,8 +3043,22 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) if (sta != NULL) { struct lkpi_txq *ltxq; + struct ieee80211_hdr *hdr; + + hdr = (void *)skb->data; + if (lsta->added_to_drv && + !ieee80211_is_data_present(hdr->frame_control)) { + if (sta->txq[IEEE80211_NUM_TIDS] != NULL) + ltxq = TXQ_TO_LTXQ(sta->txq[IEEE80211_NUM_TIDS]); + else + goto ops_tx; + } else if (lsta->added_to_drv) { + ltxq = TXQ_TO_LTXQ(sta->txq[ac]); /* XXX-BZ re-check */ + } else + 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)); - ltxq = TXQ_TO_LTXQ(sta->txq[ac]); /* XXX-BZ re-check */ /* * We currently do not use queues but do direct TX. * The exception to the rule is initial packets, as we cannot @@ -3053,6 +3067,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) * calls. In the time until then we queue packets and * let the driver deal with them. */ +#if 0 if (!ltxq->seen_dequeue) { /* Prevent an ordering problem, likely other issues. */ @@ -3070,25 +3085,29 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) } if (0 && ltxq->seen_dequeue && skb_queue_empty(<xq->skbq)) goto ops_tx; +#endif skb_queue_tail(<xq->skbq, skb); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) - printf("%s:%d lsta %p sta %p ni %p %6D skb %p lxtq %p " - "qlen %u WAKE_TX_Q ac %d prio %u qmap %u\n", - __func__, __LINE__, lsta, sta, ni, - ni->ni_macaddr, ":", skb, ltxq, - skb_queue_len(<xq->skbq), ac, - skb->priority, skb->qmap); + 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_mo_wake_tx_queue(hw, sta->txq[ac]); /* XXX-BZ */ + lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); return; } ops_tx: #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) - printf("%s:%d lsta %p sta %p ni %p %6D skb %p TX ac %d prio %u qmap %u\n", + printf("%s:%d mo_tx :: lsta %p sta %p ni %p %6D skb %p " + "TX ac %d prio %u qmap %u\n", __func__, __LINE__, lsta, sta, ni, ni->ni_macaddr, ":", skb, ac, skb->priority, skb->qmap); #endif