From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E0A6C2BBCA for ; Wed, 16 Dec 2020 21:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63F6523899 for ; Wed, 16 Dec 2020 21:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbgLPVUE (ORCPT ); Wed, 16 Dec 2020 16:20:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbgLPVUE (ORCPT ); Wed, 16 Dec 2020 16:20:04 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB3D8C061794 for ; Wed, 16 Dec 2020 13:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:To:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=88+2tsSMH6HZY4zTdIeVZLF09NJz21xBnxEal1fzByI=; b=RLyW7NMxQ6J+TOVRvuxPK0zMtR 8BkPoUb2aEqDUXOsH4g2SEFb1bqW/kh778SYVJfRLQQUxA/pzcg9/8uSLwpZhz5c3LFRGoTRFS+y3 GQDlMsyXqkljWk3IvipPsdvbNk+Xyag9GHL2XZK82KUnwLDlVeoYr6unv41ttEt/wGGk=; Received: from p4ff13815.dip0.t-ipconnect.de ([79.241.56.21] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kpeCR-0004m8-FZ; Wed, 16 Dec 2020 22:19:07 +0100 To: Johannes Berg , linux-wireless@vger.kernel.org References: <20201216204316.44498-1-nbd@nbd.name> <20201216204316.44498-7-nbd@nbd.name> <893856dcc9ff9adf65b0bcdbb6ce127d56980ee8.camel@sipsolutions.net> From: Felix Fietkau Subject: Re: [PATCH 7/7] mac80211: add rx decapsulation offload support Message-ID: Date: Wed, 16 Dec 2020 22:19:07 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <893856dcc9ff9adf65b0bcdbb6ce127d56980ee8.camel@sipsolutions.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-12-16 22:03, Johannes Berg wrote: > On Wed, 2020-12-16 at 21:43 +0100, Felix Fietkau wrote: >> >> + offload = assign && >> + (sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED); >> + >> + if (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); >> + >> + if (set_offload) >> + drv_sta_set_decap_offload(local, sdata, &sta->sta, assign); > > Some of these lines look a bit long? Just a tiny bit over 80 characters. Wasn't the 80 characters line limit removed a while back? I don't think line wrapping would make things more readable here. >> - skb = ieee80211_rx_monitor(local, skb, rate); >> + if (!(status->flag & RX_FLAG_8023)) >> + skb = ieee80211_rx_monitor(local, skb, rate); > > Is that worth the check? You basically disable it anyway if monitor > interfaces are there. There could be a race. The driver or hw might have queued up some 802.3 frames after offload was disabled. > Not sure that's really the right thing to do ... we often want monitor > interfaces (with no flags set) for debug? > > Or maybe we should add some tracing then (instead). Tracing probably makes more sense. I'm not sure pcap or radiotap can deal with a mix of 802.3 and 802.11 packets. Leaving offload enabled and silently dropping 802.3 packets seems like a bad idea to me as well. - Felix