why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped

Burakov, Anatoly anatoly.burakov at intel.com
Mon Feb 20 14:59:01 CET 2023


Well, technically, no, you’re right, it wouldn’t - not unless you start polling those queues from some other thread. We can’t prevent that from happening, so we figured the best way would be to just disallow queue starts until we’re done configuring everything. So, yes, we could relax that restriction, it’s just a matter of specifying what’s allowed and what’s not vs. just doing a blanket “no” and keeping things simple.

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

Hi,

Thank you for the information.
I see from rte_eth_add_rx_callback, 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

From: Burakov, Anatoly <anatoly.burakov at intel.com<mailto:anatoly.burakov at intel.com>>
Sent: 2023年2月20日 18:28
To: Xiaoping Yan (NSB) <xiaoping.yan at nokia-sbell.com<mailto:xiaoping.yan at nokia-sbell.com>>; users at dpdk.org<mailto:users at dpdk.org>
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped

Hi,

It is mainly because we’re install callbacks, which is not thread-safe unless the PMD is stopped. Our PMD’s internal config structures are not thread-safe. You should only start these ports after you configure everything.

From: Xiaoping Yan (NSB) <xiaoping.yan at nokia-sbell.com<mailto:xiaoping.yan at nokia-sbell.com>>
Sent: Monday, February 20, 2023 6:12 AM
To: users at dpdk.org<mailto:users at dpdk.org>; Burakov, Anatoly <anatoly.burakov at intel.com<mailto:anatoly.burakov at intel.com>>
Subject: RE: why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped

Hi Anatoly

I see this multiple queue support is added by you.
Could you kindly help me to understand why rte_power_ethdev_pmgmt_queue_enable need other queues to be in stopped state?

commit 5dff9a72b0efeab02a2b71e52c4871805b7e64cb
Author: Anatoly Burakov anatoly.burakov at intel.com<mailto:anatoly.burakov at intel.com>
Date:   Fri Jul 9 16:08:15 2021 +0000

power: support callbacks for multiple Rx queues


Thank you.

Br, Xiaoping

From: Xiaoping Yan (NSB)
Sent: 2023年2月16日 21:00
To: users at dpdk.org<mailto:users at dpdk.org>
Subject: why rte_power_ethdev_pmgmt_queue_enable need to check if other queues are stopped

Hi experts,

I’m trying to use dpdk power pmd management APIs in my dpdk application.
My application uses several ports, each have one rx queue, and it goes like this

1.     Init first port, setup rx queue, call rte_power_ethdev_pmgmt_queue_enable, and start the first port

2.     Init second port, setup rx queue, call rte_power_ethdev_pmgmt_queue_enable, and start the second port

3.     …
Now for the first port & queue, rte_power_ethdev_pmgmt_queue_enable return success, but for the second port & queue, it returns -16
>From rte_power_ethdev_pmgmt_queue_enable code, I think it fails when checking if other queues are stopped as well.
    /* check if other queues are stopped as well */
    ret = cfg_queues_stopped(lcore_cfg);
    if (ret != 1) {
        /* error means invalid queue, 0 means queue wasn't stopped */
        ret = ret < 0 ? -EINVAL : -EBUSY;
        goto end;
    }
This seems quite strange for me, why other queues have to be in stopped state?
Can anyone help to explain?

Thank you.


Br, Xiaoping

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20230220/d3a844e8/attachment-0001.htm>


More information about the users mailing list