From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24752A00C2; Wed, 12 Oct 2022 08:43:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C121F42BF0; Wed, 12 Oct 2022 08:43:31 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 5BA7340691 for ; Wed, 12 Oct 2022 08:43:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665557010; x=1697093010; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=k8/M5UFGRtTHHPCTnzQmaHHHF3haEub1zdIadMXfaEA=; b=eBs+BCuQl2a3A7hXsr2yeQAhgW9bgppPtiJ80jDoMCV92qXWEDcfkNhq Sp5QzY4O9XGySO8k4Kky97ux0H2CgNSK/0pUt69MshiIlRUqhMLtULSdy 5dblkJlBhvl59isn4Q5ZnAH6r6tqDvv+Y644zEdwRCMR2FDJVn9x8f0UF 5k2nLJwf/tiWF6SiKaReX8Ts9B7rigO3wTprOFuc4Gr1+WvNU7itptf+U VBBEyfQfb9RZmuzvD3vkhuZ9VpdpS7O0TMOrLG7YA8+Q8ANauZs1aH0nk DVqPMioYZF2e6y9l6GAYSIxjJzGLMnzlI9NhF/11gAwwBTp5gapzJ3SBa A==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="303454283" X-IronPort-AV: E=Sophos;i="5.95,178,1661842800"; d="scan'208";a="303454283" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 23:43:29 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="689546047" X-IronPort-AV: E=Sophos;i="5.95,178,1661842800"; d="scan'208";a="689546047" Received: from unknown (HELO localhost.localdomain) ([10.239.252.55]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 23:43:27 -0700 From: Yuan Wang To: Aman Singh , Yuying Zhang Cc: dev@dpdk.org, xuan.ding@intel.com, yaqi.tang@intel.com, Yuan Wang Subject: [PATCH] app/testpmd: remove useless check Date: Wed, 12 Oct 2022 22:29:15 +0800 Message-Id: <20221012142915.553392-1-yuanx.wang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Protocol header sequence checking is supported in the ethdev library, the application does not need to do it again. Coverity issue: 381396 Fixes: 52e2e7edcf48 ("app/testpmd: add protocol-based buffer split") Signed-off-by: Yuan Wang --- app/test-pmd/cmdline.c | 6 ++---- app/test-pmd/parameters.c | 2 +- app/test-pmd/testpmd.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 17be2de402..29e4b2329b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3440,7 +3440,7 @@ get_ptype(char *value) unsigned int parse_hdrs_list(const char *str, const char *item_name, unsigned int max_items, - unsigned int *parsed_items, int check_hdrs_sequence) + unsigned int *parsed_items) { unsigned int nb_item; char *cur; @@ -3462,8 +3462,6 @@ parse_hdrs_list(const char *str, const char *item_name, unsigned int max_items, fprintf(stderr, "Number of %s = %u > %u (maximum items)\n", item_name, nb_item + 1, max_items); free(str2); - if (!check_hdrs_sequence) - return nb_item; return nb_item; } @@ -3854,7 +3852,7 @@ cmd_set_rxhdrs_parsed(void *parsed_result, res = parsed_result; nb_segs = parse_hdrs_list(res->values, "segment hdrs", - MAX_SEGS_BUFFER_SPLIT, seg_hdrs, 0); + MAX_SEGS_BUFFER_SPLIT, seg_hdrs); if (nb_segs > 0) set_rx_pkt_hdrs(seg_hdrs, nb_segs); cmd_reconfig_device_queue(RTE_PORT_ALL, 0, 1); diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index ff760460ec..5b305c833c 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -1272,7 +1272,7 @@ launch_args_parse(int argc, char** argv) nb_segs = parse_hdrs_list (optarg, "rxpkt segments", MAX_SEGS_BUFFER_SPLIT, - seg_hdrs, 0); + seg_hdrs); if (nb_segs > 0) set_rx_pkt_hdrs(seg_hdrs, nb_segs); else diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e65be323b8..0b99339df8 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -854,7 +854,7 @@ unsigned int parse_item_list(const char *str, const char *item_name, unsigned int *parsed_items, int check_unique_values); unsigned int parse_hdrs_list(const char *str, const char *item_name, unsigned int max_item, - unsigned int *parsed_items, int check_unique_values); + unsigned int *parsed_items); void launch_args_parse(int argc, char** argv); void cmd_reconfig_device_queue(portid_t id, uint8_t dev, uint8_t queue); void cmdline_read_from_file(const char *filename); -- 2.25.1