Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp483106rwb; Sat, 1 Oct 2022 03:15:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WZQNNsHtBqWkR94znx2Xw/izeDgpOOmJKZb+1cl6J9BN9Pt8bkc5/AJ9bGLdQRMEzG9QJ X-Received: by 2002:a17:902:9a92:b0:178:2580:ce60 with SMTP id w18-20020a1709029a9200b001782580ce60mr13038769plp.80.1664619308138; Sat, 01 Oct 2022 03:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664619308; cv=none; d=google.com; s=arc-20160816; b=S7+dH/J0u1q1k0Fr6M/pnsYrEPJ30Le1o3wzhbdIruF7OK5BXqIi9EgZNpZ3ZUoIY2 KJ3mRXsCIccaLj51q6aGy/U15A++rxCVKc5qhMK+wVukPlhLL0zxCXkCLCW1Mc6OEb6z mPFssAPrSOrt4kjvU1XmBNIHvQDJpU2x+5qySdY7tPcgqgzaNtHavu0QjILYszRQW1nj RUMJBVjeTd/LUOxhbo9XAWpQM9x37PEXNfn27vgdFPjg2AExHmz4pe1o31fpIGR8xyYq N1vAdlO9HjSEhoOxKIsT1ND6DIFV+i1GSYuy+hlsWSs54xUWZwvPFZgh/qveSWvDMEa1 z07g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=G0jR/kmi3D6E8l6BWXs/Cn9jNkpkMqJ9kFgTnPRaAD0=; b=fkGUH980pGPkbspNFWiXfPgeojENhQO79ReioEUQ9dok/zOg6HgUOK/ezVN1Xu913Q AMQmnZEXpHZZls66a2mtz7OHEoIU6A85ENFwBVVTkhPnLpnE9OEw42G+tMhrIefDOfRr IRyKDrsvffWFSzCN8aeW7GRXqJXkGSMu3NmsSpA7Kb+Yo/lkUFWIef0Kuc59t5WQq+z1 ga0DDMiYRvRv+Ecuxu6XAZXSveIpI3XHBWv2DltgjEW0MIivWqcAl6hOSO990CnqM+BF tRgWA0gmTZ6RHB7OiCUb3k13yQUTii/DkrCVtrUyMWNqpWjYFiJ2cOogFyHKzN0fuJ8P hNkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mmpngRGw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a17090a49c900b00202fd098892si4185192pjm.190.2022.10.01.03.14.51; Sat, 01 Oct 2022 03:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=fail header.i=@nbd.name header.s=20160729 header.b=mmpngRGw; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbiJAKBX (ORCPT + 59 others); Sat, 1 Oct 2022 06:01:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJAKBV (ORCPT ); Sat, 1 Oct 2022 06:01:21 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0175E1005D9 for ; Sat, 1 Oct 2022 03:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=G0jR/kmi3D6E8l6BWXs/Cn9jNkpkMqJ9kFgTnPRaAD0=; b=mmpngRGw6vZqQLrUon9s5Kw2Eg ybDimLfQQInv+dxislq9zVI4EBmSWgL3LuM2OYGr7dUlMdJl3owOT+R3MAyDET274hwyEbkVORPGV VYD614qSM8XvRcTaOE38+Q2WLzATnmG4RMiTvaECmYVwJzP9mIEPVSeVR5hTTW3yBr4A=; Received: from p200300daa7301d00cc0df67a5b51dd3e.dip0.t-ipconnect.de ([2003:da:a730:1d00:cc0d:f67a:5b51:dd3e] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1oeZJ5-009Cby-Ko; Sat, 01 Oct 2022 12:01:15 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Howard Hsu Subject: [PATCH] wifi: mac80211: fix decap offload for stations on AP_VLAN interfaces Date: Sat, 1 Oct 2022 12:01:13 +0200 Message-Id: <20221001100113.63559-1-nbd@nbd.name> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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-wireless@vger.kernel.org Since AP_VLAN interfaces are not passed to the driver, check offload_flags on the bss vif instead. Reported-by: Howard Hsu Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support") Signed-off-by: Felix Fietkau --- net/mac80211/rx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 45d7e71661e3..9b21e7725de2 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -4340,6 +4340,7 @@ void ieee80211_check_fast_rx(struct sta_info *sta) .vif_type = sdata->vif.type, .control_port_protocol = sdata->control_port_protocol, }, *old, *new = NULL; + u32 offload_flags; bool set_offload = false; bool assign = false; bool offload; @@ -4455,10 +4456,10 @@ void ieee80211_check_fast_rx(struct sta_info *sta) if (assign) new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL); - offload = assign && - (sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED); + offload_flags = get_bss_sdata(sdata)->vif.offload_flags; + offload = offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED; - if (offload) + if (assign && offload) set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD); else set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD); -- 2.36.1