Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1777973pxp; Mon, 7 Mar 2022 02:05:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2mXx3Mco1ERzbzxVieZVaYwFGhhDCVgySQZZeFQXpWDGieHgu6mdFJ1uHYN4b4xlnk9cd X-Received: by 2002:a17:907:91c8:b0:6d6:e98f:8342 with SMTP id h8-20020a17090791c800b006d6e98f8342mr8413309ejz.590.1646647542018; Mon, 07 Mar 2022 02:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646647542; cv=none; d=google.com; s=arc-20160816; b=qgtFKdzjSdXrse5E+HMWwdSXlJ4DaIm+r3x+Uh273cevErr3Kz+6y+pzgoCsryNL+R 0iT8kBIW7wM3dSRTKRGeumZRiWwPRR59bVHpWLoDgfUa9naB7tJ4qMCkGXz/ZTzSwcFU t82ANX7a2k/qi/aDpjwGumwsAdIHQqzbKCf1uEQIYr9xlgzpehI1UHGwvZtpUnT/KiRn BiVfSAam9Xn0tiG82nKmX7K56Ry0Ys08IdaWxFXoFqZXcBXFrAHhwx/CRZkRKXJYqThi pXenB3HZ783MnwaPSWwzHTzLSs+rTeCTtZmg+dLzeilpLg1VO1R83AFJ/uiYCx+IO0CL RIjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OtTya1pUZgQfoMvS8afCsCthsr33TAmUvooeGsMsJJY=; b=BTBePYt9t2g56bmQ3EyZ7xUB0j2dwLEY1qPQmCfbwfuuHSmkl60X0JBW8QWs3IhSHK 59zw1LrjqGYme/oml9NjrBDflgr2JQUu8k7SbjWITN91nHoOsMtzgS0KCY4HlRiEWq/V aofRYsWeBknH+IjVZUgryeMjqzJseUNn+/i9ijd0XDoL1W+oFVJmOFnNwquKi3QAXci6 D0rOmkF5qK5vT4b7/sLFmt/8KCEBq8TmvikdzktnZjVKYghSjCpn/J537I0XKMVFIeEj LIpQRcPgu+Q8nL60Dkxx4w7oD+AaTQRSOCny0UgYC8M1GRQb39HfNHStfxtLomC7Kj4j 87DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0/LMWVpk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg27-20020a170907971b00b006d7b7278a03si8499424ejc.463.2022.03.07.02.05.18; Mon, 07 Mar 2022 02:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0/LMWVpk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237195AbiCGJcS (ORCPT + 99 others); Mon, 7 Mar 2022 04:32:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237729AbiCGJ2X (ORCPT ); Mon, 7 Mar 2022 04:28:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2BC6B0A4; Mon, 7 Mar 2022 01:25:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AE5F3B810B2; Mon, 7 Mar 2022 09:25:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22ED3C340E9; Mon, 7 Mar 2022 09:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646645154; bh=lkJ1TuDe+NCj93RRrdfk/jnULDxvKeOIWDLd82UqhVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0/LMWVpkwonHE6kredL4dEzxhQyoszrdk7iTNec2sbB0Vf/dc1TfVbrmJsOwicJyS U7YX7rhy07NH63XzHOSUmr62xwwrCJOMDaMfFg9YGcW9VodxaKmUs4BwS8qTAdKH4d emu+TQ2Q/hSitMbMHbVN+Z53EUQgp8iKk50N7Rdg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Remi Pommarel , Nicolas Escande , Johannes Berg Subject: [PATCH 4.19 32/51] mac80211: fix forwarded mesh frames AC & queue selection Date: Mon, 7 Mar 2022 10:19:07 +0100 Message-Id: <20220307091637.905838882@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091636.988950823@linuxfoundation.org> References: <20220307091636.988950823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Escande 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 Signed-off-by: Remi Pommarel Signed-off-by: Nicolas Escande Link: https://lore.kernel.org/r/20220214173214.368862-1-nico.escande@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2774,13 +2774,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))