Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp931555lqt; Fri, 7 Jun 2024 03:07:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWH2qYfmY4iaSZqrhbg2zinb8xDD4YCBZHYCRsuj/c5xXFWsz5eSPOzg4vEaI/BAVsC1nIVnJZz/dGzaxRJafprMAaG6s2GvP1isltnFQ== X-Google-Smtp-Source: AGHT+IEVRmRbQsdXxJTx76izATawY84w6BfgDDYpVg5yyAPXemRdcrVnafr2mUxEiSyRR52D1co4 X-Received: by 2002:a05:6a20:748d:b0:1b2:ab9f:4544 with SMTP id adf61e73a8af0-1b2f969ede5mr2368007637.7.1717754867744; Fri, 07 Jun 2024 03:07:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717754867; cv=pass; d=google.com; s=arc-20160816; b=ArhwUh1U7pSDenuh39xRC8f/UNrckA/Lq8EjOHzgDWw1JqDAY2MhmdFWcsj7+nE1CG oOCeSs/tHCzwSyqOvruEWAbP4WIZM/dnXBPyLhsidM6UKM8mlO+uIeG5FL7TFRMWbvPS a/kY7jtgGADT2+h3kGibbHFPe5Y0f9+p9TltFMTbSIDKtjFmN6cs6bCK6J4KdKSwr1Km JPcnkrP31XWGwML2iNf9K6RTZW8QajH8xQJl4DxE1h0MGA7CUOTjNRIyEVtF1GlgSYEK CS0UUxbEsoOK2QWiiDcFX5Xa9k19+1FM/d4NPGFWcTZ6Rnv3wpNLr82d2lufmomuVJVu cT8w== 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=wuh1Ri4Fw+IdW7OKtyJJMHHfUPgurMEw3zuy2ksfZ+I=; fh=aRdHA8gIXE5KTPhP10l2FrLhMFHmROVU/bJ2cA+nLwk=; b=lS0c51UkososiSDbcaiOzK5JnW1t72B6StNdNqTuZXpsC7VblwNEL4Vtd24L6CUuOr l/R96TYJtHLCm47pKXbOe7RxMCOtyQDCCc24dKNjiBcgUv4IkwHjiwXFJ0orZwNyT7I9 BCc2hGeG5m1D2SIDM18Fn2+g4wQSCm/bN1z0QKuUHD8fJVo5Wz20f7bt473A2malMzdy iWTZHPrfdhjHtG4y/QaN+VTjMx2erp5Zi6dpFzw6kJYK3Zf8Gnb/umKLiT+dVAZdIGoz PLhlBGfL+exqHXnxeB70zdN7Xe3p8aGHLnjhNwy7Pm+l8BJPrcdqkJ4hmPI0dTVjwUZm vbYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CwjGjwjk; 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-8679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8679-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. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6d8c70135si7841205ad.230.2024.06.07.03.07.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 03:07:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CwjGjwjk; 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-8679-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8679-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 F08E528D809 for ; Fri, 7 Jun 2024 10:07:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EFC2DDD9; Fri, 7 Jun 2024 10:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CwjGjwjk" 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 6F2741CA85 for ; Fri, 7 Jun 2024 10:07:43 +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=1717754865; cv=none; b=MfnPN2gMh860VTiIFBdeC8w/Nr0xYbz8w2ALuLgB41RJm7/qdswMvkkpfVPkrQYVj1ZbPbYVreHC9huuLjJOUo/pb0rkFykpI7RwZkfQZ8x6DtfCzPlPvgoCa4Mt9zSVO3B5aHNeIJDcC1lp/xgE11StADh8utjSxbOOb0PBLJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717754865; c=relaxed/simple; bh=+1Zo5wbC+F9TUCjGyHhJqvrcEW4v4O/T/kFHfQKcceo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=VNLZoMUOO36udYlHi7FKOCHCYBHZdSbe8/jLbuXObNBgxLc/7sqsW+pGwdjnSMzwQAgS45a2fXRTGntsdA0VCUn/bbBHWq+UukVaFCFJXYq59/nIeKYJhXBNknf7YrxSstdRZauC36jchCw+bcDP+aDZlUwXajwQ+PnD38ot+5Y= 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=CwjGjwjk; 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 (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4571Uohg031628; Fri, 7 Jun 2024 10:07:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wuh1Ri4Fw+IdW7OKtyJJMHHfUPgurMEw3zuy2ksfZ+I=; b=CwjGjwjkxl17Daz/ wW2iOlwqYS+7UptahBqAdhIWmNCbhGW+48AOK+OkGjz7coW+nQbXSGRXYNTyvZ42 LBgQvYyS+NtgUna6dyzSvKGS2KVxQIrZpyGmgPmH1PLrvP8JuirtyRQ+jtKjLCrS 12In44zQ5YNFFvEfsk3mdgEuMYe9a0cBorq1yN0X5xiLFy2mXIIiYEvfMQx3hkcw 3hoyycuN71GGYJev7i6YXd0GIcLu6p9sh6zBQhE7SxD/2zFfiLe0knWEvETP8jxU pxFjPdNSsWf8f2YLn+EcDAOhgrBCHpBwmKDVmjqedVy2ys8s8ENQ+r8fnLXfJcyN nTwxwA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yjk89e0p8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2024 10:07:34 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 457A7XRd024462 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Jun 2024 10:07:33 GMT Received: from [10.152.205.142] (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.9; Fri, 7 Jun 2024 03:07:31 -0700 Message-ID: Date: Fri, 7 Jun 2024 15:37:27 +0530 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFC v3 6/8] wifi: mac80211: extend ifcomb check functions for multi-radio Content-Language: en-US To: Felix Fietkau , CC: , , References: From: Karthikeyan Periyasamy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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: kMSX_GTKPWH2ZMoOIp15BsFcDGtX8eIB X-Proofpoint-ORIG-GUID: kMSX_GTKPWH2ZMoOIp15BsFcDGtX8eIB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-07_04,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 suspectscore=0 mlxlogscore=809 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406070073 On 6/6/2024 11:37 PM, Felix Fietkau wrote: > Add support for counting global and per-radio max/current number of > channels, as well as checking radio-specific interface combinations. > > Signed-off-by: Felix Fietkau > --- > net/mac80211/cfg.c | 7 +- > net/mac80211/chan.c | 17 +++-- > net/mac80211/ibss.c | 2 +- > net/mac80211/ieee80211_i.h | 6 +- > net/mac80211/iface.c | 2 +- > net/mac80211/util.c | 131 +++++++++++++++++++++++++++----------- > 6 files changed, 116 insertions(+), 49 deletions(-) > > diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c > index 62119e957cd8..950b7b72f0b8 100644 > --- a/net/mac80211/cfg.c > +++ b/net/mac80211/cfg.c > @@ -263,7 +263,7 @@ static int ieee80211_start_p2p_device(struct wiphy *wiphy, > > lockdep_assert_wiphy(sdata->local->hw.wiphy); > > - ret = ieee80211_check_combinations(sdata, NULL, 0, 0); > + ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1); > if (ret < 0) > return ret; > > @@ -285,7 +285,7 @@ static int ieee80211_start_nan(struct wiphy *wiphy, > > lockdep_assert_wiphy(sdata->local->hw.wiphy); > > - ret = ieee80211_check_combinations(sdata, NULL, 0, 0); > + ret = ieee80211_check_combinations(sdata, NULL, 0, 0, -1); > if (ret < 0) > return ret; > > @@ -4001,7 +4001,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, > goto out; > > /* if reservation is invalid then this will fail */ > - err = ieee80211_check_combinations(sdata, NULL, chanctx->mode, 0); > + err = ieee80211_check_combinations(sdata, NULL, chanctx->mode, 0, -1); Once we reach the global limit, all the -1 passing caller get fail becuase the iface check param (existing and new) is validated against the global limit. since global limt as a sort of union of all per-radio limits. Ex: Global iface = 6 (Radio iface 2GHz:4, 5GHz:4, 6GHz:6) So far 6 iface created (Radio iface 2GHz:2, 5GHz:3, 6GHz:1) In this case, new iface creation get fail because caller uses ieee80211_check_combinations() with -1 as radio idx, so it checked against global limit -- Karthikeyan Periyasamy -- கார்த்திகேயன் பெரியசாமி