Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp776084pxj; Thu, 17 Jun 2021 13:40:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfgrK10QbpHihuwyrm6Yk3x1P1budIFVz//wUfMY26rwk97bXpEdnhU6No9VIbWPIvHUNV X-Received: by 2002:a05:6402:30a8:: with SMTP id df8mr207889edb.7.1623962399993; Thu, 17 Jun 2021 13:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623962399; cv=none; d=google.com; s=arc-20160816; b=gg/0kNAr7rLuLY6YJc4bIielv9MqIVR0NsjbKNoSW+isBZhVKIz5SocGh00PRxc5/w d9lCPemkaP2JsBNMHswwOtyLoJdI2Ass3GHISLOwzSwOSpMuS+rpgtzog6G1Uqiu6bHQ TNyQMgLe4NpDxuyNmVUZMvnfQ4tuKhfZ/pljbtXA8uHJyNiHKhDXO2y2thXBA4yDernc lGCU+zQ8ZaWlGWXEnfUaYalCO+sFKva+taiv0eUg/u008HrA58JgggwtLHftG9S5p/JB 7+zAALDlH3YmWlmnct6JhxVv8/wGPtgIS/qyqKjHU1JpRKG/zc/I49wmsQb5lrT4WGf9 5cBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=nEPQMIA7Qp/fzYb8UPU6E3uQQVhxMNjy3028PFw4JJg=; b=VsuI2/LH1EXXCXPj3IVnA2M8SzoWzCZRhL1Eu0HfOWe3CH9xVZLBYK6eI3kaC7RAIK V7knNb+hirmCnnT6AaR/l3cS5IpQW2pJqhKEAZgbSqZ9wgHCpXVe3+Av4QHXZze/1FBE TgR8/TvzPkeSmiIernDwQpu7lhEa3QIv1W/PFo442e6mR9tNhaofDT/QZnruRn22DpWg r0A49mFI8ZjHk4KpKzx9ya5AygKUEJ2uRRgxYwViUNsB42Qzl/GALYU0/5VGJ4dsjWgD VsPj+yRJUw+aLnKeMz39TEXnqqNtGgbRNuqTMdxNmWXrYdvUuxUGZdBpX9mAcIvyOt1a 3jzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si5474015edr.456.2021.06.17.13.39.10; Thu, 17 Jun 2021 13:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232152AbhFQSzW (ORCPT + 99 others); Thu, 17 Jun 2021 14:55:22 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:44009 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231151AbhFQSzT (ORCPT ); Thu, 17 Jun 2021 14:55:19 -0400 X-UUID: f783e27c69a743f3bb4a1fd43f7b9146-20210618 X-UUID: f783e27c69a743f3bb4a1fd43f7b9146-20210618 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 528475718; Fri, 18 Jun 2021 02:53:08 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 18 Jun 2021 02:53:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 18 Jun 2021 02:53:06 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , Ryder Lee Subject: [PATCH 1/4] mac80211: check per vif offload_flags in Tx path Date: Fri, 18 Jun 2021 02:53:02 +0800 Message-ID: <4718d8041f908cb3249ec68c59a6854919f00752.1623955182.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org offload_flags has been introduced to indicate encap status of each interface. An interface can encap offload at runtime, or if it has some extra limitations it can simply override the flags, so it's more flexible to check offload_flags in Tx path. Signed-off-by: Ryder Lee --- net/mac80211/tx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 0a4bc9e08637..8cb1289c704a 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3267,6 +3267,9 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, if (!ieee80211_hw_check(&local->hw, TX_AMSDU)) return false; + if (sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) + return false; + if (skb_is_gso(skb)) return false; @@ -3695,7 +3698,8 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, } if (skb_has_frag_list(skb) && - !ieee80211_hw_check(&local->hw, TX_FRAG_LIST)) { + (!ieee80211_hw_check(&local->hw, TX_FRAG_LIST) || + vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)) { if (skb_linearize(skb)) { ieee80211_free_txskb(&local->hw, skb); goto begin; -- 2.18.0