[v4,1/8] app/testpmd: fix uint build error with musl libc
diff mbox series

Message ID 20201105211716.25181-2-ncopa@alpinelinux.org
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • [v4,1/8] app/testpmd: fix uint build error with musl libc
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Natanael Copa Nov. 5, 2020, 9:17 p.m. UTC
Improve portability by avoid use non-standard 'uint'.

Use uint8_t for hash_key_len as rss_key_len is a uint8_t type.

This solves following build error when building with musl libc:

In file included from ../app/test-pmd/cmdline.c:74:
../app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint'; did
you mean 'int'?
  813 |          uint8_t *hash_key, uint hash_key_len);
      |                             ^~~~
      |                             int

Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands")
Cc: stable@dpdk.org

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 app/test-pmd/config.c  | 2 +-
 app/test-pmd/testpmd.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Morten Brørup Nov. 6, 2020, 9:22 a.m. UTC | #1
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Natanael Copa
> Sent: Thursday, November 5, 2020 10:17 PM
> 
> Improve portability by avoid use non-standard 'uint'.
> 
> Use uint8_t for hash_key_len as rss_key_len is a uint8_t type.
> 
> This solves following build error when building with musl libc:
> 
> In file included from ../app/test-pmd/cmdline.c:74:
> ../app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint'; did
> you mean 'int'?
>   813 |          uint8_t *hash_key, uint hash_key_len);
>       |                             ^~~~
>       |                             int
> 
> Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash
> commands")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> ---
>  app/test-pmd/config.c  | 2 +-
>  app/test-pmd/testpmd.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 755d1dfc9..8ec091077 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -3015,7 +3015,7 @@ port_rss_hash_conf_show(portid_t port_id, int
> show_rss_key)
> 
>  void
>  port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t
> *hash_key,
> -			 uint hash_key_len)
> +			 uint8_t hash_key_len)
>  {
>  	struct rte_eth_rss_conf rss_conf;
>  	int diag;
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 519d5517e..1cb6a6d04 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -945,7 +945,7 @@ int set_vf_rate_limit(portid_t port_id, uint16_t
> vf, uint16_t rate,
> 
>  void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
>  void port_rss_hash_key_update(portid_t port_id, char rss_type[],
> -			      uint8_t *hash_key, uint hash_key_len);
> +			      uint8_t *hash_key, uint8_t hash_key_len);
>  int rx_queue_id_is_invalid(queueid_t rxq_id);
>  int tx_queue_id_is_invalid(queueid_t txq_id);
>  void setup_gro(const char *onoff, portid_t port_id);
> --
> 2.29.2
> 

Ethdev RSS hash key length is uint8_t, so this patch is correct not using unsigned int as replacement.

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>

Patch
diff mbox series

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 755d1dfc9..8ec091077 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3015,7 +3015,7 @@  port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 
 void
 port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
-			 uint hash_key_len)
+			 uint8_t hash_key_len)
 {
 	struct rte_eth_rss_conf rss_conf;
 	int diag;
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 519d5517e..1cb6a6d04 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -945,7 +945,7 @@  int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
 
 void port_rss_hash_conf_show(portid_t port_id, int show_rss_key);
 void port_rss_hash_key_update(portid_t port_id, char rss_type[],
-			      uint8_t *hash_key, uint hash_key_len);
+			      uint8_t *hash_key, uint8_t hash_key_len);
 int rx_queue_id_is_invalid(queueid_t rxq_id);
 int tx_queue_id_is_invalid(queueid_t txq_id);
 void setup_gro(const char *onoff, portid_t port_id);