[v3,01/15] app/testpmd: replace uint with unsigned int

Message ID 20190313170657.16688-2-ncopa@alpinelinux.org
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Build fixes for musl libc
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Natanael Copa March 13, 2019, 5:06 p.m.
Improve portability by avoid use non-standard 'uint'.

This fixes following build error when building with musl libc:

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

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 app/test-pmd/testpmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bernard Iremonger March 26, 2019, 4:59 p.m. | #1
Hi Nataneal,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Natanael Copa
> Sent: Wednesday, March 13, 2019 5:07 PM
> To: dev@dpdk.org
> Cc: Natanael Copa <ncopa@alpinelinux.org>
> Subject: [dpdk-dev] [PATCH v3 01/15] app/testpmd: replace uint with
> unsigned int

This should have the fix keyword in the commit line and a fixes line should be added.
Suggest something like the following:

" app/testpmd: fix build error with musl libc"
 
> Improve portability by avoid use non-standard 'uint'.
> 
> This fixes following build error when building with musl libc:
> 
> In file included from ../app/test-pmd/cmdline.c:75:
> ../app/test-pmd/testpmd.h:809:29: error: unknown type name 'uint'; did you
> mean 'int'?
>           uint8_t *hash_key, uint hash_key_len);
>                              ^~~~
>                              int
> 

./dpdk /devtools/check-git-log.sh -1
Line too long:
        ../app/test-pmd/testpmd.h:809:29: error: unknown type name 'uint'; did you mean 'int'?
Wrong tag:
        This fixes following build error when building with musl libc:

Need to wrap the compile error message to pass the check-git-log.sh checks.

> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> ---
>  app/test-pmd/testpmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index
> fa4887853..84ef3fc30 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -806,7 +806,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);

uint should be replaced by uint8_t instead of unsigned int.
The  rss_key_len is a uint8_t type.

> +			      uint8_t *hash_key, unsigned int 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.21.0

Regards,

Bernard.
Thomas Monjalon March 30, 2019, 10:17 p.m. | #2
13/03/2019 18:06, Natanael Copa:
> Improve portability by avoid use non-standard 'uint'.

After running git grep '\<uint\>', I see there is also an occurence
in examples/tep_termination/vxlan.c

Patch

diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index fa4887853..84ef3fc30 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -806,7 +806,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, unsigned int 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);