Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1130927rdb; Fri, 16 Feb 2024 06:22:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW4v81iWvw8twCuiTz09BXDg5qDIBfdGch1lEWrIAJr0ma+AyMVL7cOybAU12Fr84HsqJtHuj891hO1l1ms5BxkIJHwpHMlZOISw2wkOA== X-Google-Smtp-Source: AGHT+IHwMQOB+8P5GFGb52w1s0fj0i4TTuWS1Sc0VZ5aNeYdkISlxQLdPur1koO1V8ewVR2YcLTz X-Received: by 2002:a50:bae5:0:b0:563:e7ab:8e7b with SMTP id x92-20020a50bae5000000b00563e7ab8e7bmr1689523ede.9.1708093347225; Fri, 16 Feb 2024 06:22:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708093347; cv=pass; d=google.com; s=arc-20160816; b=z98zbTzA0dmVnnb1f1ewXE5qUPoBFhFoP0l5HHX6gJKGiRZ4zNB82jzo/VwabEO5Gp YAbFf1DvO02QgCtXZZE88O40+LE8NSXKodf9J0CfIdYyhucFKlgSrL+QxU7dQpkL2yhE pE6pzYDA6idnoP6apXFp5Se7O19k1IyE8ECO29w6l2kI0I4qW6DUL87/kUc6rt5xB/TD SHrCtBTKf+/BhCUtxj8yIxo0N/iHO5G9PUv6Laool8EyVAE5ZyG46p82bwxXXom6s3m0 cbEKcA5Tc26B+9A/wfapP34TYHLLPf5no4t19/hbZs/7KlqlnVM7RPNX3zaWVNtdF+In 2WIg== 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=HZxf/icU1Qn/02SY8MEqluzf3i71l6JSrerFhrnkyKM=; fh=MF2peTgYJ//G8t751nSOVbIbH2TOrwM3JpiMYcMIVv8=; b=vDtEbBmHLTELXO5eenodtPV6C+dy760tBkV6QEXYsTYqgGEMxQSyDNE3IECuy22kCg kRSpwvDfRj3Jes1lsjXHj5w1k4HY9JBFIwkD38VDehpT1N2YQJ4XqCNxPGxi/74cfvXu LaGZzeGaZEhrpyHrqnf0ayco1GY2L9SGaPClQX+zhMlci0rYRfcOdOtxYovjA3Uekjg9 hLQDWPZvLuiJSjpsUsFrPaiE9/geRN7r0y2BfZDOATuJndO5JNZ74zrlPuqCOdWezHAw gBQWKj73Pk+pUobhKO7f5N820uur/e3h57hJZMRhU82NyGkzntET0UXS6wTaK0xrBHQz 0Ukw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ao0OOPHF; 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-3675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i9-20020aa7dd09000000b0056211b0df33si12610edv.411.2024.02.16.06.22.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:22:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ao0OOPHF; 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-3675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3675-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CCF6B1F2255B for ; Fri, 16 Feb 2024 14:21:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48373768F2; Fri, 16 Feb 2024 14:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ao0OOPHF" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 7C23312C804 for ; Fri, 16 Feb 2024 14:21:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708093284; cv=none; b=aZRbAa7I4+OpxSFfc7y83FZ7gyu+bQoBrhpm8MZ5qQNnvhfI8Bdl78+7OI5nH09gHnK53LLUtGMb3raFmK9uB5OZSYglj0fBdugJoqVW67cWZSKZtKRa82oFyIK1dZ6vjG/WnAx8bXlSPBnn4eF9P0un+aieOhGmhWok0As7HMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708093284; c=relaxed/simple; bh=0dq78Ui2MRjPTzWquJmFH9TjPzG8VwsKXoeL7frZRoc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=dwkUjhMefZ1thfJVGsWBpli6IWiDMTgj2NJ94Rb+EPp/O2VedREwiuFY6L6IYQEiV77jXkLeaDOIrQeCSyH/zXDkAekYKPuyIYupBeaQl0vLogpQsZ2fV10olmCmKLstg4+JCL/W0/glN112oSEm6k9EUAVj4l7nfbGRy0uSPfg= 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=ao0OOPHF; arc=none smtp.client-ip=205.220.168.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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41GCWD0m021196; Fri, 16 Feb 2024 14:21:18 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=HZxf/icU1Qn/02SY8MEqluzf3i71l6JSrerFhrnkyKM=; b=ao 0OOPHFggwuO51oO2aXs8n5acYcmRklBawmU9W7EXueOrlLyc8NE63OlOwNKp4ZeZ bhMsDh5/QrNB+x6V2mEyjnmWc9nIdcAeSItEPWSF95kaVoq3PgkFlsIO5OqJ6PQl 0rOcVJYiv0yghhecpoIMoYpko+NZBVbw/F38rvbA7UtnQ9ZmMxtYSt8IDrHOOVbr QixPywuNI9E/LbxafofyAlo4kIDFu9bDm6KPWMn3F4Y7N6yeSPV2fqYgZ1s9CzKN 8SfnuAxs+diFaewXbtzfG0lYxXVpUkGwOTbyxmHsOTtzEPi1532Ttv6FdMKuxbHa Nsl6Dd2cGU98oSSz9iww== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w9yta93mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 14:21:17 +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 41GELH5o011852 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 14:21:17 GMT Received: from [10.216.11.141] (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.1118.40; Fri, 16 Feb 2024 06:21:16 -0800 Message-ID: <213c603a-8516-4352-9e38-61ed7bf17a8e@quicinc.com> Date: Fri, 16 Feb 2024 19:51:12 +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 2/2] wifi: mac80211_hwsim: add support for switch_vif_chanctx callback Content-Language: en-US To: Johannes Berg CC: References: <20240215162811.506065-1-quic_adisi@quicinc.com> <20240215162811.506065-3-quic_adisi@quicinc.com> <78c51497-dd6b-4d7a-b789-e3823e89a96a@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: 676-TTfIwa8GSRYN7I2v5Y6ZDtOXevsq X-Proofpoint-ORIG-GUID: 676-TTfIwa8GSRYN7I2v5Y6ZDtOXevsq 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-02-16_13,2024-02-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=465 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402160115 On 2/16/24 12:42, Johannes Berg wrote: > On Fri, 2024-02-16 at 08:45 +0530, Aditya Kumar Singh wrote: >> >>>> + for (i = 0; i < n_vifs; i++) { >>>> + hwsim_check_chanctx_magic(vifs[i].old_ctx); >>>> + wiphy_dbg(hw->wiphy, >>>> + "switch vif channel context: %d MHz/width: %d/cfreqs:%d/%d MHz -> %d MHz/width: %d/cfreqs:%d/%d MHz\n", >>>> + vifs[i].old_ctx->def.chan->center_freq, >>>> + vifs[i].old_ctx->def.width, >>>> + vifs[i].old_ctx->def.center_freq1, >>>> + vifs[i].old_ctx->def.center_freq2, >>>> + vifs[i].new_ctx->def.chan->center_freq, >>>> + vifs[i].new_ctx->def.width, >>>> + vifs[i].new_ctx->def.center_freq1, >>>> + vifs[i].new_ctx->def.center_freq2); >>>> + hwsim_set_chanctx_magic(vifs[i].new_ctx); >>> >>> >>> hwsim_set_chanctx_magic() is only partially correct, I think, this >>> depends on the mode? For CHANCTX_SWMODE_REASSIGN_VIF the chanctx should >>> already exist as well, so should also be hwsim_check_chanctx_magic() in >>> that case? >>> >> >> Oh yeah missed the mode dependency here. Thanks for pointing it out. So >> it should be something like - >> >> ... >> >> /* old already exist so check magic */ >> hwsim_check_chanctx_magic(vifs[i].old_ctx); >> >> if (mode == CHANCTX_SWMODE_REASSIGN_VIF) { >> /* Reassign then new would also exist, just interface is >> * switching >> */ >> hwsim_check_chanctx_magic(vifs[i].new_ctx); >> } else { >> /* SWAP_* then new context does not exist hence set magic. >> * Also old will no longer exist so clear the magic >> */ >> hwsim_set_chanctx_magic(vifs[i].new_ctx); >> hwsim_clear_chanctx_magic(vifs[i].old_ctx); >> } >> >> ... >> >> One thing, in patch should I keep those comments or those are noisy? >> Seems noisy to me (if at least mode documentation is referred then >> things are clear already)? >> > > I'm not sure I care all that much, but I'd say even with the reference > to the modes, it's fairly easy to figure out at least by looking at the > mode docs? > Yes correct. I will drop inline comments. Not required tbh. > I'd probably go for a switch () statement on the modes and even WARN on > invalid mode, while at it? hwsim is a test vehicle, after all. > Yes, good point :). Thanks will incorporate and send v2 soon.