From patchwork Thu Feb 18 03:06:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xiaoyun" X-Patchwork-Id: 87966 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD8CEA054D; Thu, 18 Feb 2021 04:08:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22F8D40698; Thu, 18 Feb 2021 04:08:57 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C5CF840697; Thu, 18 Feb 2021 04:08:54 +0100 (CET) IronPort-SDR: 9GHLqRkniytmf0ERQzBA8PovQ7owU0jXtqbo5V+ty2dKu0OgSp8hWVWMhESf+2QfJoNNYOsUa6 CNXVd7nyV8cQ== X-IronPort-AV: E=McAfee;i="6000,8403,9898"; a="170519843" X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="170519843" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2021 19:08:53 -0800 IronPort-SDR: JRnzsF+8zt0/VNigjqb3f7Ua8cBslYJwsGQtL5OEVhfCpsvf39wZqwTtbh0x8jSy9YzBFPhpUX un0k7cPmguFQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,185,1610438400"; d="scan'208";a="385544317" Received: from dpdk-xiaoyunl.sh.intel.com ([10.67.111.154]) by fmsmga008.fm.intel.com with ESMTP; 17 Feb 2021 19:08:51 -0800 From: Xiaoyun Li To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Xiaoyun Li , stable@dpdk.org Date: Thu, 18 Feb 2021 11:06:10 +0800 Message-Id: <20210218030610.1277810-1-xiaoyun.li@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] app/testpmd: remove unnecessary tunnel UDP cmd check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- app/test-pmd/cmdline.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 59722d268b..d77958b783 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -9098,7 +9098,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; @@ -9114,9 +9114,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, @@ -9129,9 +9127,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"); @@ -9148,7 +9146,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,