DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: remove useless check
@ 2022-10-12 14:29 Yuan Wang
  2022-10-14  9:37 ` Singh, Aman Deep
  0 siblings, 1 reply; 4+ messages in thread
From: Yuan Wang @ 2022-10-12 14:29 UTC (permalink / raw)
  To: Aman Singh, Yuying Zhang; +Cc: dev, xuan.ding, yaqi.tang, Yuan Wang

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 <yuanx.wang@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-17  8:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 14:29 [PATCH] app/testpmd: remove useless check Yuan Wang
2022-10-14  9:37 ` Singh, Aman Deep
2022-10-14  9:52   ` Wang, YuanX
2022-10-17  8:36     ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).