Parse number of queues */
| 1419 | |
| 1420 | /** Parse number of queues */ |
| 1421 | static int |
| 1422 | l2fwd_crypto_parse_nqueue(struct l2fwd_crypto_options *options, |
| 1423 | const char *q_arg) |
| 1424 | { |
| 1425 | char *end = NULL; |
| 1426 | unsigned long n; |
| 1427 | |
| 1428 | /* parse hexadecimal string */ |
| 1429 | n = strtoul(q_arg, &end, 10); |
| 1430 | if ((q_arg[0] == '\0') || (end == NULL) || (*end != '\0')) |
| 1431 | n = 0; |
| 1432 | else if (n >= MAX_RX_QUEUE_PER_LCORE) |
| 1433 | n = 0; |
| 1434 | |
| 1435 | options->nb_ports_per_lcore = n; |
| 1436 | if (options->nb_ports_per_lcore == 0) { |
| 1437 | printf("invalid number of ports selected\n"); |
| 1438 | return -1; |
| 1439 | } |
| 1440 | |
| 1441 | return 0; |
| 1442 | } |
| 1443 | |
| 1444 | /** Parse timer period */ |
| 1445 | static int |
no test coverage detected