Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1743715lqe; Mon, 8 Apr 2024 20:57:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxxEDDc/jcpKmkG5nADQlOyGAc+bCd7qgYa+8cr0uP5p+aARsTHgCSlfHZMxr/QYODh5AD1b9LlvlPloNwSuTdQrSbhGQTKMU9W+2Rdw== X-Google-Smtp-Source: AGHT+IHpRuX2BplOL/ObK1Y9/4OgiI+gsRglK8HFVQnhXE8+1x5H3h0Y1GkcoCP8cRuiqvhT3sOG X-Received: by 2002:a17:902:e5d0:b0:1e3:e0a2:ccc3 with SMTP id u16-20020a170902e5d000b001e3e0a2ccc3mr8665951plf.30.1712635056277; Mon, 08 Apr 2024 20:57:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712635056; cv=pass; d=google.com; s=arc-20160816; b=e4gOUxZ5kwfEAMPO3qFG1bx4wpJ5TeTZqOb7vYje6K+Ce/6tz/EuQI/InOjnoNe6Q6 z/U7XuppnOrqMDULY6MXXOMNya4Zbxd4lfCH/gwfsujG14eTg+XG9k3H0Mnjot4CL2su L1NnTTgWZw4bhH1oetSF202FnTFCM/ph19k6LZSYkoGn9ke91ieGq2RHKsChCyoZv2D9 dJ0UmF5mRzFbpaVzOcAZbl+puoTMaDQJvUoavqOlOx0agklaXkDnWixvpVmGCfLE1nGo D/S7UnuLL6eJxmcCeRLbcQ+vsJCDPubhzn0U3acHDdqVRg7vSN4Le6HdgXI9NIQVFte0 MAMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=+we+/wESv/0HibPrl5dUw7ZLp/mpcF0Mls0N3rvfpkA=; fh=MF2peTgYJ//G8t751nSOVbIbH2TOrwM3JpiMYcMIVv8=; b=mMcy+VH5teeDSSmyl46kto9Rbt0N+SP7qC5XLz6fiqsfcd02VOn3CEycUcVdTNLcGx XchQ3JiA6DusxpztDk/yZeXAqP8d/uNj/9Hc1hHuwnxkMIuIqxg2bE0PyBXT64yTZ7bd 4T2xXtj/J0gj1ly8TnZ3543HDDrMwLCVUR4Kz3qfqqtBTF3ObjhqUQSyrJTk2jbDE90u eqU22btmNFlY22uKJemau/tTE5IvtguGkI32+B0F/N+iBD+77F4QLZz+Z3J2qVS7+3+N ADJBTWGKX5jSTOmKdviIDXCPD1FNk4LZGCMptPBR6ZZYgALR5S1IFHIMPpHwASXZ1sup DYFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YYWX3xr2; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q5-20020a170902f78500b001e29225a4e4si7929535pln.296.2024.04.08.20.57.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 20:57:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=YYWX3xr2; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CE167281178 for ; Tue, 9 Apr 2024 03:57:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A276A54FAB; Tue, 9 Apr 2024 03:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YYWX3xr2" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF40F54F95 for ; Tue, 9 Apr 2024 03:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712635053; cv=none; b=PnRZsot5QZ2rWPw1B8CtUJkKgNiMzZzqN0+qFQ+SJpWvdFiWMkeT1sbDhSIlrVatfpWvgd1X7IQNWYP9g0UxvQXQeejbSMWFzv/0Wx2+Azl8Av/pNvgYrHXolc2oqvqNLnUbunXbZYOlKNIk0Aah6IAYAyqw17VNfJXTSCdnjK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712635053; c=relaxed/simple; bh=IMDHV5KRTrbzqE5SwgGsDAx0d2O+vkhJ0tIQFQH65z8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=UVI6sLY/V6K8rD6FJpT42cf6v+Iv1LfBjpYAy7koQTiPNki/F/kdDBXtQXkUFjTpg20lR1+9bezWYHP0SmA4vSahIyr8lwVtDCP+XWIMl1rQoIl9QnQEhLUolBFpkzO7F6zKYYXdKEDIScpNBPX8h7L1y2Z8fxzJfrzyOTDtGM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=YYWX3xr2; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4390l9D8032535; Tue, 9 Apr 2024 03:57:23 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=+we+/wESv/0HibPrl5dUw7ZLp/mpcF0Mls0N3rvfpkA=; b=YY WX3xr2VgqxhKpQ/tl3ux8vr0ElZtCmpQl4jkXDISYB5EwIlZi2E3vtIW34PL/G+P /djOmrjcJc065p8cvX0/Evy41H0GIOqfghSXAjJFFSDp1qkbwIPvfJfjyoo49dCH Hj7DvHvSPg0nzK/mWoxPu024O/BJDrtlkR1DYuKGAjNeyIhLHM5Ggh9wyYtWyZHR bS0d/8SdXfz1N7NIpggVdq47NB4sxSdYwipsMFmbOl7DleLT3Q2MTD5mjasPZZwg Uf03Pg34nxVEdTpz3DCVI+6WDArf7VyQ1F8G7oGlTT/XocjDz/tb1cgSYjz3Sh6G p9iZ4PsllVwgaQA88dVw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xcbg0adyv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Apr 2024 03:57:22 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4393vLgZ026345 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 Apr 2024 03:57:21 GMT Received: from [10.216.45.2] (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.1544.4; Mon, 8 Apr 2024 20:57:20 -0700 Message-ID: <15bc7705-5da9-4c56-aa45-81972bad5e01@quicinc.com> Date: Tue, 9 Apr 2024 09:27:16 +0530 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: mac80211: handle sdata->u.ap.active flag with MLO Content-Language: en-US To: Johannes Berg CC: References: <20240326151141.3824454-1-quic_adisi@quicinc.com> From: Aditya Kumar Singh In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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-GUID: JYxyBKCZ0RMQ2D_d1Z6MOkeFj_mhxfKN X-Proofpoint-ORIG-GUID: JYxyBKCZ0RMQ2D_d1Z6MOkeFj_mhxfKN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_19,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=877 clxscore=1015 spamscore=0 impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404090022 On 4/8/24 23:55, Johannes Berg wrote: > On Tue, 2024-03-26 at 20:41 +0530, Aditya Kumar Singh wrote: > >> @@ -1232,7 +1256,9 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, >> } >> >> rcu_assign_pointer(link->u.ap.beacon, new); >> - sdata->u.ap.active = true; >> + >> + if (ieee80211_num_beaconing_links(sdata) <= 1) >> + sdata->u.ap.active = true; > > I don't understand this change. Neither the <= 1 really, nor the fact > that you actually _make_ this change. > The place above where we are checking number of beaconing links, at that point at least 1 should be active. Since before checking, we have done rcu_assign_pointer() so at least 1 should be there. That is why that condition. If it is more than 1, then this is not the first link which is going to come up and hence there is no need to set the flag again. >> @@ -1486,7 +1488,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, >> if (old) >> kfree_rcu(old, rcu_head); >> RCU_INIT_POINTER(link->u.ap.beacon, NULL); >> - sdata->u.ap.active = false; >> + >> + if (!ieee80211_num_beaconing_links(sdata)) >> + sdata->u.ap.active = false; > > == 0 maybe? > Yeah can do. I prefer "!expr" over "expr == 0". Do you have any preference? > Or maybe we should just save/restore the value instead? > >> list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) >> netif_carrier_off(vlan->dev); >> >> - if (ieee80211_num_beaconing_links(sdata) <= 1) > > Unrelated, but it looks like the VLAN netif_carrier_off() handling above > is also wrong and should really go into this if block as well. > Yeah MLO VLAN changes would do that? The previous change was focusing on the AP mode alone and I did not want to break anything in VLAN so did not touch it there.