From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE6B541CEC for ; Mon, 20 Feb 2023 15:10:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A2E74305D; Mon, 20 Feb 2023 15:10:35 +0100 (CET) Received: from CNSHPPMGWESA01.NOKIA-SBELL.COM (unknown [116.246.26.71]) by mails.dpdk.org (Postfix) with ESMTP id 017FB40395 for ; Mon, 20 Feb 2023 15:10:32 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.97,312,1669046400"; d="scan'208,217";a="11007425" Received: from unknown (HELO CNSHPPEXCH1601.nsn-intra.net) ([135.251.51.101]) by CNSHPPMGWESA01.NOKIA-SBELL.COM with ESMTP; 20 Feb 2023 22:10:24 +0800 Received: from CNSHPPEXCH1601.nsn-intra.net (135.251.51.101) by CNSHPPEXCH1601.nsn-intra.net (135.251.51.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 20 Feb 2023 22:10:24 +0800 Received: from CNSHPPEXCH1601.nsn-intra.net ([135.251.51.101]) by CNSHPPEXCH1601.nsn-intra.net ([135.251.51.101]) with mapi id 15.01.2375.034; Mon, 20 Feb 2023 22:10:23 +0800 From: "Xiaoping Yan (NSB)" To: "Burakov, Anatoly" , "users@dpdk.org" Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped Thread-Topic: why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped Thread-Index: AdlCBFLV8QoElG47QfeDBKVxvG5wigC7XY2wAAj7pdAABqvI0AAAK9qQAACsWAA= Date: Mon, 20 Feb 2023 14:10:23 +0000 Message-ID: <3c01d07600754a8096b736610522b754@nokia-sbell.com> References: <0c6664b4318142df94531165fb2acf94@nokia-sbell.com> <0684cc0bac6f4b4996899b1dd9eafbf4@nokia-sbell.com> <4da7b78195454d6f823a983d71310c5d@nokia-sbell.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [135.251.51.115] Content-Type: multipart/alternative; boundary="_000_3c01d07600754a8096b736610522b754nokiasbellcom_" MIME-Version: 1.0 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_3c01d07600754a8096b736610522b754nokiasbellcom_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 SGksDQoNCj4+IG5vdCB1bmxlc3MgeW91IHN0YXJ0IHBvbGxpbmcgdGhvc2UgcXVldWVzIGZyb20g c29tZSBvdGhlciB0aHJlYWQNCkkgZG9uoa90IHVuZGVyc3RhbmQgdGhpcyBwb2ludC4NCkFzIHRo ZSByeCBjYWxsYmFjayBpcyBwZXIgcXVldWUgZGF0YSwgaXQgc2VlbXMgdG8gbWUgb25seSB0aGlu ZyBpcyB3ZSBzaG91bGQgbm90IHBvbGxpbmcgdGhpcyBxdWV1ZSAgd2hpbGUgd2UgYXJlIG1vZGlm eSBpdHMgY2FsbGJhY2suIFNvIG9ubHkgdGhpcyBxdWV1ZSBzaG91bGQgYmUgaW4gc3RvcHBlZCBz dGF0ZSAobWF5YmUgZXZlbiB0aGlzIGlzIG5vdCByZXF1aXJlZD8gQmVjYXVzZSBJIHNlZSBhdG9t aWMgb3BlcmF0aW9uIGlzIHVzZWQgKF9fYXRvbWljX3N0b3JlX24gaW4gcnRlX2V0aF9hZGRfcnhf Y2FsbGJhY2sgYW5kIF9fYXRvbWljX2xvYWRfbiBpbiBydGVfZXRoX3J4X2J1cnN0KSkuDQpBbnl3 YXksIHBvbGxpbmcgb3RoZXIgcXVldWVzIG9uIHNvbWUgb3RoZXIgdGhyZWFkIHNob3VsZ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RvcHBlZCBzdGF0ZT8NCkNhbiBhbnlvbmUgaGVscCB0byBleHBsYWluPw0KDQpUaGFuayB5b3Uu DQoNCg0KQnIsIFhpYW9waW5nDQoNCg== --_000_3c01d07600754a8096b736610522b754nokiasbellcom_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

Hi,

 

>> not unless you start poll= ing those queues from some other thread

I don=A1=AFt understand this point.<= o:p>

As the rx callback is per queue data= , it seems to me only thing is we should not polling this queue  while= we are modify its callback. So only this queue should be in stopped state (maybe even this is not required? Because I see atomic= operation is used (__atomic_store_n in rte_eth_add_rx_callback and __atomi= c_load_n in rte_eth_rx_burst)).

Anyway, polling other queues on some= other thread should not affect, right? Or can you help to explain a bit mo= re on this?

 

Thank you very much.

 

Br, Xiaoping<= /p>

 

From: Burakov, Anatoly <anatoly.burakov@intel.com>
Sent: 2023
=C4=EA2=D4=C220<= /span>=C8=D5 21:59
To: Xiaoping Yan (NSB) <xiaoping.yan@nokia-sbell.com>; users@d= pdk.org
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check i= f other queues are stopped

 

Well, technically, no, you=A1=AFre right, it wouldn=A1=AFt =A8C not unless= you start polling those queues from some other thread. We can=A1=AFt preve= nt that from happening, so we figured the best way would be to just disallo= w queue starts until we=A1=AFre done configuring everything. So, yes, we could relax that restriction, it=A1=AFs just a matter of speci= fying what=A1=AFs allowed and what=A1=AFs not vs. just doing a blanket =A1= =B0no=A1=B1 and keeping things simple.

&nbs= p;

From: Xiaoping Yan (NSB) <xiaoping.yan@nokia-sbell.com>
Sent: Monday, February 20, 2023 1:41 PM
To: Burakov, Anatoly <anatoly.burakov@intel.com>; users@dpdk.org
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check i= f other queues are stopped

 

Hi,

 

Thank you for the information.<= o:p>

I see from rte_eth_add_rx_callb= ack, the callback is added to per queue data: rte_eth_devices[port_id].post= _rx_burst_cbs[queue_id];

So it should not affect polling= on other queues?

 

 

Br, Xiaoping<= /p>

 

From: Burakov, Anatoly <anatoly.= burakov@intel.com>
Sent: 2023
=C4=EA2=D4=C220=C8=D5 18:28
To: Xiaoping Yan (NSB) <xiaoping.yan@nokia-sbell.com>; users@dpdk.org
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check i= f other queues are stopped

 

Hi,<= /o:p>

&nbs= p;

It is mai= nly because we=A1=AFre install callbacks, which is not thread-safe unless t= he PMD is stopped. Our PMD=A1=AFs internal config structures are not thread-safe. You should only start these ports after you configure= everything.

&nbs= p;

From: Xiaoping Yan (NSB) <xiaoping.yan@nokia-sbell.com>
Sent: Monday, February 20, 2023 6:12 AM
To: users@dpdk.org; Burakov, A= natoly <anatoly.burakov@int= el.com>
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check i= f other queues are stopped

 

Hi Anatoly

 

I see this multiple queue suppo= rt is added by you.

Could you kindly help me to und= erstand why rte_power_ethdev_pmgmt_queue_enable need other queues to be in = stopped state?

 

commit 5dff9a72b0efeab02a2b71e5= 2c4871805b7e64cb

Author: Anatoly Burakov anatoly.burakov@intel.com

Date:   Fri Jul 9 16:= 08:15 2021 +0000

 

po= wer: support callbacks for multiple Rx queues

 

 

Thank you.

 

Br, Xiaoping<= /p>

 

From: Xiaoping Yan (NSB)
Sent: 2023
=C4=EA2=D4=C216=C8=D5 21:00
To: users@dpdk.org
Subject: why rte_power_ethdev_pmgmt_queue_enable need to check if ot= her queues are stopped

 

Hi experts,

 

I=A1=AFm trying to use dpdk power pmd management APIs in my dpdk application.<= o:p>

My application uses several por= ts, each have one rx queue, and it goes like this

1= .   &= nbsp; Init first port, setup = rx queue, call rte_power_ethdev_pmgmt_queue_enable, and start the first por= t

2= .   &= nbsp; Init second port, setup= rx queue, call rte_power_ethdev_pmgmt_queue_enable, and start the second p= ort

3= .   &= nbsp; =A1=AD

Now for the first port & qu= eue, rte_power_ethdev_pmgmt_queue_enable return success, but for the second= port & queue, it returns -16

From rte_power_ethdev_pmgmt_que= ue_enable code, I think it fails when checking if other queues are stopped = as well.

  &n= bsp; /* check if other queues are stopped as well */

  &n= bsp; ret =3D cf= g_queues_stopped(lcore_cfg);

  &n= bsp; if (ret !=3D 1) {

  &n= bsp;     /* error means invalid queue, 0 means queue wasn't stopp= ed */

  &n= bsp;     ret =3D re= t = < 0<= /span> ? = -EINVAL : -EBUSY;

  &n= bsp;     goto en= d;=

  &n= bsp; }

This seems quite strange for me= , why other queues have to be in stopped state?

Can anyone help to explain?

 

Thank you.

 

 

Br, Xiaoping<= /p>

 

--_000_3c01d07600754a8096b736610522b754nokiasbellcom_--