Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp956184lqt; Fri, 7 Jun 2024 04:04:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWW4aH6Y07jSGW2tL1U7EbHycB998S7pq0i6NqaNaISYUomXJnnFa3gKzuL9Tj/8hPLQXYNpHLWO+dBpxEbUH44JMNkHDHTidR0kIApWw== X-Google-Smtp-Source: AGHT+IFCqgw3SGjihe4mZ1OUUzEExXL59WFtuMRpbAxeaJ0STeTVKnQH+O/yC8DMh/1hgSNBoL4m X-Received: by 2002:a19:9109:0:b0:52b:7f31:8652 with SMTP id 2adb3069b0e04-52bb9f84c86mr1766851e87.36.1717758285550; Fri, 07 Jun 2024 04:04:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717758285; cv=pass; d=google.com; s=arc-20160816; b=Y+6NtsdwKmcA+9NI4Yd3luI2WRp++WCQN0LJ9obS9jCCllHfgp9JbDiU3gJ8fUBQ5d Rm2txxlEt2Us9gY5OGoM+6gtyEYKt3QtETa7v+756K4IOLJXpi3Zeyck89XhIvDRvmj0 dPu/2I7/xLT/q3bwg/k0WqVty2zPUfUBBaaiycqQ6wdUXB4mEcfXg3gt+vTjP4pd2eif nJ7JIJiOVj26t85HU6dBRJutgMp8gR1LSPY/p0wLfytRq/WYEiHR3UlN0kHaV/z1VFZD 6DzZ0vNKS8tW5Rkv7rapurIaBX1fpz+o85wHSYABL03xhQDLrJbpD3hhEOJhEeTptCCj HppA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=fispS20cFDaSfj9ElcLdmKhsIT5a+xs6wq1EJuK18P0=; fh=FWLqcmcJXA/Yc+Oa6pEJCbMdlHxZCj5KpkEYmY/2e+M=; b=mlnb3EoyQCVSlt9ndLfVgRku6o/C1B5T83y4S93ETR9LJMOLDMsvM/3jqnRmVq7QHK JdQ2wvWk1TxU9Zjo894MiuXS8KzQxl5F+ht8fyyXnRaAkdiBp9ENyQr5/7YsxVu1fYl2 JqMz7AqQx10KKZmO/dgYcID9U43/O5+Nlh7qFBkQGEJhg5xMBFh5q3HEuywo8bA8JLv7 l2CC0kVgwKK1EMTkVm+zY8YQQBolmZRIrg0TOePaV6nyn4WNi5JAtxyB24JbQ8MVOcO1 7WoEklpFqTr9ycIXRXqhZwun8NS1bhYkXUT54qd9MMS3ZuDY5WC1eaxMseT9xv8cwFf/ 50RQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Jzk1Omjh; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80749a31si175012366b.959.2024.06.07.04.04.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Jzk1Omjh; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 400E51F2510B for ; Fri, 7 Jun 2024 11:04:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A64D1862BF; Fri, 7 Jun 2024 11:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="Jzk1Omjh" X-Original-To: linux-wireless@vger.kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (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 C59441862B8 for ; Fri, 7 Jun 2024 11:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717758271; cv=none; b=iJr0Uq+XamDVJO7lVV9v9sEiCw+lQjxTtDIPoWJq1CXfSJZu588Y8S5f8KFVHbKAVuTEUSjxR2F8IjV3kuhNYwZp3T8ZZbviawarURmoz2KZV2fAqr+32MEJrhbQvpBov04LItkbHil1PcKcX4hcbSYPvh5t39Knz9TaZvtEpJo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717758271; c=relaxed/simple; bh=ltQkzk+5DKkvhyCz6MIBT2v8rK+b7coXNDX/sKwIsRQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XKZKJJUx7LspXSwXKagkYcVDqICfkohvAMQbNwTS4/DugqDdOWGmR+BGGT/ldW7InJ57G/tdxkoh0DWA61Nmg/mDuIlDSktiX5tFX4toqenOrNhAr6gthPhZ/3ZaYaBaNMkgPJGWGVah0V3RCZXiv47xMw4N6cFQAY5JLDeFncg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=Jzk1Omjh; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fispS20cFDaSfj9ElcLdmKhsIT5a+xs6wq1EJuK18P0=; b=Jzk1Omjh0wNozjIEpqlHS/YVEp wCzYMMKV641v957XXKEAkmIMmwnSB0wC3GdEcMu0+PLVlV6qVOx/5NBlewZf77pdlJQDGg7xrM7Ff iKbGUO5xPCUQ86scXVo/mRUMetoAVSREF2ILUPKgl15E0BjxxXSpqiueeTvLq66S2AvM=; Received: from p4ff13226.dip0.t-ipconnect.de ([79.241.50.38] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1sFXOS-008sN8-1z; Fri, 07 Jun 2024 13:04:24 +0200 Message-ID: <096940e3-713a-4533-ab0f-e82bd647e205@nbd.name> Date: Fri, 7 Jun 2024 13:04:24 +0200 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: [RFC v3 6/8] wifi: mac80211: extend ifcomb check functions for multi-radio To: Karthikeyan Periyasamy , linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, quic_adisi@quicinc.com, ath12k@lists.infradead.org References: <1f32cb6c-6be8-4e3d-8e8f-2d3c728875a9@nbd.name> <479752f5-221d-746b-7513-ba27ef547ac1@quicinc.com> From: Felix Fietkau Content-Language: en-US Autocrypt: addr=nbd@nbd.name; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pEDKq57OhxJVv1Q8XkA9Dn1SBOjNB l25vJDFAT9ntp9THeDD2fv15yk4EKpWhu4H00/YX8KkhFsrtUs69+vZQwc0cRmVsaXggRmll dGthdSA8bmJkQG5iZC5uYW1lPsJgBBMRAgAgBQJGoeQnAhsjBgsJCAcDAgQVAggDBBYCAwEC HgECF4AACgkQ130UHQKnbvXsvgCgjsAIIOsY7xZ8VcSm7NABpi91yTMAniMMmH7FRenEAYMa VrwYTIThkTlQzsFNBEah5FQQCACMIep/hTzgPZ9HbCTKm9xN4bZX0JjrqjFem1Nxf3MBM5vN CYGBn8F4sGIzPmLhl4xFeq3k5irVg/YvxSDbQN6NJv8o+tP6zsMeWX2JjtV0P4aDIN1pK2/w VxcicArw0VYdv2ZCarccFBgH2a6GjswqlCqVM3gNIMI8ikzenKcso8YErGGiKYeMEZLwHaxE Y7mTPuOTrWL8uWWRL5mVjhZEVvDez6em/OYvzBwbkhImrryF29e3Po2cfY2n7EKjjr3/141K DHBBdgXlPNfDwROnA5ugjjEBjwkwBQqPpDA7AYPvpHh5vLbZnVGu5CwG7NAsrb2isRmjYoqk wu++3117AAMFB/9S0Sj7qFFQcD4laADVsabTpNNpaV4wAgVTRHKV/kC9luItzwDnUcsZUPdQ f3MueRJ3jIHU0UmRBG3uQftqbZJj3ikhnfvyLmkCNe+/hXhPu9sGvXyi2D4vszICvc1KL4RD aLSrOsROx22eZ26KqcW4ny7+va2FnvjsZgI8h4sDmaLzKczVRIiLITiMpLFEU/VoSv0m1F4B FtRgoiyjFzigWG0MsTdAN6FJzGh4mWWGIlE7o5JraNhnTd+yTUIPtw3ym6l8P+gbvfoZida0 TspgwBWLnXQvP5EDvlZnNaKa/3oBes6z0QdaSOwZCRA3QSLHBwtgUsrT6RxRSweLrcabwkkE GBECAAkFAkah5FQCGwwACgkQ130UHQKnbvW2GgCeMncXpbbWNT2AtoAYICrKyX5R3iMAoMhw cL98efvrjdstUfTCP2pfetyN In-Reply-To: <479752f5-221d-746b-7513-ba27ef547ac1@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 07.06.24 12:53, Karthikeyan Periyasamy wrote: > > > On 6/7/2024 3:52 PM, Felix Fietkau wrote: >> On 07.06.24 12:07, Karthikeyan Periyasamy wrote: >>> >>> >>> 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 >> >> Use the sum of the number of interfaces from each radio instead of the >> maximum. > > Oh, then legacy user have misconception of the global interfaces > advertised and try to fail for the allowed limits. Sure, but that might be an issue either way until user space is updated and users start looking at the per-radio ifcomb data. The global data is simply not enough to describe the details of the radio split. - Felix