- if ((cores & (cores - 1)) != 0 || cores > 16) {
- rte_exit(EXIT_FAILURE,
- "This program can only run on 2,4,8 or 16 cores\n\n");
+ if ((cores & (cores - 1)) != 0 || cores > 128) {
+ rte_exit(EXIT_FAILURE,"This program can only run on an even"
+ "number of cores(1-128)\n\n");
+ }
+
+ nb_ports = rte_eth_dev_count();
+ if (nb_ports > RTE_MAX_ETHPORTS)
+ nb_ports = RTE_MAX_ETHPORTS;
+
+ /*
+ * Update the global var NUM_PORTS and global array PORTS
+ * and get value of var VALID_NUM_PORTS according to system ports number
+ */
+ valid_num_ports = check_ports_num(nb_ports);
+
+ if (valid_num_ports < 2 || valid_num_ports % 2) {
+ printf("Current valid ports number is %u\n", valid_num_ports);
+ rte_exit(EXIT_FAILURE, "Error with valid ports number is not even or less than 2\n");