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 0F2EB41CEC for ; Mon, 20 Feb 2023 14:40:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06F3343048; Mon, 20 Feb 2023 14:40:48 +0100 (CET) Received: from CNSHPPMGWESA01.NOKIA-SBELL.COM (unknown [116.246.26.71]) by mails.dpdk.org (Postfix) with ESMTP id 3DDB640395 for ; Mon, 20 Feb 2023 14:40:44 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.97,312,1669046400"; d="scan'208,217";a="11006847" Received: from unknown (HELO CNSHPPEXCH1610.nsn-intra.net) ([135.251.51.110]) by CNSHPPMGWESA01.NOKIA-SBELL.COM with ESMTP; 20 Feb 2023 21:40:43 +0800 Received: from CNSHPPEXCH1601.nsn-intra.net (135.251.51.101) by CNSHPPEXCH1610.nsn-intra.net (135.251.51.110) 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 21:40:43 +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 21:40:43 +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: AdlCBFLV8QoElG47QfeDBKVxvG5wigC7XY2wAAj7pdAABqvI0A== Date: Mon, 20 Feb 2023 13:40:43 +0000 Message-ID: <4da7b78195454d6f823a983d71310c5d@nokia-sbell.com> References: <0c6664b4318142df94531165fb2acf94@nokia-sbell.com> <0684cc0bac6f4b4996899b1dd9eafbf4@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_4da7b78195454d6f823a983d71310c5dnokiasbellcom_" 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_4da7b78195454d6f823a983d71310c5dnokiasbellcom_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 SGksDQoNClRoYW5rIHlvdSBmb3IgdGhlIGluZm9ybWF0aW9uLg0KSSBzZWUgZnJvbSBydGVfZXRo X2FkZF9yeF9jYWxsYmFjaywgdGhlIGNhbGxiYWNrIGlzIGFkZGVkIHRvIHBlciBxdWV1ZSBkYXRh OiBydGVfZXRoX2RldmljZXNbcG9ydF9pZF0ucG9zdF9yeF9idXJzdF9jYnNbcXVldWVfaWRdOw0K U28gaXQgc2hvdWxkIG5vdCBhZmZlY3QgcG9sbGluZyBvbiBvdGhlciBxdWV1ZXM/DQoNCg0KQnIs IFhpYW9waW5nDQoNCkZyb206IEJ1cmFrb3YsIEFuYXRvbHkgPGFuYXRvbHkuYnVyYWtvdkBpbnRl bC5jb20+DQpTZW50OiAyMDIzxOoy1MIyMMjVIDE4OjI4DQpUbzogWGlhb3BpbmcgWWFuIChOU0Ip IDx4aWFvcGluZy55YW5Abm9raWEtc2JlbGwuY29tPjsgdXNlcnNAZHBkay5vcmcNClN1YmplY3Q6 IFJFOiB3aHkgcnRlX3Bvd2VyX2V0aGRldl9wbWdtdF9xdWV1ZV9lbmFibGUgbmVlZCB0byBjaGVj ayBpZiBvdGhlciBxdWV1ZXMgYXJlIHN0b3BwZWQNCg0KSGksDQoNCkl0IGlzIG1haW5seSBiZWNh dXNlIHdloa9yZSBpbnN0YWxsIGNhbGxiYWNr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CjMuICAgICChrQ0KTm93IGZvciB0aGUgZmlyc3QgcG9ydCAmIHF1ZXVlLCBydGVfcG93ZXJf ZXRoZGV2X3BtZ210X3F1ZXVlX2VuYWJsZSByZXR1cm4gc3VjY2VzcywgYnV0IGZvciB0aGUgc2Vj b25kIHBvcnQgJiBxdWV1ZSwgaXQgcmV0dXJucyAtMTYNCkZyb20gcnRlX3Bvd2VyX2V0aGRldl9w bWdtdF9xdWV1ZV9lbmFibGUgY29kZSwgSSB0aGluayBpdCBmYWlscyB3aGVuIGNoZWNraW5nIGlm IG90aGVyIHF1ZXVlcyBhcmUgc3RvcHBlZCBhcyB3ZWxsLg0KICAgIC8qIGNoZWNrIGlmIG90aGVy IHF1ZXVlcyBhcmUgc3RvcHBlZCBhcyB3ZWxsICovDQogICAgcmV0ID0gY2ZnX3F1ZXVlc19zdG9w cGVkKGxjb3JlX2NmZyk7DQogICAgaWYgKHJldCAhPSAxKSB7DQogICAgICAgIC8qIGVycm9yIG1l YW5zIGludmFsaWQgcXVldWUsIDAgbWVhbnMgcXVldWUgd2Fzbid0IHN0b3BwZWQgKi8NCiAgICAg ICAgcmV0ID0gcmV0IDwgMCA/IC1FSU5WQUwgOiAtRUJVU1k7DQogICAgICAgIGdvdG8gZW5kOw0K ICAgIH0NClRoaXMgc2VlbXMgcXVpdGUgc3RyYW5nZSBmb3IgbWUsIHdoeSBvdGhlciBxdWV1ZXMg aGF2ZSB0byBiZSBpbiBzdG9wcGVkIHN0YXRlPw0KQ2FuIGFueW9uZSBoZWxwIHRvIGV4cGxhaW4/ DQoNClRoYW5rIHlvdS4NCg0KDQpCciwgWGlhb3BpbmcNCg0K --_000_4da7b78195454d6f823a983d71310c5dnokiasbellcom_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

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@d= pdk.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_4da7b78195454d6f823a983d71310c5dnokiasbellcom_--