Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp378339rdb; Thu, 1 Feb 2024 11:01:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGU0pbbCDxg1DmRic4bzWvuuaWesbB4OLl8XPl8SNmZyUDd9W18vXYzZ0CI7qx5PtAb+Cua X-Received: by 2002:a05:6214:518b:b0:685:d4bc:38d0 with SMTP id kl11-20020a056214518b00b00685d4bc38d0mr5861579qvb.21.1706814112971; Thu, 01 Feb 2024 11:01:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706814112; cv=pass; d=google.com; s=arc-20160816; b=Rx7yThX8iGamSorNewcFzJ+03Zu+ILNIEdHmvWEK3cwaJP+jw4sedwsFPuOa4ROtmm kYcA4inq6wxQugJy6zwYsE1puazxJ0svpToIxCityXm1kr8Cuwt6zpLheQKbZpCrvKep rRg83jPJ529Rx1M5iSn2Kygnd8uu4SoEaK9zXb4xK8uKM4wbq6YGwMGuFZBfJCFtSnOQ a7/LTW1VUNagi2rabS9CDsd+3EA6Dduqt+lF9Wi27jDbpMutAOWQ42lSwp16U23XlgKD 1JF2mq6o2TkrDk0syU80iCTaEo7TqoEgi7gslfmWPv+WSO4t/pOgchplYO7Bhe/h0OUB Q0Og== 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=CEPvhuqBAzR9JTprWZWY6mkiYQwJNcN/+j7I9096g80=; fh=cxrF7ZsGySi5f2EF3+mWY3YIWNDhwydD2w5xC7qd1XU=; b=wccwC9Ifu2T+P+JM/XEoJ0cjSgcb7cQn4JBsD5UpOfkluj0RhdjzwDDdrm6GgRTiI1 U27lndaroDjDCTcYQivOHs45v9c964ivWSuEGkbdhkM6aBcHaRynrOpTeAYxb62XPuGR 09UOszGajDB9Nq4E9bU3CNIq0Hx6KFGTBEhyvBpuxFcHBck81aGzgRsNDptF/QkdyjT/ 1s+qjTW2FtdVF1RzEjDRN5sqAs+KgVtqY/xzAl/AbaeHUNjI0TFe2Wolfwo15SKt4bPr glFMhCqsoOyL0LG6MiOyWs6s2vwh1tJISJryTgvBDPlNFosR4N9oVIkoLYWZ84sxYJSa MKEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PtRqufRB; 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-kernel+bounces-48742-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48742-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCWAkUzs6UWgjUdiFM3euO3Tf4coL49JEmdBuN4OvOMzjtaO566Kn6XuLndM6Py8yOXUXvbY34nvttK5VQ3JN3iWUEbRzWScKoi6Lnshqg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k18-20020ad44212000000b0068c7e2f3e4csi135890qvp.106.2024.02.01.11.01.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:01:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48742-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=PtRqufRB; 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-kernel+bounces-48742-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48742-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 5E8311C21F91 for ; Thu, 1 Feb 2024 19:01:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B546D85270; Thu, 1 Feb 2024 19:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="PtRqufRB" 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 C781684FBF; Thu, 1 Feb 2024 19:01:35 +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=1706814097; cv=none; b=gDfGdcgPSLKx7EUCTj07q9ZVDhmVjZHl/cDaTLbSVUmEmXGp1TnaBWNija8X6IhZ8T/iubaOj5i5JAIip4t/ms3flUaGaUCOnDJItf81HCjAXOwPz78uSLi1NZe9FQbbD9lspttbKUyVlfPzjs8Gd9IKEjFt7fQIU6GYtnEJark= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814097; c=relaxed/simple; bh=Jfb2ag/RVb7aLbbTFIRRajXzhYFdXWB21U1ECTT7m+w=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=S/iVpT40oKYqP1qIpPmb2uaAGHKuJxHfPzPpXTbHVm4k2pxe8ywlllyL8KPDWUV4hPf/ML1cO9fwrILOqsFNgBSYDtTyshKBufBDr/+KwpxmsE8PUX3/OdfdJ/Qp7EDFizwb+GyOKOkWbaLct9wEV7sKzKr3iFgY6t7dV8Nn88s= 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=PtRqufRB; 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 411GEMZa004256; Thu, 1 Feb 2024 19:00:57 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=CEPvhuqBAzR9JTprWZWY6mkiYQwJNcN/+j7I9096g80=; b=Pt RqufRBRL2/tQACYvHUmx8rVAPoE9dnhRRNoNy2BpxO3u/d0GaRd/AplxNJflzGmu f1qvIpWAQQ4zzrEwLu5SsUDqYSpTd6rdKOGk0D4JQr/HSnKrTD+6ECyXmCdC+Cs5 b/qPW3RJ9aOIO+JmtUg4HDoSdLRzdpaekZ3fPiV5o9lgZwAvBBqtBu90p2ItS0bc naC/otOgipTlgz185sZj2IhBFYRAofIj8u5OBQ+N4VkRZR10Au/8402eZ/V3REzf n2Q8fE1JpOTl+rk6QWNNEZR1jqJWxo4JSAZxSuEentL/BkJJe8PwQVByKFMhPNi1 846KKKu32Kk6TKIdqJWA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w06mnsu2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Feb 2024 19:00:57 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 411J0t6H004090 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2024 19:00:55 GMT Received: from [10.110.99.223] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 1 Feb 2024 11:00:52 -0800 Message-ID: Date: Thu, 1 Feb 2024 11:00:52 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 2/2] net: stmmac: TBS support for platform driver Content-Language: en-US To: Esben Haabendal CC: Rohan G Thomas , "David S . Miller" , Alexandre Torgue , "Jose Abreu" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Maxime Coquelin , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Giuseppe Cavallaro , "Serge Semin" , Andrew Halaney , , , , , , , , References: <20230927130919.25683-1-rohan.g.thomas@intel.com> <20230927130919.25683-3-rohan.g.thomas@intel.com> <92892988-bb77-4075-812e-19f6112f436e@quicinc.com> <87r0i44h8v.fsf@geanix.com> <5626e874-066c-4bf2-842d-a7f3387b6c1b@quicinc.com> <87a5okvbdt.fsf@geanix.com> From: "Abhishek Chauhan (ABC)" In-Reply-To: <87a5okvbdt.fsf@geanix.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 598Pt-pLYSSFWLEVg2mMTCAOFDnOomF_ X-Proofpoint-ORIG-GUID: 598Pt-pLYSSFWLEVg2mMTCAOFDnOomF_ 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-01_05,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2402010146 On 2/1/2024 12:26 AM, Esben Haabendal wrote: > "Abhishek Chauhan (ABC)" writes: >> On 1/26/2024 12:43 AM, Esben Haabendal wrote: >>> "Abhishek Chauhan (ABC)" writes: >>> >>>> Qualcomm had similar discussions with respect to enabling of TBS for a >>>> particular queue. We had similar discussion on these terms yesterday >>>> with Redhat. Adding Andrew from Redhat here >>>> >>>> What we discovered as part of the discussions is listed below. >>>> >>>> 1. Today upstream stmmac code is designed in such a way that TBS flag >>>> is put as part of queue configurations(see below snippet) and as well >>>> know that stmmac queue configuration comes from the dtsi file. >>>> >>>> //ndo_open => stmmac_open >>>> int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;(comes from tx_queues_cfg) >>>> >>>> /* Setup per-TXQ tbs flag before TX descriptor alloc */ >>>> tx_q->tbs |= tbs_en ? STMMAC_TBS_AVAIL : 0; >>>> >>>> 2. There is a no way to do this dynamically from user space because >>>> we don't have any API exposed which can do it from user space >>> >>> Not now. But why not extend ethtool API to allow enabling TBS for >>> supported controllers? >> >> ethtool API can be implemented but that still doesn't solve the >> problem of stopping the entire MAC block because of enhanced desc >> allocation. > > I am not sure what you exact point is here. > > If you look at the implementation of ethtool API for changing ring > parameters, you have stmmac_set_ringparam() which calls > stmmac_reinit_ringparam(), which again calls stmmac_release() if the > interface is up (stopping the entire MAC), and then stmmac_open() which > reinitializes everything. > > The same pattern could be applied to changes to enable enhanced > descriptor allocation. > > I don't see why that will not be acceptable. Why would anyone have to do > that while critical traffic is flowing? In your system you should be > able to know which queues needs enhanced descriptors before starting > communication. > >> 1. We can either allocate enhanced desc for all channels at bootup and >> then choose to switch to enable TBS mode at runtime (Additional memory >> usage) > > A good default would IMHO be to enable enhanced descriptors for all but > TX queue 0. This will allow use of TBS without needing to change > anything. If the rather minimal extra memory usage is disturbing anyone, > then they can tune it at boot time before bringing the interface up. > >> 2. Live with the disruption of traffic for a brief duration of time. >> Which is not a good solution for priority and critical traffic. > > As mentioned above, I don't see why anyone would need to modify the > descriptor allocation while critical traffic is flowing. > > If you are able put this information in your device tree, you definitely > will be able to put it in an boot script in some form. > >>>> and also TBS rely on special descriptors aka enhanced desc this >>>> cannot be done run time and stmmac has to be aware of it before we >>>> do DMA/MAC/MTL start. >>> >>> Isn't this somewhat similar to changing the RX/TX ring parameters, >>> which I believe also is quite difficult to do at run time, and >>> ethtool therefore requires the interface to be down in oroer to >>> change them? >>> >>>> To do this dynamically would only mean stopping DMA/MAC/MTL realloc >>>> resources for enhanced desc and the starting MAC/DMA/MTL. This means >>>> we are disrupting other traffic(By stopping MAC block). >>> >>> Yes. But you would be disrupting traffic less than by requiring a >>> complete reboot of the target which is needed if the devicetree must be >>> changed. >>> >> any DTS solution today anyway requires completely loading the boot >> image and rebooting the device, but once the device is functional, End >> user can activate TBS, as he knows the exact usecase and requirements. >> I understand the solution is not scalable, but at this point we don't >> have a solution to activate TBS at runtime. > > Exactly. We are discussing a solution to activate enhanced descriptors > at "runtime". But I propose to do it in a similar way as changing ring > parameters, so it is in runtime seen from a CPU perspective, but the > interface will be shortly brought down when changing it. > >>>> 3. I dont think there is a way we can enable this dynamically today. I >>>> would like upstream community to share your thoughts as well. >>> >>> Hereby done. Could we investigate the possibility of using ethtool to >>> change TBS enable/disable "run-time"? >>> >> We can either allocate enhanced desc for all channels at bootup >> and then choose to switch to enable TBS mode at runtime. > > I think we should do something like this: > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=3b12ec8f618e > > for all glue drivers, so a sane default is established that allows using > TBS from boot up. > > But in addition to that, I think it would make sense to create an > ethtool API to change it from that default. And it will bring down the > interface while applying the change. > Agreed. Okay, We can go with this approach. I will evaluate the changes from ethtool perspective. ethtool approach will be favorable to everyone as most of the users rely on ethtool to configure the NIC parameters. For now glue drivers can exclude queue0 for tbs and have all other queues to have tbs enabled. > /Esben