From: Xiaoyun Li Date: Thu, 18 Feb 2021 03:06:10 +0000 (+0800) Subject: app/testpmd: remove unnecessary UDP tunnel check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9d32f448ea0096185d0bbc5582c8b57f090c88a6;p=dpdk.git app/testpmd: remove unnecessary UDP tunnel check cmd_tunnel_udp_config checked 'cmd' to set prot_type but this cmd is only for rx_vxlan_port. The unnecessary cmd check will cause uninit coverity issue. So remove it and rename 'cmd' to 'rx_vxlan_port'. Coverity issue: 366155 Fixes: bd948f20d609 ("app/testpmd: VXLAN packet identification") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li Acked-by: Ferruh Yigit --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 65d03b0ffb..14110eb2e4 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -9097,7 +9097,7 @@ cmdline_parse_inst_t cmd_vf_rate_limit = { /* *** CONFIGURE TUNNEL UDP PORT *** */ struct cmd_tunnel_udp_config { - cmdline_fixed_string_t cmd; + cmdline_fixed_string_t rx_vxlan_port; cmdline_fixed_string_t what; uint16_t udp_port; portid_t port_id; @@ -9113,9 +9113,7 @@ cmd_tunnel_udp_config_parsed(void *parsed_result, int ret; tunnel_udp.udp_port = res->udp_port; - - if (!strcmp(res->cmd, "rx_vxlan_port")) - tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; + tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; if (!strcmp(res->what, "add")) ret = rte_eth_dev_udp_tunnel_port_add(res->port_id, @@ -9128,9 +9126,9 @@ cmd_tunnel_udp_config_parsed(void *parsed_result, printf("udp tunneling add error: (%s)\n", strerror(-ret)); } -cmdline_parse_token_string_t cmd_tunnel_udp_config_cmd = +cmdline_parse_token_string_t cmd_tunnel_udp_config_rx_vxlan_port = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_udp_config, - cmd, "rx_vxlan_port"); + rx_vxlan_port, "rx_vxlan_port"); cmdline_parse_token_string_t cmd_tunnel_udp_config_what = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_udp_config, what, "add#rm"); @@ -9147,7 +9145,7 @@ cmdline_parse_inst_t cmd_tunnel_udp_config = { .help_str = "rx_vxlan_port add|rm : " "Add/Remove a tunneling UDP port filter", .tokens = { - (void *)&cmd_tunnel_udp_config_cmd, + (void *)&cmd_tunnel_udp_config_rx_vxlan_port, (void *)&cmd_tunnel_udp_config_what, (void *)&cmd_tunnel_udp_config_udp_port, (void *)&cmd_tunnel_udp_config_port_id,