Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp571485lqh; Tue, 7 May 2024 07:46:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXH0svhdw0O8DWJu6ejwTfr4w5LJhAAbidO/mPyrhK3eixgSntEmkg+51LekcOGKa9pFksT1aBB3ZnD0d5aTsuzpDt5JJLSgMmzkqrZQQ== X-Google-Smtp-Source: AGHT+IFJRi0JlqNJ9C9cCn9Np+0gpMxWrur9O+QM6myc7WbZtk0aFXQWbmQQXZEohVPXFWB7Hmq8 X-Received: by 2002:a05:6358:885:b0:192:829b:3684 with SMTP id m5-20020a056358088500b00192829b3684mr2589006rwj.25.1715093188013; Tue, 07 May 2024 07:46:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715093187; cv=pass; d=google.com; s=arc-20160816; b=RzjPqDApMVNyp1YB+OCPQeX0hh+v5IzrN5HArkcPGS52C4/CsARmMqcHQv+TgZmgGE hOIqcONP3bc870ryI+kb22ytkXsEwGVq6/ZyrWtpqMNnKCt2bNEVApu40Hwa0t9I634q DE1S1Gh9t6CoAgkdfvO9Md3aZ8gAGLlS0eFM4VM4AGzk0JLrfPorgcDgcYUMAoXQdD0K rQC3EMmMiGhAY06ngVWktIyf07h/kAjuwgBQKgyKaRQi6L3gLDnHFMSwJQIspS7gqhl6 ivO+ZMolvS+0oqN6L0OUG0puEKcWlxGtw9q298v/UKWPpleFQfNT8R83pB/3Y9z6iH0b XwlA== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=g9eZjM8TZq3HQJBCrmbeXv9VLARCEt7Z9RPIMfiyBUQ=; fh=MF2peTgYJ//G8t751nSOVbIbH2TOrwM3JpiMYcMIVv8=; b=QhBTMw330rCjUxchFRFOOsmyJjVIfSQRcKkWaNNA7IXIzpa+Kk6uDX5z9Avz/56boi jf1VCQUYR7KVTm/3hcekv8NKJDA9UAkEGMTJoyUQqB12xON6G/DFBwsh2tN5iWUYxUWf wjygb2LEE3wGHIQOqW4mwOuf/xz2/pUYM/SMacve/pIYzGq58iQ+QYUDhQCrWm2exQf/ f6pX2WIzPlhIKvLyCyZULE4LBBiDr4JbaIlqEX+Ti864hrl8Q1E/7uHjOd8/Z1tY6W8/ TBttJvLaJacuWouKEa8JBmoilkvUt/CGQrrffeKsLcWejQyJ2K4cwa2Ik5RWCsHAMkjC c+gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=T4du+4mb; 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-7290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7290-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 e24-20020a635458000000b005dcae4c1ff2si8084383pgm.67.2024.05.07.07.46.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7290-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=T4du+4mb; 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-7290-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7290-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 BA04D28CAC2 for ; Tue, 7 May 2024 14:35:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 253AE15FA63; Tue, 7 May 2024 14:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="T4du+4mb" 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 70A4C1514C5 for ; Tue, 7 May 2024 14:35:38 +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=1715092540; cv=none; b=lVSK55FEJiRoqbkMLZU1UVkIEXhfCdPVINKI7AdxAZQyd+rWfKT8hY+PZJDYG2QM00RsGIa66l/GZDXfLA0DsTY2LrcBd/tTrJbIZh04FmDSVM+C5KCGCsOyoL1wpRIRJK187VwNbvaqJ/L6D76XnMgiVBUu2H2qLpWvgVVoaVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715092540; c=relaxed/simple; bh=U9sjjNWRXLW1JnUj8XSo5gqCjAAy7qwoC0e0VljA3C8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=NAp9ZW5mavHI6vH/MNe89q4rAfb8/PqBudhPDktgimD9IdfLC7dt7Ast7vr/b7i9U8DRF85jzgRBUFYMu/r4e649otHSnHo3UKn8nWPNvIpXQtMfqfjKSieAb0Es0iTCYUbLm9M8wS1jCQpBOcbcCoQboWInO5Psn7tLo7FqxpQ= 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=T4du+4mb; 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 447BTHP1009585; Tue, 7 May 2024 14:35:32 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=g9eZjM8TZq3HQJBCrmbeXv9VLARCEt7Z9RPIMfiyBUQ=; b=T4 du+4mb+V/2k0JS92W+hcOA6Z/mTt4AyAIIxMdKOokltr4302L0uO9F63lNLyxP8n wrgy5USO9qsC9THeaj1QzXJUrXDER3WQVLKq/Y9Ca7qgolVOFRUJz+9iGyDM5o3h eoJWPXkKBPYnLH0T5M799oOFO72aWjnAvgO2++O7wuOygXI/3YoglZFwv6mBLD9J GW+xyVgLAYKU9RJBmMyWoKTQcVb9yUa7onXuhot/Evse4rShTaTImP/jHcnWg4cp AJGsw3S7Qa+3FKnMRI6K+Tp6ZRKfcJtWijvcbmYNB9C8ECQnqzDHNoFfE70x23WV HOPuqv0YM6Gth1kbw+kg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xyfhv150n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 May 2024 14:35:31 +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 447EZUc5003979 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 7 May 2024 14:35:30 GMT Received: from [10.50.36.33] (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; Tue, 7 May 2024 07:35:28 -0700 Message-ID: <23d5074b-0992-2d68-7ddd-dca43bbcb878@quicinc.com> Date: Tue, 7 May 2024 20:05:25 +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: [PATCH RFC] wifi: cfg80211: Refactor interface combination input parameter To: Johannes Berg CC: References: <20240427031503.22870-1-quic_periyasa@quicinc.com> <3f8e4d6d0f2facde80ad82b5b3060eb0af0958a4.camel@sipsolutions.net> Content-Language: en-US From: Karthikeyan Periyasamy In-Reply-To: <3f8e4d6d0f2facde80ad82b5b3060eb0af0958a4.camel@sipsolutions.net> 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: SGwoDN72boZ1icEY1tyYZ9fjezLzxD4x X-Proofpoint-ORIG-GUID: SGwoDN72boZ1icEY1tyYZ9fjezLzxD4x X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-07_08,2024-05-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2405070100 On 5/7/2024 3:17 PM, Johannes Berg wrote: > On Sat, 2024-04-27 at 08:45 +0530, Karthikeyan Periyasamy wrote: >> Currently, the interface combination input parameter num_different_channels >> and iftype_num are directly filled in by the caller under the assumption >> that all channels and interfaces belong to a single hardware device. This >> assumption is incorrect for multi-device interface combinations because >> each device supports a different set of channels and interfaces. As >> discussed in [1], need to refactor the input parameters to encode enough >> data to handle both single and multiple device interface combinations. >> This can be achieved by encoding the frequency and interface type under >> the interface entity itself. With this new input parameter structure, the >> cfg80211 can classify and construct the device parameters, then verify them >> against the device specific interface combinations. > > ^^ This should probably mention _something_ about links too :) > sure > >> [1]: https://lore.kernel.org/linux-wireless/ca70eeb3cdee1e8c3caee69db595bc8160eb4115.camel@sipsolutions.net/ >> >> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 >> >> Signed-off-by: Karthikeyan Periyasamy >> --- >> drivers/net/wireless/ath/wil6210/cfg80211.c | 44 +++++-- >> .../broadcom/brcm80211/brcmfmac/cfg80211.c | 60 +++++++-- >> .../net/wireless/quantenna/qtnfmac/cfg80211.c | 32 +++-- >> include/net/cfg80211.h | 37 +++++- >> net/mac80211/util.c | 124 +++++++++++++++--- >> net/wireless/util.c | 56 ++++++-- >> 6 files changed, 276 insertions(+), 77 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c >> index 8993028709ec..3f9f5f56bd19 100644 >> --- a/drivers/net/wireless/ath/wil6210/cfg80211.c >> +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c >> @@ -625,17 +625,25 @@ static int wil_cfg80211_validate_add_iface(struct wil6210_priv *wil, >> { >> int i; >> struct wireless_dev *wdev; >> - struct iface_combination_params params = { >> - .num_different_channels = 1, >> - }; >> + struct iface_combination_params params = { 0 }; > > nit: just use "= {}". > sure, will address in the next version. >> + ifaces = kcalloc(total_iface, sizeof(*ifaces), GFP_KERNEL); >> + if (!ifaces) >> + return -ENOMEM; >> + >> + list_for_each_entry(pos, &cfg->vif_list, list) { >> + if (params.num_iface >= total_iface) >> + continue; > > ?? > Seems like that should be a WARN_ON or something? WARN_ON() is good. > >> + struct iface_combination_interface *ifaces = NULL; >> + u16 total_iface = 0; >> + int ret; >> >> list_for_each_entry(pos, &cfg->vif_list, list) >> - params.iftype_num[pos->wdev.iftype]++; >> + total_iface++; >> >> - params.iftype_num[new_type]++; >> - return cfg80211_check_combinations(cfg->wiphy, ¶ms); >> + ifaces = kcalloc(total_iface, sizeof(*ifaces), GFP_KERNEL); > > No point in "= NULL" if you overwrite it immediately. > sure, will address in the next version. -- Karthikeyan Periyasamy -- கார்த்திகேயன் பெரியசாமி