.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),
struct cmd_bpf_ld_result {
cmdline_fixed_string_t bpf;
cmdline_fixed_string_t dir;
- uint8_t port;
+ uint16_t port;
uint16_t queue;
cmdline_fixed_string_t op;
cmdline_fixed_string_t flags;
*flags = RTE_BPF_ETH_F_NONE;
arg->type = RTE_BPF_ARG_PTR;
- arg->size = mbuf_data_size;
+ arg->size = mbuf_data_size[0];
for (i = 0; str[i] != 0; i++) {
v = toupper(str[i]);
else if (v == 'M') {
arg->type = RTE_BPF_ARG_PTR_MBUF;
arg->size = sizeof(struct rte_mbuf);
- arg->buf_size = mbuf_data_size;
+ arg->buf_size = mbuf_data_size[0];
} else if (v == '-')
continue;
else
- printf("unknown flag: \'%c\'", v);
+ fprintf(stderr, "unknown flag: \'%c\'", v);
}
}
fname, sname, flags);
printf("%d:%s\n", rc, strerror(-rc));
} else
- printf("invalid value: %s\n", res->dir);
+ fprintf(stderr, "invalid value: %s\n", res->dir);
}
-cmdline_parse_token_string_t cmd_load_bpf_start =
+static cmdline_parse_token_string_t cmd_load_bpf_start =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
bpf, "bpf-load");
-cmdline_parse_token_string_t cmd_load_bpf_dir =
+static cmdline_parse_token_string_t cmd_load_bpf_dir =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
dir, "rx#tx");
-cmdline_parse_token_num_t cmd_load_bpf_port =
- TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, port, UINT8);
-cmdline_parse_token_num_t cmd_load_bpf_queue =
- TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, UINT16);
-cmdline_parse_token_string_t cmd_load_bpf_flags =
+static cmdline_parse_token_num_t cmd_load_bpf_port =
+ TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, port, RTE_UINT8);
+static cmdline_parse_token_num_t cmd_load_bpf_queue =
+ TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, RTE_UINT16);
+static cmdline_parse_token_string_t cmd_load_bpf_flags =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
flags, NULL);
-cmdline_parse_token_string_t cmd_load_bpf_prm =
+static cmdline_parse_token_string_t cmd_load_bpf_prm =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
prm, NULL);
struct cmd_bpf_unld_result {
cmdline_fixed_string_t bpf;
cmdline_fixed_string_t dir;
- uint8_t port;
+ uint16_t port;
uint16_t queue;
};
else if (strcmp(res->dir, "tx") == 0)
rte_bpf_eth_tx_unload(res->port, res->queue);
else
- printf("invalid value: %s\n", res->dir);
+ fprintf(stderr, "invalid value: %s\n", res->dir);
}
-cmdline_parse_token_string_t cmd_unload_bpf_start =
+static cmdline_parse_token_string_t cmd_unload_bpf_start =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_unld_result,
bpf, "bpf-unload");
-cmdline_parse_token_string_t cmd_unload_bpf_dir =
+static cmdline_parse_token_string_t cmd_unload_bpf_dir =
TOKEN_STRING_INITIALIZER(struct cmd_bpf_unld_result,
dir, "rx#tx");
-cmdline_parse_token_num_t cmd_unload_bpf_port =
- TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, port, UINT8);
-cmdline_parse_token_num_t cmd_unload_bpf_queue =
- TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, queue, UINT16);
+static cmdline_parse_token_num_t cmd_unload_bpf_port =
+ TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, port, RTE_UINT8);
+static cmdline_parse_token_num_t cmd_unload_bpf_queue =
+ TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, queue, RTE_UINT16);
cmdline_parse_inst_t cmd_operate_bpf_unld_parse = {
.f = cmd_operate_bpf_unld_parsed,