[dpdk-dev] [PATCH v2 01/44] bus/vdev: add helper to get vdev from eth dev
Maxime Coquelin
maxime.coquelin at redhat.com
Mon Jan 25 15:51:41 CET 2021
On 1/21/21 9:58 AM, Xia, Chenbo wrote:
> Hi Maxime,
>
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin at redhat.com>
>> Sent: Wednesday, January 20, 2021 5:24 AM
>> To: dev at dpdk.org; Xia, Chenbo <chenbo.xia at intel.com>; olivier.matz at 6wind.com;
>> amorenoz at redhat.com; david.marchand at redhat.com
>> Cc: Maxime Coquelin <maxime.coquelin at redhat.com>
>> Subject: [PATCH v2 01/44] bus/vdev: add helper to get vdev from eth dev
>
> Sorry that I missed the title in v1..
>
> Better use 'ethdev' or 'eth device'here?
Changed to ethedv.
Thanks,
Maxime
> Thanks,
> Chenbo
>
>>
>> This patch adds an helper macro to get the rte_vdev_device
>> pointer from a rte_eth_dev pointer.
>>
>> This is similar to RTE_ETH_DEV_TO_PCI().
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
>> Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
>> Reviewed-by: David Marchand <david.marchand at redhat.com>
>> ---
>> drivers/bus/vdev/rte_bus_vdev.h | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h
>> index d14eeb41b0..f99a41f825 100644
>> --- a/drivers/bus/vdev/rte_bus_vdev.h
>> +++ b/drivers/bus/vdev/rte_bus_vdev.h
>> @@ -34,6 +34,8 @@ struct rte_vdev_device {
>> #define RTE_DEV_TO_VDEV_CONST(ptr) \
>> container_of(ptr, const struct rte_vdev_device, device)
>>
>> +#define RTE_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device)
>> +
>> static inline const char *
>> rte_vdev_device_name(const struct rte_vdev_device *dev)
>> {
>> --
>> 2.29.2
>
More information about the dev
mailing list