[dpdk-dev] [PATCH v23 1/6] dmadev: introduce DMA device library

Kevin Laatz kevin.laatz at intel.com
Tue Oct 5 10:24:32 CEST 2021


On 04/10/2021 22:12, Radha Mohan wrote:
> On Fri, Sep 24, 2021 at 3:58 AM Chengwen Feng <fengchengwen at huawei.com> wrote:
>> The 'dmadevice' is a generic type of DMA device.
>>
>> This patch introduce the 'dmadevice' device allocation APIs.
>>
>> The infrastructure is prepared to welcome drivers in drivers/dma/
>>
>> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
>> Acked-by: Bruce Richardson <bruce.richardson at intel.com>
>> Acked-by: Morten Brørup <mb at smartsharesystems.com>
>> Acked-by: Jerin Jacob <jerinjacobk at gmail.com>
>> Reviewed-by: Kevin Laatz <kevin.laatz at intel.com>
>> Reviewed-by: Conor Walsh <conor.walsh at intel.com>
>> ---
>>   MAINTAINERS                            |   5 +
>>   config/rte_config.h                    |   3 +
>>   doc/api/doxy-api-index.md              |   1 +
>>   doc/api/doxy-api.conf.in               |   1 +
>>   doc/guides/dmadevs/index.rst           |  12 ++
>>   doc/guides/index.rst                   |   1 +
>>   doc/guides/prog_guide/dmadev.rst       |  64 ++++++
>>   doc/guides/prog_guide/img/dmadev.svg   | 283 +++++++++++++++++++++++++
>>   doc/guides/prog_guide/index.rst        |   1 +
>>   doc/guides/rel_notes/release_21_11.rst |   4 +
>>   drivers/dma/meson.build                |   4 +
>>   drivers/meson.build                    |   1 +
>>   lib/dmadev/meson.build                 |   7 +
>>   lib/dmadev/rte_dmadev.c                | 263 +++++++++++++++++++++++
>>   lib/dmadev/rte_dmadev.h                | 134 ++++++++++++
>>   lib/dmadev/rte_dmadev_core.h           |  51 +++++
>>   lib/dmadev/rte_dmadev_pmd.h            |  60 ++++++
>>   lib/dmadev/version.map                 |  20 ++
>>   lib/meson.build                        |   1 +
>>   19 files changed, 916 insertions(+)
>>   create mode 100644 doc/guides/dmadevs/index.rst
>>   create mode 100644 doc/guides/prog_guide/dmadev.rst
>>   create mode 100644 doc/guides/prog_guide/img/dmadev.svg
>>   create mode 100644 drivers/dma/meson.build
>>   create mode 100644 lib/dmadev/meson.build
>>   create mode 100644 lib/dmadev/rte_dmadev.c
>>   create mode 100644 lib/dmadev/rte_dmadev.h
>>   create mode 100644 lib/dmadev/rte_dmadev_core.h
>>   create mode 100644 lib/dmadev/rte_dmadev_pmd.h
>>   create mode 100644 lib/dmadev/version.map
>>
> <snip>
> Hi Chengwen,
> I see that the new version removed the "rte_dmadev_get_device_by_name()".
> What is the way to get the dmadev from inside the PMD .remove ? I am
> looking to get the dev_private as we need to do some cleanup
> operations from the remove function.
>
> regards,
> Radha Mohan

Hi Radha,

You can use rte_dma_get_dev_id(name) to get the device ID, which can 
then be used to get the rte_dma_dev struct (which contains dev_private) 
for that device from rte_dma_devices[].

See "idxd_dmadev_destroy()" in 
http://patches.dpdk.org/project/dpdk/patch/20210924133916.4042773-6-kevin.laatz@intel.com/ 
for an example.

Hope that helps,

Kevin




More information about the dev mailing list