diff mbox

[2/2] example: switch: set minimum interface count to two

Message ID 1461750759-21543-2-git-send-email-matias.elo@nokia.com
State Accepted
Commit 82e53ace8175b2a9dd2073a002b0fd882a19e1bb
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) April 27, 2016, 9:52 a.m. UTC
There is no use for a switch with a single interface.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
---
 example/switch/odp_switch.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/example/switch/odp_switch.c b/example/switch/odp_switch.c
index b0e5b91..96229ff 100644
--- a/example/switch/odp_switch.c
+++ b/example/switch/odp_switch.c
@@ -717,7 +717,7 @@  static void usage(char *progname)
 	       "\n"
 	       "Mandatory OPTIONS:\n"
 	       "  -i, --interface Eth interfaces (comma-separated, no spaces)\n"
-	       "                  Interface count min 1, max %i\n"
+	       "                  Interface count min 2, max %i\n"
 	       "\n"
 	       "Optional OPTIONS:\n"
 	       "  -c, --count <number> CPU count.\n"
@@ -800,7 +800,7 @@  static void parse_args(int argc, char *argv[], appl_args_t *appl_args)
 
 			appl_args->if_count = i;
 
-			if (appl_args->if_count < 1 ||
+			if (appl_args->if_count < 2 ||
 			    appl_args->if_count > MAX_PKTIOS) {
 				usage(argv[0]);
 				exit(EXIT_FAILURE);
@@ -892,7 +892,6 @@  int main(int argc, char **argv)
 	odp_instance_t instance;
 	odph_linux_thr_params_t thr_params;
 
-
 	/* Init ODP before calling anything else */
 	if (odp_init_global(&instance, NULL, NULL)) {
 		printf("Error: ODP global init failed.\n");