Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1336297lqm; Thu, 2 May 2024 11:27:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdxMEPeDNndtuXVGv5edUXL0OsRIidWfF90NR4PhfvMLR4enuuY3DAl3j7epAsg9Z+7ZIcZBdXBc9tp1fSyjHDV4xS68v7VMs8y97JYw== X-Google-Smtp-Source: AGHT+IE4zUBdAlLhuvxjalTfQSrpYvJvGtf/Tp/dMnSKCbCQhKvLRI0cscYj+TXaC3Xcey8th4AU X-Received: by 2002:a05:6871:7890:b0:23c:2cf7:9ff9 with SMTP id oz16-20020a056871789000b0023c2cf79ff9mr808315oac.7.1714674455760; Thu, 02 May 2024 11:27:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714674455; cv=pass; d=google.com; s=arc-20160816; b=gadMHPci3vMYSH0u6/GIK50Q1P0MWPA4lURt69GUaX1M17G82nyD7uwD0ivtc8zlKV 4Q4a0TOJSTkYadTBi/NaWIB4RQ+3Fe8yWeqY4rdSC87ar7rWIJA2v5t8wxIjfFSMwaAm uyDoN0GJVzSdHAw9Nldc8vQjF0K/P7QqM5RoAf26nYDH5lyTfQ65+hJpAsqTJFFQdVI+ 291GCNi7L6ORdiAOydEqqZ+ks5/lgddB9QCKRcU0TAwj1KsAeclFCTqEgholX7NqCixV aseEp91rwadzn07kgbo4GYrzWfKt3LIjPJXxk1HUiyLyKjRpJqQMvXOX1uSl9rSmwN0p SaAw== 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=/kxfyxK+8vuyCHXX0FmJ3EELg8p/F71v+4YFZg4/kr4=; fh=m3BbMyle5FmKhSwXF4lxNSoqPsdpKggMMiklpXSUA3M=; b=NOq4Zun9ANoibyLpjIr0Bf1iiUeFpTiSmxxoxe5l6by+a4NONFYquxPm1bEEbQxeKZ UD0mwMsSJMqLxsV1IFNEVSH979K1lJcuykXMubjUrJxy0Mvzda6RB2vFomi0rgMn2yYp X3afKkpxkiPNFKeTUwu6zu1dMWt0aRNZavJiWkPkYpaUCaBmyVpBJ5abqYOxDY9WHOPr jrJBbdEm2K2OnzhzKe5oDigeKkV8m1yiT/j5dCT5wWWaBQh61yVxDc3bMgAXmBMjdcK7 ZkkfLmsyoaOcw0vbwznBHlzdv6QuxXYZs+zhBMwv4Zh1xjIIpF/8k5IWFFqSgiBjbACl XOYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E2gpWDER; 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-7123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jm5-20020ad45ec5000000b006a0276d4893si1560219qvb.173.2024.05.02.11.27.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 11:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E2gpWDER; 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-7123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7123-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 564F91C21D76 for ; Thu, 2 May 2024 18:27:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B89DA173335; Thu, 2 May 2024 18:27:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="E2gpWDER" 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 F382B173333 for ; Thu, 2 May 2024 18:27:29 +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=1714674451; cv=none; b=hsnpZm/RVFr9X9QuL2Lo8lmnOrp4OtQy1J7j6TG9qLmJN/CygIyfKSpcsYK2j9EY+Okb87Kzc1kd8gQTNoCf+Dyb+6qrW9qD/1vFD1FLbrlAdPJ+hXmN0whFf9n+mZJ+yObBMB5F7e/Fb8JpTwNkoFb6yFQYmqBW+C/IzOgtskw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714674451; c=relaxed/simple; bh=dY3EjCo247J8dLlUd1/RKRLUiyJQ7e9ePN5NLQ7poPw=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=RUvpOWqXuYdeJrDdsYTFTdSW+4FzhdlCOcmBKwNx7upvZoATC8P0f9vqIN9gHWvT8FkJcG2v3npVU1/stneeLAs9phA4ZgtpXwM20SS4kayZYgO0VmHelTohrTc0J8HGINnyeaHuHqjzKkTXrLaPU+G0uULi6yTthlblIVDeF2Y= 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=E2gpWDER; 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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 442BGW1g025124; Thu, 2 May 2024 18:27:24 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=/kxfyxK+8vuyCHXX0FmJ3EELg8p/F71v+4YFZg4/kr4=; b=E2 gpWDERDJ60v0VfxYktQxMdcX5/3vPK3ZwLQP9bFhuDlihZLPvZpuoOrm5BspJDyz 4YxdD2MInBo8cWsMIdHxf4HkmgE7W3vXIWbRVqFZYfYisA17oWm0VDSbK5V/0AVj zQmxSJ18mbY56c0QdqfyqlH7CVMdcpT/jcIUcJCzb1bQi+IonplzLstK66n5U7aq uBitGWsNWRdqRAzHQS+XfXiZhHR5uf1rlf7ynruCHLp3jzcXVlzoAuciNbyjSwmc uKvi21+7Z2eGnuuOxWG9Z+8xVaPFZTDfiYeJ1snYn63jHxrRqvl7cT2Gqtdfz2tp zZALbIp83StoWhX5zjCQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xv01tt08r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 May 2024 18:27:23 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 442IRM1J012342 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 2 May 2024 18:27:22 GMT Received: from [10.110.94.246] (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; Thu, 2 May 2024 11:27:21 -0700 Message-ID: <1b260786-310c-4143-bf78-7afce33f05fe@quicinc.com> Date: Thu, 2 May 2024 11:27:21 -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 v2 1/3] wifi: ath12k: prepare vif data structure for MLO handling Content-Language: en-US To: Rameshkumar Sundaram , CC: , Sriram R References: <20240502171240.927155-1-quic_ramess@quicinc.com> <20240502171240.927155-2-quic_ramess@quicinc.com> From: Jeff Johnson In-Reply-To: <20240502171240.927155-2-quic_ramess@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-ORIG-GUID: Y7vochsQf8wqIyPjaup7I4z66RrFeuzC X-Proofpoint-GUID: Y7vochsQf8wqIyPjaup7I4z66RrFeuzC 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-05-02_10,2024-05-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 adultscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2405020122 On 5/2/2024 10:12 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