Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6111874rwb; Tue, 22 Nov 2022 08:56:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7mDX2qIonYB+Qgzfda5I5QSM4YGNoe/RVjN90AdNyG3hVunVm9804dR2RpIgXkfF6kpbCk X-Received: by 2002:a17:902:ce0e:b0:172:86a2:8e68 with SMTP id k14-20020a170902ce0e00b0017286a28e68mr6117648plg.27.1669136191148; Tue, 22 Nov 2022 08:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669136191; cv=none; d=google.com; s=arc-20160816; b=UT6yHgK8g+7sskUYHhJgl9vyX0nL4t1nvlNMDvxHQqilxCr/9S/L/SxLbgHOlunNk9 wyMyK/FRsX8cF46ZE6zhc4cyKN1IBOMiOjpeBgmAcU7Mt59m5LVbl964MCGZ/gncuqRv otrMp4RGVx+HW0HOZmfZkV3jL47t6sATYmlQEXiqq3YHrxChjePoXEKSJMuatfnMcjYD EpNOOwWFCxmybxZd6Fw2nXCdpxy5igJYTQO8fjlrC57aYnOy3oQPzK7WhoodiIxP5cRL V33kTBJHsxuUisLWzylXkbTvHUxjULw+1TaKfijPLCEn2TcSiJNU/lvFTRNtNX4S8PBz BUkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=8Lc0u507HrdvqGzH6arePQyMKi1cqvhnv7saDo8AjMc=; b=tFJ+i0YZ+bC1HCghHW8KbeUEERzefsNjCBsMyqM/rqxqtMnvRE5BRJaasu7jXZCHW4 A0WK2DGPiiUlxMDfjdLCFoZ/i1WVAvvva/IAknUnkBshk+VCbOa9CS6A1Jc7WeAZ7OhA Et7uUCq3DXKa15KJpgLAkMSWs7u1LnnQmt3mcrBAN4AIjqD3XUz0xEaBwecqogTwWQzx P1d6TfdhZW5S2AbQeWgxFz/dKNJCQD7nQKNT/tG/Xw4DtgJZ12y5bNV3cpa05iurPuB6 1G6WpARK3zYeBLxM9FTwU0mEAWMzJhleZYTbDK2LWu0IbXDCoT1Y+XxUl+rF+XDBZghK ZsQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="UXpb/GGx"; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a170902c40300b0017145b821d2si16241768plk.477.2022.11.22.08.56.19; Tue, 22 Nov 2022 08:56:31 -0800 (PST) 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=pass header.i=@sipsolutions.net header.s=mail header.b="UXpb/GGx"; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234089AbiKVQoV (ORCPT + 68 others); Tue, 22 Nov 2022 11:44:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234334AbiKVQoE (ORCPT ); Tue, 22 Nov 2022 11:44:04 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7873D725E0 for ; Tue, 22 Nov 2022 08:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=8Lc0u507HrdvqGzH6arePQyMKi1cqvhnv7saDo8AjMc=; t=1669135431; x=1670345031; b=UXpb/GGxO+Ggcp1l2PkQBxamay/QgrerNe8ax6rtrjckcNp SBFzY3AiFYfIkFh2cxkBM8uXGRiJQwjcjSzKg6lGvHOa+WVHIjEBK8KXxTkZgzq0WZc9bAwtg88Jz W6JnSDYLDQHGbPZvRhMoIyhVHl9TUbdMRf/4hmzm5I8h7WhUrpJEXbVyo7rarK0Qdbl+HXeoFJ6eP AX6r+TMqmLGjkqBQO5Egk9fxZgE6xWlrKRVpHLnFaeb5OSVWHnrnjS23y+33FrBfiMQeA7Fka6GjN 0IoMQN+ZasgLu6mOCFtGkmQxag5v7qbTiCstxtM9hkDIsw5nTz/ChJsAjmoCN66w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oxWN8-006PNE-2o; Tue, 22 Nov 2022 17:43:46 +0100 Message-ID: <95ad4207e62b4990476d867bd240fef3ede31369.camel@sipsolutions.net> Subject: Re: [RFC PATCH] mac80211: mlme: Handle Puncturing information received from the AP From: Johannes Berg To: Kang Yang , linux-wireless@vger.kernel.org Cc: Aloka Dixit , Miri Korenblit , "Carl Huang (QUIC)" Date: Tue, 22 Nov 2022 17:43:45 +0100 In-Reply-To: References: <20220325140859.e48bf244f157.I3547481d49f958389f59dfeba3fcc75e72b0aa6e@changeid> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned 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_PASS,SPF_PASS 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 On Mon, 2022-11-21 at 15:29 +0800, Kang Yang wrote: > Hi: > 1.Do you have any new version about this RFC patch? Not really, no. > 2.I have some questions about this patch: (a couple of blank lines and some trimming of the context really would help ... please try next time) > > +static u16 > > +ieee80211_extract_dis_subch_bmap(const struct ieee80211_eht_operation = *eht_oper, > > + struct cfg80211_chan_def *chandef, u16 bitmap) > > +{ > > + int sta_center_freq =3D ieee80211_channel_to_frequency(eht_oper->ccfs= , > > + chandef->chan->band); > > + u32 center_freq =3D chandef->chan->center_freq; > The shift is calculated by the difference of old and new channel center > frequency.The new channel center frequency should be=20 > "chandef->center_freq1" after BW negotitaion. > "chandef->chan->center_freq" is the primary channel frequency. Yeah I think we did fix a couple of bugs in this area later. > > + u8 sta_bw =3D 20 * BIT(u8_get_bits(eht_oper->chan_width, > > + IEEE80211_EHT_OPER_CHAN_WIDTH)); > > + u8 bw =3D 20 * BIT(ieee80211_chan_width_to_rx_bw(chandef->width)); > > + int sta_start_freq =3D sta_center_freq - sta_bw / 2; > > + int start_freq =3D center_freq - bw / 2; > > + u16 shift =3D (start_freq - sta_start_freq) / 20; > > + u16 mask =3D BIT(sta_bw / 20) - 1; > The mask is used to extra the valid bit according to the new BW, > but current algorithm is using the old bandwidth. :) > > + while (chandef->width > NL80211_CHAN_WIDTH_40) { > > + extracted =3D > > + ieee80211_extract_dis_subch_bmap(eht_oper, chandef, > > + bitmap); > > + > > + if (ieee80211_valid_disable_subchannel_bitmap(&bitmap, > > + chandef->width)) > Here extract the bitmap according new negotiated BW. After extracting,= =20 > check whether it is valid. > I think you should use "&extracted" instead of "&bitmap" Yeah I guess that makes sense. I don't know what fixes we have and what version of this patch this is. > > +static bool ieee80211_config_puncturing(struct ieee80211_sub_if_data *= sdata, > > + const struct ieee80211_eht_operation *eht_oper, > > + u64 *changed) > > +{ > > + u16 bitmap, extracted; > > + u8 bw; > > + > > + if (!u8_get_bits(eht_oper->present_bm, > > + IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT)) > > + bitmap =3D 0; > > + else > > + bitmap =3D get_unaligned_le16(eht_oper->disable_subchannel_bitmap); > > + > Should check initial bitmap here. What do you mean by "initial" here? > > + extracted =3D ieee80211_extract_dis_subch_bmap(eht_oper, > > + &sdata->vif.bss_conf.chandef, > > + bitmap); > > + > > + /* accept if there are no changes */ > > + if (!(*changed & BSS_CHANGED_BANDWIDTH) && > > + extracted =3D=3D sdata->vif.bss_conf.eht_puncturing) > > + return true; > > + > > + bw =3D u8_get_bits(eht_oper->chan_width, IEEE80211_EHT_OPER_CHAN_WIDT= H); > > + > > + if (!ieee80211_valid_disable_subchannel_bitmap(&bitmap, bw)) { > > + sdata_info(sdata, > > + "Got an invalid disable subchannel bitmap from AP %pM: bitmap = =3D 0x%x, bw =3D 0x%x. disconnect\n", > > + sdata->u.mgd.associated->bssid, bitmap, bw); > > + return false; > > + } > The initial bitmap received from the AP is checked here. > I think it should be carried out before the extraction above. Ah, yes I guess that makes sense. Anyway the more fundamental thing we have to figure out here (and thanks for bringing this back) is how we treat the puncturing - QCOM's AP-side puncturing patch treated it as part of the chandef, but that's not working well for client side ... johannes