[dpdk-dev] [PATCH v4 03/10] ethdev: add simple power management API
Burakov, Anatoly
anatoly.burakov at intel.com
Fri Oct 9 18:11:20 CEST 2020
On 08-Oct-20 11:26 PM, Ananyev, Konstantin wrote:
>>
>> Add a simple API allow ethdev get wake up address from PMD.
>> Also include internal structure update.
>>
>> Signed-off-by: Liang Ma <liang.j.ma at intel.com>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
>> ---
>> lib/librte_ethdev/rte_ethdev.c | 19 ++++++++++++++++
>> lib/librte_ethdev/rte_ethdev.h | 24 ++++++++++++++++++++
>> lib/librte_ethdev/rte_ethdev_driver.h | 28 ++++++++++++++++++++++++
>> lib/librte_ethdev/rte_ethdev_version.map | 1 +
>> 4 files changed, 72 insertions(+)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>> index d7668114ca..88253d95f9 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -4804,6 +4804,25 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
>> dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode));
>> }
>>
>> +int
>> +rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id,
>> + volatile void **wake_addr,
>> + uint64_t *expected, uint64_t *mask)
>> +{
>> +struct rte_eth_dev *dev;
>> +uint16_t ret;
>> +
>> +RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +
>> +dev = &rte_eth_devices[port_id];
>> +
>> +ret = (*dev->dev_ops->get_wake_addr)
>> +(dev->data->rx_queues[queue_id],
>> + wake_addr, expected, mask);
>
>
> This is an optional dev_ops, so I think you need to check that get_wake_addr()
> is defined for that PMD.
> Plus you need to check that queue_id is valid.
>
Sorry, added dev_ops check but left out the queue id part :( Will fix in v6.
--
Thanks,
Anatoly
More information about the dev
mailing list