DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] gpu/cuda: set unused gdrcopy functions arguments
@ 2022-03-10  0:06 eagostini
  2022-03-10 20:23 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: eagostini @ 2022-03-10  0:06 UTC (permalink / raw)
  To: dev; +Cc: Elena Agostini

From: Elena Agostini <eagostini@nvidia.com>

Without enabling gdrcopy, dpdk build has warnings about
unused gdrcopy functions input parameters.

This patch set them to __rte_unused .

Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
 drivers/gpu/cuda/gdrcopy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/cuda/gdrcopy.c b/drivers/gpu/cuda/gdrcopy.c
index 96e768b97b..3126d246eb 100644
--- a/drivers/gpu/cuda/gdrcopy.c
+++ b/drivers/gpu/cuda/gdrcopy.c
@@ -80,7 +80,7 @@ gdrcopy_open(gdr_t *g)
 #endif
 
 int
-gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t size, void **h_addr)
+gdrcopy_pin(__rte_unused gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, __rte_unused uint64_t d_addr, __rte_unused size_t size, __rte_unused void **h_addr)
 {
 #ifdef DRIVERS_GPU_CUDA_GDRCOPY_H
 	if (*gdrc_h == NULL) {
@@ -116,7 +116,7 @@ gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t si
 }
 
 int
-gdrcopy_unpin(gdr_t gdrc_h, __rte_unused gdr_mh_t mh, void *d_addr, size_t size)
+gdrcopy_unpin(gdr_t gdrc_h, __rte_unused gdr_mh_t mh, __rte_unused void *d_addr, __rte_unused size_t size)
 {
 	if (gdrc_h == NULL)
 		return -EINVAL;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] gpu/cuda: set unused gdrcopy functions arguments
  2022-03-10  0:06 [PATCH v1] gpu/cuda: set unused gdrcopy functions arguments eagostini
@ 2022-03-10 20:23 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2022-03-10 20:23 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev

10/03/2022 01:06, eagostini@nvidia.com:
> From: Elena Agostini <eagostini@nvidia.com>
> 
> Without enabling gdrcopy, dpdk build has warnings about
> unused gdrcopy functions input parameters.

As developers we should test with --werror option given to meson,
so we don't miss such details.
This is what the script devtools/test-meson-builds.sh does.

> This patch set them to __rte_unused .
> 
> Fixes: 24c7759 ("gpu/cuda: map GPU memory with GDRCopy")

Let's keep this casing of GDRCopy in the new title.

> Signed-off-by: Elena Agostini <eagostini@nvidia.com>
> ---
>  int
> -gdrcopy_pin(gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, uint64_t d_addr, size_t size, void **h_addr)
> +gdrcopy_pin(__rte_unused gdr_t *gdrc_h, __rte_unused gdr_mh_t *mh, __rte_unused uint64_t d_addr, __rte_unused size_t size, __rte_unused void **h_addr)

While at it, break the too long line.

It seems my compiler is smart enough to not require the unused attribute
for parameters used in another branch of #ifdef.
But it is probably required for some old compilers.

Applied, thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-10 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10  0:06 [PATCH v1] gpu/cuda: set unused gdrcopy functions arguments eagostini
2022-03-10 20:23 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).