net/ice: update QinQ switch filter handling
[dpdk.git] / app / test-pmd / bpf_cmd.c
index 584fad9..6980291 100644 (file)
@@ -19,12 +19,35 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
        {
                .name = RTE_STR(stdout),
                .type = RTE_BPF_XTYPE_VAR,
-               .var = &stdout,
+               .var = {
+                       .val = (void *)(uintptr_t)&stdout,
+                       .desc = {
+                               .type = RTE_BPF_ARG_PTR,
+                               .size = sizeof(stdout),
+                       },
+               },
        },
        {
                .name = RTE_STR(rte_pktmbuf_dump),
                .type = RTE_BPF_XTYPE_FUNC,
-               .func = (void *)rte_pktmbuf_dump,
+               .func = {
+                       .val = (void *)rte_pktmbuf_dump,
+                       .nb_args = 3,
+                       .args = {
+                               [0] = {
+                                       .type = RTE_BPF_ARG_RAW,
+                                       .size = sizeof(uintptr_t),
+                               },
+                               [1] = {
+                                       .type = RTE_BPF_ARG_PTR_MBUF,
+                                       .size = sizeof(struct rte_mbuf),
+                               },
+                               [2] = {
+                                       .type = RTE_BPF_ARG_RAW,
+                                       .size = sizeof(uint32_t),
+                               },
+                       },
+               },
        },
 };
 
@@ -32,7 +55,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
 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;
@@ -46,7 +69,7 @@ bpf_parse_flags(const char *str, struct rte_bpf_arg *arg, uint32_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]);
@@ -55,7 +78,7 @@ bpf_parse_flags(const char *str, struct rte_bpf_arg *arg, uint32_t *flags)
                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
@@ -64,8 +87,8 @@ bpf_parse_flags(const char *str, struct rte_bpf_arg *arg, uint32_t *flags)
 }
 
 static void cmd_operate_bpf_ld_parsed(void *parsed_result,
-                               __attribute__((unused)) struct cmdline *cl,
-                               __attribute__((unused)) void *data)
+                               __rte_unused struct cmdline *cl,
+                               __rte_unused void *data)
 {
        int32_t rc;
        uint32_t flags;
@@ -101,9 +124,9 @@ 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);
+       TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, port, RTE_UINT8);
 cmdline_parse_token_num_t cmd_load_bpf_queue =
-       TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, UINT16);
+       TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, RTE_UINT16);
 cmdline_parse_token_string_t cmd_load_bpf_flags =
        TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
                        flags, NULL);
@@ -130,13 +153,13 @@ cmdline_parse_inst_t cmd_operate_bpf_ld_parse = {
 struct cmd_bpf_unld_result {
        cmdline_fixed_string_t bpf;
        cmdline_fixed_string_t dir;
-       uint8_t port;
+       uint16_t port;
        uint16_t queue;
 };
 
 static void cmd_operate_bpf_unld_parsed(void *parsed_result,
-                               __attribute__((unused)) struct cmdline *cl,
-                               __attribute__((unused)) void *data)
+                               __rte_unused struct cmdline *cl,
+                               __rte_unused void *data)
 {
        struct cmd_bpf_unld_result *res;
 
@@ -157,9 +180,9 @@ 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);
+       TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, port, RTE_UINT8);
 cmdline_parse_token_num_t cmd_unload_bpf_queue =
-       TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, queue, UINT16);
+       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,