Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3207829rdb; Wed, 13 Sep 2023 05:38:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9r2G1QMBkTgeEUwsGph+T6ABSHVEQ/uLjNpl4XwRjDMiDDE2sBThSiwY4xZHUUJw5nCU/ X-Received: by 2002:a05:6a20:7486:b0:13d:2f80:cf1c with SMTP id p6-20020a056a20748600b0013d2f80cf1cmr2480309pzd.17.1694608732748; Wed, 13 Sep 2023 05:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694608732; cv=none; d=google.com; s=arc-20160816; b=JskaX7f9l0F0WEU2KITzATZMULbr+KEeUdEZFChuooxzFX9Kq2vWcvTY5/okr77JAv FkLH9TUBxZAF9xxsdEnjAEWvf5ialaJ95lzhtgZMVU0t3o63eB/bN81nkrQdBEOaf637 rgQZLufe8ztQo3g5NLK/JKX9QyoMIxOHMt4pdBwdMC3poW7BGr9nrKAdmoSbDCthPBlo NqBql7gTkQa+BIIkBLrVUiG19lF1abKuuseTsy6EJMPpwKrIp9D58axGrOOaBVFadyZy bsGmN+tuP/kv8xZYpHFNqFMog9Zhc/CRnpp0M0TAASsk3Y2vxViuy1GKcq/vQCjYKdXj 1IpQ== 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=jqnDKez6df2YW11yiROlt1j6XBsPX2hqwFtKpg//+FI=; fh=Fd1rX1JQq/WeA4BN1MPyGpzynjJFUxqfBCuIwAdMLqU=; b=WQpz/WrmzGVEl098Gw2b7sxQBUCQ9DqCVcvfuSZ2hqYVajGV0QhXpRTlBdOhyA3t94 EAZwBF0XGqZuZawka1ZGAdSQKu7jxUyvv+H/YljX2v/zdhao+UgkNPNddP34qJoJZG9O BJvc/r5RrY2BvBQN68iI99wZQq6YPe1RKRQzBmSHSVhs5VCdNH1gQYjnsiRzetJtrm1c uZ2c7w3z2VKv0HS1NWDWSxlVHfJ04t23BxmdbopH1P3arfXH8Ycu14s8ztETDdvOtt+V jD+Oj/AW4wqbw1jbaT9z8ebpqAemBCld3Hv2JTCsXn2Yq/pkeL7wl8jt1p2jy8HgZotH jgUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=jbVnBr1D; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b20-20020a056a000cd400b0068e29a05faesi10431862pfv.285.2023.09.13.05.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 05:38:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=jbVnBr1D; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9192A80D0CFD; Wed, 13 Sep 2023 01:55:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239109AbjIMIzM (ORCPT + 56 others); Wed, 13 Sep 2023 04:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjIMIzM (ORCPT ); Wed, 13 Sep 2023 04:55:12 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7CED196 for ; Wed, 13 Sep 2023 01:55:07 -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=jqnDKez6df2YW11yiROlt1j6XBsPX2hqwFtKpg//+FI=; t=1694595307; x=1695804907; b=jbVnBr1DaZAikl1cE/Y/t1lgjV8t12juMm2CjGWiPZBRzZ8 4aHmSqgQsc2B7h249gDwyUMtvWNzOaza9cML75TNMJqlOeaHZ4/0FvgajcdjUFvPGB7luua3FEo6X nQHK3TYsrIRk5ZCfRUa0zyB2Bl0SucTaUbDYDggk6PL/P+lLYRG9T5QljXC04vmS/FkSvKPfTR3or cELiXYVKp9IjokmEzMJtjcQ94YVo64B9azPM62T7aHdh2ytJPhpASwcIhiHhnoPvv4XpCiyh2yuue CxELsRWRTyN3yPMlV1UDy73n7I8TM4nUWytRTkeaNENk9KF7As1ZQ+8dYKO7q7nw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qgLeH-00EhXj-2E; Wed, 13 Sep 2023 10:55:01 +0200 Message-ID: Subject: Re: [PATCH 1/3] wifi: mac80211: add support to allow driver to generate local link address for station From: Johannes Berg To: Wen Gong , ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Date: Wed, 13 Sep 2023 10:55:00 +0200 In-Reply-To: <20230906103458.24092-2-quic_wgong@quicinc.com> References: <20230906103458.24092-1-quic_wgong@quicinc.com> <20230906103458.24092-2-quic_wgong@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 01:55:13 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On Wed, 2023-09-06 at 06:34 -0400, Wen Gong wrote: > Currently the local link address of all links is random generated by > eth_random_addr() in mac80211 while connecting to a MLO AP for station > mode. The MAC address of link is not passed from NL command. The 1st > link address is generated while authenticate with AP, the other links' > addresses are generated after assoc success with AP. >=20 > It is not convenient for some driver, reason is, for station mode, > the interface with its mac address is already created in driver after > wlan load, it is used for hw scan and non-MLO connection. >=20 > When connecting to MLO AP, driver reuse the interface as the 1st link of > MLO. If the mac address of the 1st link changed to a new value, then > driver need to change the mac address and do many synchronous operation > with firmware. Thus the operation become complex. After MLO disconnect, > driver need to restore the old mac address, it is also another complex > operation. >=20 > The hw scan maybe happen through the MLO connection/disconnection. And > the hw scan uses the 1st link address while MLO connected and uses the > interface address while MLO is disconnected, this leads hw scan complex. >=20 > Hence add this interface to allow driver to generate the address of each > link while MLO connection. Then driver could provide the same mac address > for the 1st link, thus hw scan/NON-MLO connection/1st link of MLO will us= e > the same mac address, then operation become easy. Maybe after all this explanation, all we need is a flag "reuse MLD address for assoc link"? > + ret =3D drv_generate_link_addr(sdata->local, sdata, > + link_id, link->conf->addr); > + if (ret) > + eth_random_addr(link->conf->addr); should probably refactor this into a separate function though. I'm also not sure how the driver even knows that a link it's being asked to get the address for *is* the assoc link? Do you want to rely on that being the first address handed out? johannes