Skip to content

Commit

Permalink
app/testpmd: fix build with musl
Browse files Browse the repository at this point in the history
[ upstream commit 3529e8f ]

1/ Improve portability by avoiding use of 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:
    app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint'

2/ In musl libc, stdout is of type (FILE * const).
Because of the const qualifier, a dark magic cast
must be achieved through uintptr_t.

Fixes: 8205e24 ("app/testpmd: add missing type to RSS hash commands")
Fixes: e977e41 ("app/testpmd: add commands to load/unload BPF filters")

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
ncopa authored and steevenlee committed May 8, 2021
1 parent 0999e13 commit ba7c3d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/test-pmd/bpf_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
.name = RTE_STR(stdout),
.type = RTE_BPF_XTYPE_VAR,
.var = {
.val = &stdout,
.val = (void *)(uintptr_t)&stdout,
.desc = {
.type = RTE_BPF_ARG_PTR,
.size = sizeof(stdout),
Expand Down
2 changes: 1 addition & 1 deletion app/test-pmd/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,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;
Expand Down
2 changes: 1 addition & 1 deletion app/test-pmd/testpmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,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);
Expand Down

0 comments on commit ba7c3d6

Please sign in to comment.