linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Remi Pommarel <repk@triplefau.lt>,
	Nicolas Escande <nico.escande@gmail.com>,
	Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 4.9 19/32] mac80211: fix forwarded mesh frames AC & queue selection
Date: Mon,  7 Mar 2022 10:18:45 +0100	[thread overview]
Message-ID: <20220307091634.985087061@linuxfoundation.org> (raw)
In-Reply-To: <20220307091634.434478485@linuxfoundation.org>

From: Nicolas Escande <nico.escande@gmail.com>

commit 859ae7018316daa4adbc496012dcbbb458d7e510 upstream.

There are two problems with the current code that have been highlighted
with the AQL feature that is now enbaled by default.

First problem is in ieee80211_rx_h_mesh_fwding(),
ieee80211_select_queue_80211() is used on received packets to choose
the sending AC queue of the forwarding packet although this function
should only be called on TX packet (it uses ieee80211_tx_info).
This ends with forwarded mesh packets been sent on unrelated random AC
queue. To fix that, AC queue can directly be infered from skb->priority
which has been extracted from QOS info (see ieee80211_parse_qos()).

Second problem is the value of queue_mapping set on forwarded mesh
frames via skb_set_queue_mapping() is not the AC of the packet but a
hardware queue index. This may or may not work depending on AC to HW
queue mapping which is driver specific.

Both of these issues lead to improper AC selection while forwarding
mesh packets but more importantly due to improper airtime accounting
(which is done on a per STA, per AC basis) caused traffic stall with
the introduction of AQL.

Fixes: cf44012810cc ("mac80211: fix unnecessary frame drops in mesh fwding")
Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping")
Co-developed-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://lore.kernel.org/r/20220214173214.368862-1-nico.escande@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/mac80211/rx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2607,13 +2607,13 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
 	    ether_addr_equal(sdata->vif.addr, hdr->addr3))
 		return RX_CONTINUE;
 
-	ac = ieee80211_select_queue_80211(sdata, skb, hdr);
+	ac = ieee802_1d_to_ac[skb->priority];
 	q = sdata->vif.hw_queue[ac];
 	if (ieee80211_queue_stopped(&local->hw, q)) {
 		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
 		return RX_DROP_MONITOR;
 	}
-	skb_set_queue_mapping(skb, q);
+	skb_set_queue_mapping(skb, ac);
 
 	if (!--mesh_hdr->ttl) {
 		if (!is_multicast_ether_addr(hdr->addr1))



  parent reply	other threads:[~2022-03-07  9:20 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  9:18 [PATCH 4.9 00/32] 4.9.305-rc1 review Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 01/32] mac80211_hwsim: report NOACK frames in tx_status Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 02/32] mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 03/32] i2c: bcm2835: Avoid clock stretching timeouts Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 04/32] Input: clear BTN_RIGHT/MIDDLE on buttonpads Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 05/32] cifs: fix double free race when mount fails in cifs_get_root() Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 06/32] dmaengine: shdma: Fix runtime PM imbalance on error Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 07/32] i2c: qup: allow COMPILE_TEST Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 08/32] net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 09/32] usb: gadget: dont release an existing dev->buf Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 10/32] usb: gadget: clear related members when goto fail Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 11/32] ata: pata_hpt37x: fix PCI clock detection Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 12/32] ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 13/32] xfrm: fix MTU regression Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 14/32] netfilter: nf_queue: dont assume sk is full socket Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 15/32] netfilter: nf_queue: fix possible use-after-free Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 16/32] net: dcb: flush lingering app table entries for unregistered devices Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 17/32] firmware: Fix a reference count leak Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 18/32] firmware: qemu_fw_cfg: fix kobject leak in probe error path Greg Kroah-Hartman
2022-03-07  9:18 ` Greg Kroah-Hartman [this message]
2022-03-07  9:18 ` [PATCH 4.9 20/32] net: stmmac: fix return value of __setup handler Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 21/32] net: sxgbe: " Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 22/32] net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 23/32] efivars: Respect "block" flag in efivar_entry_set_safe() Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 24/32] can: gs_usb: change active_channelss type from atomic_t to u8 Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 25/32] ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 26/32] soc: fsl: qe: Check of ioremap return value Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 27/32] net: chelsio: cxgb3: check the return value of pci_find_capability() Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 28/32] Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power() Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 29/32] Input: elan_i2c - fix regulator enable count imbalance after suspend/resume Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 30/32] HID: add mapping for KEY_ALL_APPLICATIONS Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 31/32] memfd: fix F_SEAL_WRITE after shmem huge page allocated Greg Kroah-Hartman
2022-03-07  9:18 ` [PATCH 4.9 32/32] net: dcb: disable softirqs in dcbnl_flush_dev() Greg Kroah-Hartman
2022-03-07 18:19 ` [PATCH 4.9 00/32] 4.9.305-rc1 review Florian Fainelli
2022-03-07 23:46 ` Shuah Khan
2022-03-08 15:57 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307091634.985087061@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico.escande@gmail.com \
    --cc=repk@triplefau.lt \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).