Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2313385iof; Wed, 8 Jun 2022 02:12:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvMuaDR/pqdlyNhgKOhKxY8z+WnSoQYlXXWcgVnAwrT6It9421tByz2N8bjQ4uQdDgOBq5 X-Received: by 2002:a17:90a:780d:b0:1df:959:235a with SMTP id w13-20020a17090a780d00b001df0959235amr36771553pjk.92.1654679521474; Wed, 08 Jun 2022 02:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654679521; cv=none; d=google.com; s=arc-20160816; b=eUAlC8LyrZExjyduZzW5m1ErfSbh1FJhrQGogUyEOiTWBKGqLQFNg7Mpzyh1NCv1kT iOMYPjDx1ypg0JrQXygmwuZukNyAVg9khS258USEVnMhAAMNWjkjhePudfCYEjAhgmQg ouAKgQxtQ38zukpvu42cdahWcmeesoluCGoCzjEJQtxsXacbXfgUd4t7IqZZQmKuFdg6 uPhQo3+pcu/W5iLI5MAOvGBPMJ5/T2dfDc2RrApj+aHgITSbTf+Vl5uu8VkK0644k8a/ zfcTvcIg1hXI+zBseu8UQaAQVbMLKjQWl3k6Yj0e1thcC8kB9V0vEcCjQpF99xdyM1WO MTCQ== 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=26ojpPxNab7H0qDQpSzG+FFUiYlSf7UGWq76CWD6uSA=; b=JPTuygUvwCcRlNh/PaqP4Tz27q0FHhujyI3z00ZxPg3uG9jJuztxP29jIP5PXD5306 NQ7Gff0ts6cBing5e2rnm6UD6AZhWyy0pETW74N0vSa8moPp8lEq/9rhU7AOlRt5IMd4 EnmnqfP31M19/fqrCu9BYzfYkpKTARU1lOn72ZDRb2SS2UskHpoXMTszfC2esev4tj0H ACHJEaVTA6NF2WuBe+n2oCAOTVy4DsfeY/83mlrxI8ZUHotKQ3s7L2tuh8TpwU/4A3OP vYQG3r5aRdWYlIFxGpW0RBbcmmkHCUeY5hvvWPJXoRRjRUkOlNhZmxrcK6izA2R4imyh y30w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="IjZXJL0/"; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id jg6-20020a17090326c600b00161872d6f01si26244948plb.98.2022.06.08.02.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 02:12:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="IjZXJL0/"; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B65F92347E2; Wed, 8 Jun 2022 01:41:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231565AbiFHIlh (ORCPT + 67 others); Wed, 8 Jun 2022 04:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbiFHIkR (ORCPT ); Wed, 8 Jun 2022 04:40:17 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141E02004E0 for ; Wed, 8 Jun 2022 01:03:32 -0700 (PDT) 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=26ojpPxNab7H0qDQpSzG+FFUiYlSf7UGWq76CWD6uSA=; t=1654675413; x=1655885013; b=IjZXJL0/nGhLQ5F+oACh/+fQS1/koED1Fs6GhE9Tt51XH75 PnVrD4GWcj8gLoGjWe37s3YtzphdBFNU9RNHLb9PcAOLJacGw06/8kHBhdbESLdf6FXGNMeF6P7iR lW3K5k28QmNNHbPa6o8Nemy+xmqoeZdo6WaOzpONyjbzoC6B3+VXchylsAaGFvY8AEk4TO7q0zMah NWQzGSdhGVd0dl/ry3JcI2GM3D8T4Dzz1xC+WZQQ0SsWFsNJ4EwR7KpJpq6HKq3vJx+gPYywIBEq2 /qTfqzUGNSUjRTPKv0oA2yM+GjBa+1QcdV6xQ4V1BbaciYBXkBfRi5YS6X9lt82w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nyqb3-00GqEb-Oj; Wed, 08 Jun 2022 09:59:21 +0200 Message-ID: <3fa8911111ff380615ca5b3ffcd61644fae5e8ea.camel@sipsolutions.net> Subject: Re: [RFC v2] cfg80211: Indicate MLO connection info in connect and roam callbacks From: Johannes Berg To: Veerendranath Jakkam Cc: linux-wireless@vger.kernel.org Date: Wed, 08 Jun 2022 09:59:21 +0200 In-Reply-To: References: <1654536690-12588-1-git-send-email-quic_vjakkam@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, 2022-06-08 at 13:15 +0530, Veerendranath Jakkam wrote: > On 6/8/2022 1:01 PM, Johannes Berg wrote: > > On Mon, 2022-06-06 at 23:01 +0530, Veerendranath Jakkam wrote: > >=20 > > > + if (cr->status =3D=3D WLAN_STATUS_SUCCESS) { > > > + for_each_valid_link(cr, link) { > > > + if (!cr->links[link].bss) > > > + break; > > > + } > > > + > > > + WARN_ON_ONCE((!cr->valid_links && link !=3D 1) || > > > + (cr->valid_links && > > > + link !=3D ARRAY_SIZE(wdev->links))); > > > + > > I will say I'm not super happy with using the link variable after the > > loop, that always feels a bit magic to me, especially if the loop is > > hidden like that... > >=20 > > But I guess I don't see a lot of alternatives here, other than open- > > coding it, or keeping track of "how many BSSes do I have". >=20 >=20 > Since we need to WARN even if single BSS is not present I think we can= =20 > use "bss_not_found" flag? >=20 > >=20 > > Actually, for the MLO case, is this even valid? link[14] could be set, > > so you wouldn't break, ending up with link=3D=3D15? Or am I confused? > In MLO case the link value will be always 15 after loop completes if=20 > bsses are available for all valid links since the check is only for the= =20 > valid links >=20 > so, In above case also when "link=3D=3D15" the condition fails and WARN w= ill=20 > be skipped right. >=20 Ah, indeed. I was thinking of the 'break', but you only get there for valid links and the valid links should indeed have a .bss pointer. OK, so I guess let's leave it as is, that way we check both cases accurately. johannes