MCPcopy Create free account
hub / github.com/F-Stack/f-stack / l2fwd_crypto_parse_nqueue

Function l2fwd_crypto_parse_nqueue

dpdk/examples/l2fwd-crypto/main.c:1421–1442  ·  view source on GitHub ↗

Parse number of queues */

Source from the content-addressed store, hash-verified

1419
1420/** Parse number of queues */
1421static int
1422l2fwd_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 */
1445static int

Callers 1

l2fwd_crypto_parse_argsFunction · 0.85

Calls 2

strtoulFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected