dmadev: hide devices array
PATCH 1/2 dmadev: hide devices array
No need to expose rte_dma_devices out of the dmadev library. Existing helpers should be enough, and inlines make use of rte_dma_fp_objs.
--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)
app/test/test_dmadev.c +3 -2
@@ -747,10 +747,11 @@ test_dmadev_instance(int16_t dev_id) };const int vchan =0 ; +rte_dma_info_get (dev_id, &info); +printf ("\n### Test dmadev instance %u [%s]\n" , - dev_id, rte_dma_devices[dev_id].data->dev_name); + dev_id, info.dev_name); -rte_dma_info_get (dev_id, &info);if (info.max_vchans <1 )ERR_RETURN ("Error, no channels available on device id %u\n" , dev_id);
lib/dmadev/rte_dmadev.c +1 -1
@@ -18,7 +18,7 @@static int16_t dma_devices_max;struct rte_dma_fp_object *rte_dma_fp_objs; -struct rte_dma_dev *rte_dma_devices; +static struct rte_dma_dev *rte_dma_devices; static struct { /* Hold the dev_max information of the primary process. This field is * set by the primary process and is read by the secondary process.
lib/dmadev/rte_dmadev_pmd.h +0 -2
@@ -131,8 +131,6 @@ struct rte_dma_dev {uint64_t reserved[2 ];/**< Reserved for future fields. */ } __rte_cache_aligned; -extern struct rte_dma_dev *rte_dma_devices; -/** * @internal * Allocate a new dmadev slot for an DMA device and return the pointer to that
lib/dmadev/version.map +0 -1
@@ -30,7 +30,6 @@ EXPERIMENTAL { INTERNAL { global: - rte_dma_devices; rte_dma_fp_objs; rte_dma_pmd_allocate; rte_dma_pmd_release;
Signature · 1 line
2.23.0
PATCH 2/2 dmadev: remove symbol versioning for inline helpers
Inline helpers have no global symbols in shared libraries. There is no reason to ask for versioning (plus this library would not build on Windows).
--- lib/dmadev/version.map | 7 ------- 1 file changed, 7 deletions(-)
lib/dmadev/version.map +0 -7
@@ -1,17 +1,11 @@ EXPERIMENTAL { global: - rte_dma_burst_capacity; rte_dma_close; - rte_dma_completed; - rte_dma_completed_status; rte_dma_configure; - rte_dma_copy; - rte_dma_copy_sg; rte_dma_count_avail; rte_dma_dev_max; rte_dma_dump; - rte_dma_fill; rte_dma_get_dev_id_by_name; rte_dma_info_get; rte_dma_is_valid;
@@ -20,7 +14,6 @@ EXPERIMENTAL { rte_dma_stats_get; rte_dma_stats_reset; rte_dma_stop; - rte_dma_submit; rte_dma_vchan_setup; rte_dma_vchan_status;
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH 2/2] dmadev: remove symbol versioning for inline helpers
Quoted 8 lines · David Marchand
Inline helpers have no global symbols in shared libraries. There is no reason to ask for versioning (plus this library would not build on Windows).
Fixes 91e581e5c924 ("dmadev: add data plane API")Fixes ea8cf0f8536d ("dmadev: add burst capacity API")Signed-off-by David Marchand <[email protected]>
Quoted 17 lines · David Marchand
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.Signed-off-by David Marchand <[email protected]>--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)app/test/test_dmadev.c +0
-0
app/test/test_dmadev.c test_dmadev_instance(int16_t dev_id) · line 750
Quoted 4 lines
app/test/test_dmadev.c +1
-0@@ -747,10 +747,11 @@ test_dmadev_instance(int16_t dev_id) };const int vchan =0 ; +rte_dma_info_get (dev_id, &info);
suggest declare info as: struct rte_dma_stats info = { 0 }; so that the following %s will display NULL if rte_dma_info_get call fail.
anyway,
Quoted 11 lines
app/test/test_dmadev.c +2
-2+printf ("\n### Test dmadev instance %u [%s]\n" , - dev_id, rte_dma_devices[dev_id].data->dev_name); + dev_id, info.dev_name); -rte_dma_info_get (dev_id, &info);if (info.max_vchans <1 )ERR_RETURN ("Error, no channels available on device id %u\n" , dev_id);lib/dmadev/rte_dmadev.c +0
-0
[snip]
Quoted 22 lines · fengchengwen
Quoted 20 lines · David Marchand
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.Signed-off-by David Marchand <[email protected]>--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)app/test/test_dmadev.c +0
-0@@ -747,10 +747,11 @@ test_dmadev_instance(int16_t dev_id) };const int vchan =0 ;
Quoted 4 lines
app/test/test_dmadev.c test_dmadev_instance(int16_t dev_id) · line 750
Quoted 1 line
app/test/test_dmadev.c +1
-0+rte_dma_info_get (dev_id, &info);suggest declare info as: struct
rte_dma_statsinfo = { 0 }; so that the following %s will display NULL ifrte_dma_info_getcall fail.
The problem is more generic.
Other info fields are used by the test.
If rte_dma_info_get can fail, its return code must be checked.
Worth a followup patch, can you send it?
Thanks.
Signature · 1 line
David Marchand
Quoted 8 lines
Subject: [dpdk-dev] [PATCH 1/2] dmadev: hide devices array
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.Signed-off-by David Marchand <[email protected]>---
The devices array is not needed by the drivers.
From a drivers point of view:
PATCH v2 1/3 dmadev: hide devices array
In reply to David MarchandFrom: David Marchand <[email protected]>
No need to expose rte_dma_devices out of the dmadev library. Existing helpers should be enough, and inlines make use of rte_dma_fp_objs.
--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)
app/test/test_dmadev.c +3 -2
@@ -747,10 +747,11 @@ test_dmadev_instance(int16_t dev_id) };const int vchan =0 ; +rte_dma_info_get (dev_id, &info); +printf ("\n### Test dmadev instance %u [%s]\n" , - dev_id, rte_dma_devices[dev_id].data->dev_name); + dev_id, info.dev_name); -rte_dma_info_get (dev_id, &info);if (info.max_vchans <1 )ERR_RETURN ("Error, no channels available on device id %u\n" , dev_id);
lib/dmadev/rte_dmadev.c +1 -1
@@ -18,7 +18,7 @@static int16_t dma_devices_max;struct rte_dma_fp_object *rte_dma_fp_objs; -struct rte_dma_dev *rte_dma_devices; +static struct rte_dma_dev *rte_dma_devices; static struct { /* Hold the dev_max information of the primary process. This field is * set by the primary process and is read by the secondary process.
lib/dmadev/rte_dmadev_pmd.h +0 -2
@@ -131,8 +131,6 @@ struct rte_dma_dev {uint64_t reserved[2 ];/**< Reserved for future fields. */ } __rte_cache_aligned; -extern struct rte_dma_dev *rte_dma_devices; -/** * @internal * Allocate a new dmadev slot for an DMA device and return the pointer to that
lib/dmadev/version.map +0 -1
@@ -30,7 +30,6 @@ EXPERIMENTAL { INTERNAL { global: - rte_dma_devices; rte_dma_fp_objs; rte_dma_pmd_allocate; rte_dma_pmd_release;
Signature · 1 line
2.33.0
PATCH v2 2/3 app/test: add check for DMA info get API
This patch add check for rte_dma_info_get() API.
--- app/test/test_dmadev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
app/test/test_dmadev.c +6 -3
@@ -746,8 +746,11 @@ test_dmadev_instance(int16_t dev_id) .nb_desc = TEST_RINGSIZE, };const int vchan =0 ; +int ret; -rte_dma_info_get (dev_id, &info); + ret =rte_dma_info_get (dev_id, &info); +if (ret) +ERR_RETURN ("Error with rte_dma_info_get()\n" );printf ("\n### Test dmadev instance %u [%s]\n" , dev_id, info.dev_name);
@@ -761,8 +764,8 @@ test_dmadev_instance(int16_t dev_id)if (rte_dma_vchan_setup (dev_id, vchan, &qconf) <0 )ERR_RETURN ("Error with queue configuration\n" ); -rte_dma_info_get (dev_id, &info); -if (info.nb_vchans !=1 ) + ret =rte_dma_info_get (dev_id, &info); +if (ret || info.nb_vchans !=1 )ERR_RETURN ("Error, no configured queues reported on device id %u\n" , dev_id);if (rte_dma_start (dev_id) !=0 )
Signature · 1 line
2.33.0
Re: [dpdk-dev] [PATCH v2 2/3] app/test: add check for DMA info get API
Quoted 2 lines · Chengwen Feng
This patch add check for
rte_dma_info_get()API.
Quoted 2 lines
Signed-off-by Chengwen Feng <[email protected]>
Thanks for following up.
Quoted 9 lines
--- app/test/test_dmadev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)app/test/test_dmadev.c +0
-0
app/test/test_dmadev.c test_dmadev_instance(int16_t dev_id) · line 752
Quoted 8 lines
app/test/test_dmadev.c +3
-1@@ -746,8 +746,11 @@ test_dmadev_instance(int16_t dev_id) .nb_desc = TEST_RINGSIZE, };const int vchan =0 ; +int ret; -rte_dma_info_get (dev_id, &info); + ret =rte_dma_info_get (dev_id, &info); +if (ret)
Nit: ret != 0
app/test/test_dmadev.c test_dmadev_instance(int16_t dev_id) · line 768
Quoted 12 lines
app/test/test_dmadev.c +3
-2+ERR_RETURN ("Error with rte_dma_info_get()\n" );printf ("\n### Test dmadev instance %u [%s]\n" , dev_id, info.dev_name);@@ -761,8 +764,8 @@ test_dmadev_instance(int16_t dev_id)if (rte_dma_vchan_setup (dev_id, vchan, &qconf) <0 )ERR_RETURN ("Error with queue configuration\n" ); -rte_dma_info_get (dev_id, &info); -if (info.nb_vchans !=1 ) + ret =rte_dma_info_get (dev_id, &info); +if (ret || info.nb_vchans !=1 )
Nit: ret != 0
Quoted 6 lines
app/test/test_dmadev.c +0
-1ERR_RETURN ("Error, no configured queues reported on device id %u\n" , dev_id);if (rte_dma_start (dev_id) !=0 ) --2.33.0
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v2 2/3] app/test: add check for DMA info get API
In reply to Chengwen FengQuoted 7 lines · Chengwen Feng
This patch add check for
rte_dma_info_get()API.Signed-off-by Chengwen Feng <[email protected]>--- app/test/test_dmadev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Walsh, Conor
Acked-byRe: [dpdk-dev] [PATCH v2 2/3] app/test: add check for DMA info get API
Quoted 7 lines
From: Laatz, Kevin <[email protected]>
Sent: Thursday 21 October 2021 15:04
To: Chengwen Feng <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Walsh, Conor <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v2 2/3] app/test: add check for DMA info get API
Quoted 7 lines
Quoted 6 lines · Chengwen Feng
This patch add check for
rte_dma_info_get()API.Signed-off-by Chengwen Feng <[email protected]>--- app/test/test_dmadev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
PATCH v2 3/3 dmadev: fix compile error in debug mode
In reply to Chengwen FengThis patch fix compile error when enable RTE_DMADEV_DEBUG.
--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dmadev/rte_dmadev.h +1 -1
@@ -1126,7 +1126,7 @@ rte_dma_burst_capacity(int16_t dev_id, uint16_t vchan)#ifdef RTE_DMADEV_DEBUG if (!rte_dma_is_valid (dev_id))return 0 ; -RTE_FUNC_PTR_OR_ERR_RET (*obbj->burst_capacity,0 ); +RTE_FUNC_PTR_OR_ERR_RET (*obj->burst_capacity,0 );#endif return (*obj->burst_capacity)(obj->dev_private, vchan); }
Signature · 1 line
2.33.0
Re: [dpdk-dev] [PATCH v2 3/3] dmadev: fix compile error in debug mode
Quoted 6 lines · Chengwen Feng
This patch fix compile error when enable
RTE_DMADEV_DEBUG.Fixes ea8cf0f8536d ("dmadev: add burst capacity API")Signed-off-by Chengwen Feng <[email protected]>
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v2 3/3] dmadev: fix compile error in debug mode
In reply to Chengwen FengQuoted 9 lines · Chengwen Feng
This patch fix compile error when enable
RTE_DMADEV_DEBUG.Fixes ea8cf0f8536d ("dmadev: add burst capacity API")Signed-off-by Chengwen Feng <[email protected]>--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Walsh, Conor
Acked-byRe: [dpdk-dev] [PATCH v2 3/3] dmadev: fix compile error in debug mode
Quoted 7 lines
From: Laatz, Kevin <[email protected]>
Sent: Thursday 21 October 2021 15:04
To: Chengwen Feng <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Walsh, Conor <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v2 3/3] dmadev: fix compile error in debug mode
Quoted 7 lines
Quoted 6 lines · Chengwen Feng
This patch fix compile error when enable
RTE_DMADEV_DEBUG.Fixes ea8cf0f8536d ("dmadev: add burst capacity API")Signed-off-by Chengwen Feng <[email protected]>---
Re: [dpdk-dev] [PATCH v2 3/3] dmadev: fix compile error in debug mode
In reply to Chengwen FengQuoted 6 lines · Chengwen Feng
This patch fix compile error when enable
RTE_DMADEV_DEBUG.Fixes ea8cf0f8536d ("dmadev: add burst capacity API")Signed-off-by Chengwen Feng <[email protected]>
Series applied, thanks.
Signature · 1 line
David Marchand
Quoted 9 lines · Chengwen Feng
From: David Marchand <[email protected]>
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.Signed-off-by David Marchand <[email protected]>Reviewed-by Chengwen Feng <[email protected]>Tested-by Conor Walsh <[email protected]>
Quoted 7 lines
--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)
Quoted 7 lines · Kevin Laatz
Quoted 5 lines · Chengwen Feng
From: David Marchand <[email protected]>
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.
I asked this earlier and was asked to use rte_dma_devices[] array by Kevin. Now that it has been made static is there a different way to get the fp_obj->private_data from a PMD .remove function ?
I need the private data for DMA queue state cleanup.
Quoted 13 lines
Quoted 11 lines
Signed-off-by David Marchand <[email protected]>Reviewed-by Chengwen Feng <[email protected]>Tested-by Conor Walsh <[email protected]>--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)Acked-by Kevin Laatz <[email protected]>
Quoted 5 lines · Radha Mohan
Quoted 4 lines · Kevin Laatz
Quoted 2 lines · Chengwen Feng
From: David Marchand <[email protected]>
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
No need to expose
rte_dma_devicesout of the dmadev library. Existing helpers should be enough, and inlines make use ofrte_dma_fp_objs.I asked this earlier and was asked to use rte_dma_devices[] array by Kevin. Now that it has been made static is there a different way to get the
fp_obj->private_datafrom a PMD .remove function ?
I need the private data for DMA queue state cleanup.
PMD .remove function just call rte_dma_pmd_release() and it's will invoke PMD .dev_close ops:
rte_dma_pmd_release()
--> rte_dma_close()
--> PMD .dev_close opsPMD could implemente cleanup in dev_close ops.
If the PMD want support multi-process, just make sure only the primary could do really cleanup in the dev_close ops.
Quoted 17 lines
Quoted 13 lines
Quoted 5 lines
Signed-off-by David Marchand <[email protected]>Reviewed-by Chengwen Feng <[email protected]>Tested-by Conor Walsh <[email protected]>Quoted 7 lines
--- app/test/test_dmadev.c | 5 +++-- lib/dmadev/rte_dmadev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 -- lib/dmadev/version.map | 1 - 4 files changed, 4 insertions(+), 6 deletions(-)Quoted 1 line
Acked-by Kevin Laatz <[email protected]>.