Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp44713pxj; Mon, 17 May 2021 20:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEbzLGYmIwUUIfsTtmkCHo2dSRMLFvVuLSoT1yTQLHRawvw8gT9H2kwvCwwkjFDRV+b0WB X-Received: by 2002:a02:b107:: with SMTP id r7mr3381557jah.8.1621308511726; Mon, 17 May 2021 20:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621308511; cv=none; d=google.com; s=arc-20160816; b=GfXgvTIZ0xkmcYzhYOsuXCT9f7E1VXGxWCXj4ygc6SC8/u5mtxhTTo/jkMSb01DX6g v9v7gU9sRhQAOtj4kV9iJtOyKn3HXigLsxBk/v9WradeT3nHtQ/tq/kRqaYjSPtTj/rM YyJdyzh2xbU9MhxnSbIjhRtdcCLvgDVOsGiONWrHWFQwqoS0YT35RLoN63ciyJgP7fAa xIkoayOzePJU60BuosLOfiA93Rs7J3XQZqSKYpIM/82PDsKGZgUV3MK+9cY8ukQCJWNT SZMfzSng0dmi1oShujMMs/ylYkc8eviVYzkAV/ba93SsT9/6DLuH+c/HJT7FoHW+2jBH wBnw== 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=1wYbJ62r6RpH78fE69xVF7+fXQ2fJoLRrd6JH7G81VM=; b=m2McOiOed7CSRFSphNBm2wxHBR1y/NblopngTi+SYRmigCf57b7nNopW1YNCBbtUHZ ADlBY3EFonUTasz8VJWkU0KbQM2D7PdHHX06AGZYzbdE2vJZUlIc7la+V4F2/kkgCe8i RmFi6Bqwkq8ATgj393E+mtHjfoRX9eTk+s9umJguZmmBwXgHI5B1Y/j/2rq3uB1X8USo 8JHOYJZY5JQM1etTDRkvg5LoR/FwRSsFeZUR5VDkusPUu1/rtAnERZW4UlhvZamA8CKg Eu8XwGp1ME8tr5bj29wPE/kWxAalQkNe+bUdnRbW8CJAtYxXVV2tKuKhaYMwd1nG/nmW fQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t0hhlmej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si18231385ioc.87.2021.05.17.20.28.04; Mon, 17 May 2021 20:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t0hhlmej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S241107AbhEQOj1 (ORCPT + 99 others); Mon, 17 May 2021 10:39:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240362AbhEQOeJ (ORCPT ); Mon, 17 May 2021 10:34:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8337061040; Mon, 17 May 2021 14:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261001; bh=BVWlPA/KL4xZMewJbjfvM8i8Zx/VWdWhlC9t6J9uyzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t0hhlmej3cScz+D8lFSrMcLrM5JAf47Akz9AHJE66PR6VH66YwsPsYURBqje4M4gp 5+m0aOFiPzZVFVLcZHPl35JUbWh7++ULX0lknq5Ujkf/llD8DcjI8qu3xWtUlSSo+5 7ett19yBoW2AlMFYHQhrYtc5W0DU/14U5zrS2GN8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Almbladh , Johannes Berg , Sasha Levin Subject: [PATCH 5.11 053/329] mac80211: Set priority and queue mapping for injected frames Date: Mon, 17 May 2021 15:59:24 +0200 Message-Id: <20210517140303.847336887@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.043055203@linuxfoundation.org> References: <20210517140302.043055203@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Almbladh [ Upstream commit 96a7109a16665255b65d021e24141c2edae0e202 ] Some drivers, for example mt76, use the skb priority field, and expects that to be consistent with the skb queue mapping. On some frame injection code paths that was not true, and it broke frame injection. Now the skb queue mapping is set according to the skb priority value when the frame is injected. The skb priority value is also derived from the frame data for all frame types, as it was done prior to commit dbd50a851c50 (only allocate one queue when using iTXQs). Fixes frame injection with the mt76 driver on MT7610E chipset. Signed-off-by: Johan Almbladh Link: https://lore.kernel.org/r/20210401164455.978245-1-johan.almbladh@anyfinetworks.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/tx.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 64fae4f645f5..f6bfa0ce262c 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2269,17 +2269,6 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, payload[7]); } - /* Initialize skb->priority for QoS frames. If the DONT_REORDER flag - * is set, stick to the default value for skb->priority to assure - * frames injected with this flag are not reordered relative to each - * other. - */ - if (ieee80211_is_data_qos(hdr->frame_control) && - !(info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER)) { - u8 *p = ieee80211_get_qos_ctl(hdr); - skb->priority = *p & IEEE80211_QOS_CTL_TAG1D_MASK; - } - rcu_read_lock(); /* @@ -2343,6 +2332,15 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, info->band = chandef->chan->band; + /* Initialize skb->priority according to frame type and TID class, + * with respect to the sub interface that the frame will actually + * be transmitted on. If the DONT_REORDER flag is set, the original + * skb-priority is preserved to assure frames injected with this + * flag are not reordered relative to each other. + */ + ieee80211_select_queue_80211(sdata, skb, hdr); + skb_set_queue_mapping(skb, ieee80211_ac_from_tid(skb->priority)); + /* remove the injection radiotap header */ skb_pull(skb, len_rthdr); -- 2.30.2