"N.\n");
printf(" --burst=N: set the number of packets per burst to N.\n");
printf(" --flowgen-clones=N: set the number of single packet clones to send in flowgen mode. Should be less than burst value.\n");
+ printf(" --flowgen-flows=N: set the number of flows in flowgen mode to N (1 <= N <= INT32_MAX).\n");
printf(" --mbcache=N: set the cache of mbuf memory pool to N.\n");
printf(" --rxpt=N: set prefetch threshold register of RX rings to N.\n");
printf(" --rxht=N: set the host threshold register of RX rings to N.\n");
break;
if (rte_ether_unformat_addr(buf, &peer_eth_addrs[i]) < 0) {
- printf("Bad MAC address format on line %d\n", i+1);
+ fprintf(stderr, "Bad MAC address format on line %d\n",
+ i + 1);
fclose(config_file);
return -1;
}
{
unsigned int i = 0;
- printf("Invalid socket id, options are: ");
+ fprintf(stderr, "Invalid socket id, options are: ");
for (i = 0; i < num_sockets; i++) {
- printf("%u%s", socket_ids[i],
- (i == num_sockets - 1) ? "\n" : ",");
+ fprintf(stderr, "%u%s", socket_ids[i],
+ (i == num_sockets - 1) ? "\n" : ",");
}
}
}
ring_flag = (uint8_t)int_fld[FLD_FLAG];
if ((ring_flag < RX_RING_ONLY) || (ring_flag > RXTX_RING)) {
- printf("Invalid ring-flag=%d config for port =%d\n",
+ fprintf(stderr,
+ "Invalid ring-flag=%d config for port =%d\n",
ring_flag,port_id);
return -1;
}
txring_numa[port_id] = socket_id;
break;
default:
- printf("Invalid ring-flag=%d config for port=%d\n",
+ fprintf(stderr,
+ "Invalid ring-flag=%d config for port=%d\n",
ring_flag,port_id);
break;
}
case 100:
case 10:
default:
- printf("Unsupported fixed speed\n");
+ fprintf(stderr, "Unsupported fixed speed\n");
return 0;
}
void
launch_args_parse(int argc, char** argv)
{
+#define PARAM_PROC_ID "proc-id"
+#define PARAM_NUM_PROCS "num-procs"
+
int n, opt;
char **argvopt;
int opt_idx;
{ "hairpin-mode", 1, 0, 0 },
{ "burst", 1, 0, 0 },
{ "flowgen-clones", 1, 0, 0 },
+ { "flowgen-flows", 1, 0, 0 },
{ "mbcache", 1, 0, 0 },
{ "txpt", 1, 0, 0 },
{ "txht", 1, 0, 0 },
{ "rx-mq-mode", 1, 0, 0 },
{ "record-core-cycles", 0, 0, 0 },
{ "record-burst-stats", 0, 0, 0 },
+ { PARAM_NUM_PROCS, 1, 0, 0 },
+ { PARAM_PROC_ID, 1, 0, 0 },
{ 0, 0, 0, 0 },
};
rte_exit(EXIT_FAILURE,
"clones must be >= 0 and <= current burst\n");
}
+ if (!strcmp(lgopts[opt_idx].name, "flowgen-flows")) {
+ n = atoi(optarg);
+ if (n > 0)
+ nb_flows_flowgen = (int) n;
+ else
+ rte_exit(EXIT_FAILURE,
+ "flows must be >= 1\n");
+ }
if (!strcmp(lgopts[opt_idx].name, "mbcache")) {
n = atoi(optarg);
if ((n >= 0) &&
record_core_cycles = 1;
if (!strcmp(lgopts[opt_idx].name, "record-burst-stats"))
record_burst_stats = 1;
+ if (!strcmp(lgopts[opt_idx].name, PARAM_NUM_PROCS))
+ num_procs = atoi(optarg);
+ if (!strcmp(lgopts[opt_idx].name, PARAM_PROC_ID))
+ proc_id = atoi(optarg);
break;
case 'h':
usage(argv[0]);
break;
default:
usage(argv[0]);
- printf("Invalid option: %s\n", argv[optind]);
+ fprintf(stderr, "Invalid option: %s\n", argv[optind]);
rte_exit(EXIT_FAILURE,
"Command line is incomplete or incorrect\n");
break;
if (optind != argc) {
usage(argv[0]);
- printf("Invalid parameter: %s\n", argv[optind]);
+ fprintf(stderr, "Invalid parameter: %s\n", argv[optind]);
rte_exit(EXIT_FAILURE, "Command line is incorrect\n");
}