Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp33270lqd; Tue, 23 Apr 2024 13:38:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQJvoUS5/oQFayr0w6+PUZibq44mAaOZrf+9o81VGj/T2+AG4e7wpRnQxwQAcs3Q8b0JaBicxyxzaCEaYHdfLDMW8iZOnHHTDv0Pz52A== X-Google-Smtp-Source: AGHT+IEFd/BAcfvljuxHA536n7IRpozPuyvHSgKiOd2JXbHXLhrhCjYskhBsf2aO8DI4CRnxIn9w X-Received: by 2002:a05:6a21:6da8:b0:1a7:4b6f:7934 with SMTP id wl40-20020a056a216da800b001a74b6f7934mr677197pzb.17.1713904727924; Tue, 23 Apr 2024 13:38:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713904727; cv=pass; d=google.com; s=arc-20160816; b=gBUZRXMXflHvFgdcge+EoeFaVEg2V77XStB0ycUGLcTePTJuMjSI17gW8rd6ocoxb3 YY1JqcjrlP/fGbo/tmEHCCK9WM1okSz2bV4mwE5QTb+vzu/yjoZ1v+p3INaX8tOogYEE R8sXbpoLD+N/r4HYf6WEceiUV7uaYeBCm8DTcUfG5lkz6bUkuGThJRZ+oYWKTwfFbIUb hIvDeySp/P9pQY5UeCRfewtM0eTisEBVBc2mh1t3x1vqokVA3u0tEAOI2LhMcCcx1tRY JcFS8BDKfnjYWWvRuQHhF/Le0zGyrQPDSBQKvmprHjxa2wyeKROXRXzuEY1br5tcTYrI FvrQ== 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=KwhishAK9ZJ5e7hj+OdV92ttsecf4A+xBXA8wTaEueo=; fh=m3BbMyle5FmKhSwXF4lxNSoqPsdpKggMMiklpXSUA3M=; b=OCge8A2OR+SH3rukjnBnL38AxBwIONxCK+DlV9sSnDvvxlKwXmIR6QoPIafnc8vMAw tghLJzRXklRF0ULkIUrf5MwhzyJO/iJsoUmlGoQ7ruFke5+PwKOH0x117PqaYZholN0G ByVkiM6sRWTJ38yyh6SrZ93F/bfsFDgrBuqIFkxh0+mslQ4vDfu7yZ8aMKL+B8VVIENf rO5/XeDqiFItvBLNbdUEMh1ZPa1G9w1CGUO9w9qN21A8MN0easkPmFBBZAfktnlWumnR ljoas3qh3oDuY2AWFzSvSBQyyTa0rpaYOhgSrq7MQJe5vvQgb4vzlYkxKG/pXuMzdwcw CWnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eAdTFgtT; 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-6743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z15-20020a634c0f000000b005d44c945aebsi10031291pga.82.2024.04.23.13.38.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 13:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eAdTFgtT; 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-6743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6743-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 12AF1B24744 for ; Tue, 23 Apr 2024 20:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AA1A328B6; Tue, 23 Apr 2024 20:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="eAdTFgtT" 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 8C0B920B3E for ; Tue, 23 Apr 2024 20:30:36 +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=1713904238; cv=none; b=TypA6f7Fpi2+p53Oe3FyN4bPl74Ds0Qq8buMEkDEpuilHN3QWrUqNow6GcODXhnRMSZtb68x2IgpMXo07fJM+HBhyspQF3IRrjOTx1gfsXb7ggbszixNOtQkxh16vnU58LkThk167xN1ZgE1M+dtaCwUWjl2NEF0E2i+NoD3sUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713904238; c=relaxed/simple; bh=pXsM9z4I4WGVdXxlawiCqnVefEvU/SJo9E2K2podCxw=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=o43IccxVE0GzJ5EQ44/8aY/OXYNl4uwV7WlJmsg/WgneNr63O5Y7EdMcXC2ZoT/ve3h37t3AqUc5NB25IZrl8rz+4Ur3r3D65xGtym1NFQH1ttQijzR/rf4RkBc6ZmeXTHIDJxKs3ZE+t27Ny8+4+1Hfe+I3hiji8EhxQQwPkK4= 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=eAdTFgtT; 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 43N7vBJi021592; Tue, 23 Apr 2024 20:30:31 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=KwhishAK9ZJ5e7hj+OdV92ttsecf4A+xBXA8wTaEueo=; b=eA dTFgtTmA3EP2mg8LlzPApDF2c6ESl1jx6ErwzjzSim2lij6ngQY50ZFBNcaiOtGK JKSjH0InofnJdPrhHNiNNaZr09n5OEmrRKgfQJUeBtLbgMJr71VeHp++OMMmxJus gDV/xOawqQvNx04awPmTnAF33qcIq2o5vuqJdjU3Zc8RI0Adrhqfxh9lQrfJmp8c khmZOItltg5sm0WvUNLGlC16fulentCH8GK54As3llHLjaxfAQO8rL8xWfH5785U oSuPAo0t2GaTBLrfegWDn1/8NUATBaCopN9PhAB2ZblU5fMjywMYqCSlEZe1qbGP p65Nd7hoisj9CgkDxoFQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xp91rt7j4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Apr 2024 20:30:30 +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 43NKUTpJ032601 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Apr 2024 20:30:29 GMT Received: from [10.110.61.159] (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, 23 Apr 2024 13:30:28 -0700 Message-ID: <00028ab8-6cef-4b56-b9ba-766fe2317b9e@quicinc.com> Date: Tue, 23 Apr 2024 13:30:28 -0700 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 1/3] wifi: ath12k: prepare vif data structure for MLO handling Content-Language: en-US To: Rameshkumar Sundaram , CC: , Sriram R References: <20240422125630.1469456-1-quic_ramess@quicinc.com> <20240422125630.1469456-2-quic_ramess@quicinc.com> From: Jeff Johnson In-Reply-To: <20240422125630.1469456-2-quic_ramess@quicinc.com> Content-Type: text/plain; charset="UTF-8" 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: 2GC_i75IJlgywu4EIxf5gV0YCJRQNYJk X-Proofpoint-ORIG-GUID: 2GC_i75IJlgywu4EIxf5gV0YCJRQNYJk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-23_16,2024-04-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 phishscore=0 bulkscore=0 suspectscore=0 impostorscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404230049 On 4/22/2024 5:56 AM, Rameshkumar Sundaram wrote: > From: Sriram R > > To prepare the driver for MLO support, split the driver vif > data structure to scale for multiple links. This requires changing > the use of arvif to per link and not per hw which can now > comprise of multiple links. > Also since most configurations from mac80211 are done per link, do refactoring > of the driver functions to apply these configurations at link level. > > Split ath12k_vif which is the driver private of ieee80211_vif to store > link specific information as ath12k_link_vif. For default use cases > the ath12k vif will have a preallocated link vif called deflink which will > be used by non ML and the first link vif of ML vif. > > With MLO Support to be added, remaining link vifs will be allocated during > channel assignment where vdev create/start happens. These link vifs will be > freed during interface down. > > Current ath12k_vif(arvif) structure > > +---------------+ +---------------+ +---------------+ > | ieee80211_vif | | ieee80211_vif | | ieee80211_vif | > | private data | | private data | | private data | > | | | | | | > | ath12k_vif | | ath12k_vif | | ath12k_vif | > | (arvif) | | (arvif) | | (arvif) | > | | | | | | > | +----------+ | | +----------+ | | +----------+ | > | |*ar (2GHz)| | | |*ar (5GHz)| | | |*ar (2GHz)| | > | +----------+ | | +----------+ | | +----------+ | > | | | | | | > +---------------+ +---------------+ +---------------+ > > Proposed ath12k_vif(ahvif) containing ath12k_link_vif(s) (arvif) > (deflink is preallocated member which is always the first link if > ieee80211_vif is MLD and is the only link otherwise) > > +---------------------------------+ > | ieee80211_vif | > | private data | > | | > | ath12k_vif(ahvif) | > | | > | +-------------------------------+ > | |ath12k_link_vif deflink (arvif)| > | | +---------------+ | > | | | *ar(2GHz) | | > | +-------------------------------+ > | +-------------------------------+ > | | ath12k_link_vif *link (arvif)| > | | +---------------+ | > | | | *ar(5GHz) | | > | +-------------------------------+ > | +-------------------------------+ > | | ath12k_link_vif *link (arvif)| > | | +---------------+ | > | | | *ar(6GHz) | | > | +-------------------------------+ > | | > +---------------------------------+ > > To refactor existing ath12k_vif to make use of link vifs, following > changes are made, > > 1. ath12k_vif now called by variable name ahvif stores multiple > arvifs(ah12k_link_vif) and also has a back pointer to ieee80211_vif. > > 2. In this patch set, only deflink is used to be on par with the > existing code. When MLO support is added the link id will be used to > fetch the arvif. > > 3. For mac80211 ops which doesn't use specific link_id, the config or info > is common for the vif, hence apply the config to all link vifs. > The links_map in the ahvif, will be used to identify all the link vifs that > are setup. > > 4. Change ath12k_vif_to_arvif() as ath12k_vif_to_ahvif() to fetch the > hw level vif. The link vif can be fetched from ahvif->link[], or the > deflink can be accessed via ahvif->deflink. API to access link > vif(arvif) by passing link_id can be introduced with MLO Support. > > 5. The ieee80211_vif can be accessed from ahvif using ath12k_vif_to_vif() > > Locking: > Currently modifications to members of arvif and arsta are protected by ar->conf_mutex > and it stays as such. > Now with these hw level structure (ahvif) being introduced, any modifications > to its members and link objects (i.e., arvifs[] which are dynamically allocated) > needs to be protected for writing and ah->conf_mutex is used for the same. > Also, atomic contexts(say WMI events and certain mac_ops) that we currently have in driver > will not(shouldn't be allowed) do any modifications but can read them and > rcu_read_lock() is used for the same. > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 > > Signed-off-by: Sriram R > Co-developed-by: Rameshkumar Sundaram > Signed-off-by: Rameshkumar Sundaram Acked-by: Jeff Johnson