Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5132351rwe; Tue, 18 Apr 2023 02:28:42 -0700 (PDT) X-Google-Smtp-Source: AKy350bOdEy5Iojq+rq1OWFyfMsSVaFyqcCE6wbyf0cbkpDueyau1j+jNytC7t11EMnIhoRV8H+S X-Received: by 2002:a05:6a00:2d28:b0:63b:8963:d952 with SMTP id fa40-20020a056a002d2800b0063b8963d952mr8777461pfb.17.1681810122043; Tue, 18 Apr 2023 02:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681810122; cv=none; d=google.com; s=arc-20160816; b=Rzq2calH/hziA6Gno04trgXopOXBSN0bCt+zBkn8xc1oGt6rmw+sg3JWAeVFTyoneY Z8QRLsFeMFc1Fvv3IBzm6cfJWpECUj8YthysqlcvcAGHdlpXLNZk+OCWRRQLM6EApMfN tOyPLvHekFu0JR5r0SeKMwKrahy+qd1OzXzd+T7wr9hVvmwqzXK2kRbwh4WLE1pXFvml Ez5F8Vy/dSwpSy23tHGwb15805K5KeIUeaAK5/Ds5i5F5y4hZ6nTHdBgieOKf1A06nPs ZGN0V9X35C/y0KJHoi/NkIkmTRqSYXWRQmfDelJ8PQ7kBMqD8MhTSkLwauCKTPz4qGkA COOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=CFKMog9VfifSKbI/2CCxEKPCJcaOephdmWExTfF61qY=; b=nWN0Yz+0mOjwDCueOl7+H6iIVgFo+F/4grcYcEkG9KFn5ru3FvA46RSb9bkyunpN/m Zepp+I1vOWJ1QeJk7XQ3dCM+lYmC3M+PLzlNx+ENPXu0xYerMh0JfeLxFZ2BnOknzwf6 zoD4oNHlzS9U2w21YjqM7TwVCJqdwX7pCpVTYOw9+aMT9ZMr0Bvs63BseMb4po4leo7W z63Btmm8IjF0yQo1VUDMgBPHskHQfcJNcwX0Au+IA82fmKEBJ3kkqBisaOP8z8NDA6M+ v8OzKpwqjqI1Upx2so7jHHvdNHxNBSL0ykiFXlKDr2wAqcIUYQXnyaI757c9GWcW3Byw xCuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nZgHLqy+; 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=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z129-20020a626587000000b006364f13fbddsi13772459pfb.94.2023.04.18.02.28.32; Tue, 18 Apr 2023 02:28:42 -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=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nZgHLqy+; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbjDRJXN (ORCPT + 63 others); Tue, 18 Apr 2023 05:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbjDRJXM (ORCPT ); Tue, 18 Apr 2023 05:23:12 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC1E3C2B for ; Tue, 18 Apr 2023 02:23:11 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33I6shVU013686; Tue, 18 Apr 2023 09:23:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=CFKMog9VfifSKbI/2CCxEKPCJcaOephdmWExTfF61qY=; b=nZgHLqy+f5OQW8Vmrq/ZgZ8BCdhAGKE2lxsSFFLtAaBEBwfnWlcv3x9yVTeCTSSs+wTB s0acFzJb30QyiXmCdLtsP2K9urf6i8vYF1CStqqKCS/DWjLQga9kmCZHWIIu3R2syb/p ThoVCRaGgUx5Bu3M7pOWraAzdyhhE+E1gzXCEh2x3UXacsTGHtHiUqmcMkEP2/73LIXE W5VxT1aWD6QpjXg3usAgiPE+glFVeyHP3E1xULRtUbF6f6MC9kOqlaN8zznD7f0IDhe1 BeAfnvH3H1r8wwNPzmlasQdeJhhsk2wnxOOJY8P5VdN27fLzLsfPvZ3oy8gG4S4orann 3w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q17yht6da-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Apr 2023 09:23:02 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33I9N1iR017827 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Apr 2023 09:23:01 GMT Received: from [10.253.75.31] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 18 Apr 2023 02:22:59 -0700 Message-ID: <34212873-0b71-7f39-b064-6b50d8e514b4@quicinc.com> Date: Tue, 18 Apr 2023 17:22:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 10/27] wifi: mac80211: isolate driver from inactive links Content-Language: en-US To: Johannes Berg , CC: References: <20220902141259.377789-1-johannes@sipsolutions.net> <2de44394-cb93-7be4-481f-2d92788b8d28@quicinc.com> <351f74e0e1cd6e9724f97dbd042bdc5e04c44842.camel@sipsolutions.net> <545227cf18baac94ea8aa24dc08b250c47949541.camel@sipsolutions.net> <868131d13ed7c4c8b5d4938adcd71cf1ff8e9677.camel@sipsolutions.net> <5765e3c5-46d4-e92b-a93b-4a2649acff2a@quicinc.com> <37958ca93039114b98909d730ff57dd1d10bb68d.camel@sipsolutions.net> <91577d586475d290e08dee9e535cb6b4896e06d4.camel@sipsolutions.net> <61268d31f8a6dd4eea10fcb6048d39244bc584e2.camel@sipsolutions.net> <870ce439-85b1-f02c-70e5-2d424fd73372@quicinc.com> <34ed0938b69ead648da1aa250a2e081054fb49d4.camel@sipsolutions.net> From: Wen Gong In-Reply-To: <34ed0938b69ead648da1aa250a2e081054fb49d4.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: WmMXVbskVZPPA2lZNdBAd1ET_aMA5vcl X-Proofpoint-GUID: WmMXVbskVZPPA2lZNdBAd1ET_aMA5vcl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-18_05,2023-04-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 suspectscore=0 mlxlogscore=921 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304180080 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 4/18/2023 5:11 PM, Johannes Berg wrote: > On Tue, 2023-04-18 at 16:59 +0800, Wen Gong wrote: >> On 4/18/2023 4:15 PM, Johannes Berg wrote: >>> On Mon, 2023-04-17 at 22:07 +0800, Wen Gong wrote: >>>> OK. So I will try to put this in mac80211 layer, is it OK? >>>> >>> I guess? I'm still not really sure why you even want it, but hey, that's >>> up to you in a way. I really didn't like the suggestion with >>> wiphy_iftype_ext_capab (or any other capability for that matter), it >>> feels like it should be more dynamic, like maybe a new "add link" >>> callback or something? At least then you can't blame mac80211 for when >>> it breaks when you have two 5 GHz links ... >> ok, so I would like to add callback such as >> >> "add_link(struct ieee80211_hw *hw, struct ieee80211_vif vif, struct >> ieee80211_bss_conf *link_conf, unsigned int link_id)" >> >> in struct ieee80211_ops, and mac80211 call it in >> ieee80211_mgd_setup_link()/ieee80211_vif_update_links, >> >> then lower-drvier could dynamic set the local addr of assoc >> link_conf(also for 2nd link_conf), is it OK? >> > Seems OK, but I'm not sure that _works_? > > After all, we first set the addresses in assoc_data, when we don't have > a link_conf yet, no? Just what we were discussing in the other thread > about the leak. > > johannes It should work, I will test it later. For the 1st assoc link, the data->u.mgd.assoc_data is empty in ieee80211_mgd_setup_link(), because ieee80211_mgd_setup_link() is called from nl80211_authenticate() for the 1st assoc link. So ieee80211_mgd_setup_link() use eth_random_addr() for the 1st assoc link. For the 2nd link, ieee80211_mgd_setup_link() is called from nl80211_associate(), the sdata->u.mgd.assoc_data is NOT empty, and the sdata->u.mgd.assoc_data->link[link_id].addr is valid, it is addr by eth_random_addr(assoc_data->link[i].addr) in ieee80211_mgd_assoc().