[v2,5/6] app/testpmd: remove dead code for disabling cmdline library

Message ID 20240314091708.1542769-6-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series testpmd options parsing cleanup |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand March 14, 2024, 9:17 a.m. UTC
  The cmdline library is always enabled with meson.
Remove traces of a time when it may have been possible to disable it.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test-pmd/parameters.c | 19 +------------------
 app/test-pmd/testpmd.c    |  5 +----
 2 files changed, 2 insertions(+), 22 deletions(-)
  

Comments

Ferruh Yigit March 14, 2024, 11:33 a.m. UTC | #1
On 3/14/2024 9:17 AM, David Marchand wrote:
> The cmdline library is always enabled with meson.
> Remove traces of a time when it may have been possible to disable it.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  

Patch

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fc5cf3a195..a69639b6fb 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -45,10 +45,8 @@  usage(char* progname)
 {
 	printf("\nUsage: %s [EAL options] -- [testpmd options]\n\n",
 	       progname);
-#ifdef RTE_LIB_CMDLINE
 	printf("  --interactive: run in interactive mode.\n");
 	printf("  --cmdline-file: execute cli commands before startup.\n");
-#endif
 	printf("  --auto-start: start forwarding on init "
 	       "[always when non-interactive].\n");
 	printf("  --help: display this message and quit.\n");
@@ -95,12 +93,10 @@  usage(char* progname)
 	printf("  --max-pkt-len=N: set the maximum size of packet to N bytes.\n");
 	printf("  --max-lro-pkt-size=N: set the maximum LRO aggregated packet "
 	       "size to N bytes.\n");
-#ifdef RTE_LIB_CMDLINE
 	printf("  --eth-peers-configfile=name: config file with ethernet addresses "
 	       "of peer ports.\n");
 	printf("  --eth-peer=X,M:M:M:M:M:M: set the MAC address of the X peer "
 	       "port (0 <= X < %d).\n", RTE_MAX_ETHPORTS);
-#endif
 	printf("  --disable-crc-strip: disable CRC stripping by hardware.\n");
 	printf("  --enable-scatter: enable scattered Rx.\n");
 	printf("  --enable-lro: enable large receive offload.\n");
@@ -210,7 +206,6 @@  usage(char* progname)
 	       "    0x01 - hairpin ports loop, 0x00 - hairpin port self\n");
 }
 
-#ifdef RTE_LIB_CMDLINE
 static int
 init_peer_eth_addrs(const char *config_filename)
 {
@@ -240,7 +235,6 @@  init_peer_eth_addrs(const char *config_filename)
 	nb_peer_eth_addrs = (portid_t) i;
 	return 0;
 }
-#endif
 
 /*
  * Parse the coremask given as argument (hexadecimal string) and set
@@ -610,13 +604,11 @@  launch_args_parse(int argc, char** argv)
 
 	static struct option lgopts[] = {
 		{ "help",			0, 0, 0 },
-#ifdef RTE_LIB_CMDLINE
 		{ "interactive",		0, 0, 0 },
 		{ "cmdline-file",		1, 0, 0 },
 		{ "auto-start",			0, 0, 0 },
 		{ "eth-peers-configfile",	1, 0, 0 },
 		{ "eth-peer",			1, 0, 0 },
-#endif
 		{ "tx-first",			0, 0, 0 },
 		{ "stats-period",		1, 0, 0 },
 		{ "display-xstats",		1, 0, 0 },
@@ -725,20 +717,13 @@  launch_args_parse(int argc, char** argv)
 
 	argvopt = argv;
 
-#ifdef RTE_LIB_CMDLINE
-#define SHORTOPTS "i"
-#else
-#define SHORTOPTS ""
-#endif
-	while ((opt = getopt_long(argc, argvopt, SHORTOPTS "ah",
+	while ((opt = getopt_long(argc, argvopt, "iah",
 				 lgopts, &opt_idx)) != EOF) {
 		switch (opt) {
-#ifdef RTE_LIB_CMDLINE
 		case 'i':
 			printf("Interactive-mode selected\n");
 			interactive = 1;
 			break;
-#endif
 		case 'a':
 			printf("Auto-start selected\n");
 			auto_start = 1;
@@ -749,7 +734,6 @@  launch_args_parse(int argc, char** argv)
 				usage(argv[0]);
 				exit(EXIT_SUCCESS);
 			}
-#ifdef RTE_LIB_CMDLINE
 			if (!strcmp(lgopts[opt_idx].name, "interactive")) {
 				printf("Interactive-mode selected\n");
 				interactive = 1;
@@ -817,7 +801,6 @@  launch_args_parse(int argc, char** argv)
 						 port_end);
 				nb_peer_eth_addrs++;
 			}
-#endif
 			if (!strcmp(lgopts[opt_idx].name, "tx-ip")) {
 				struct in_addr in;
 				char *end;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 81d905d759..70ea257fda 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4700,7 +4700,6 @@  main(int argc, char** argv)
 	if (record_core_cycles)
 		rte_lcore_register_usage_cb(lcore_usage_callback);
 
-#ifdef RTE_LIB_CMDLINE
 	if (init_cmdline() != 0)
 		rte_exit(EXIT_FAILURE,
 			"Could not initialise cmdline context.\n");
@@ -4714,9 +4713,7 @@  main(int argc, char** argv)
 			start_packet_forwarding(0);
 		}
 		prompt();
-	} else
-#endif
-	{
+	} else {
 		printf("No commandline core given, start packet forwarding\n");
 		start_packet_forwarding(tx_first);
 		if (stats_period != 0) {