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

Function parse_queue_size

dpdk/examples/l3fwd/main.c:588–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588static void
589parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
590{
591 char *end = NULL;
592 unsigned long value;
593
594 /* parse decimal string */
595 value = strtoul(queue_size_arg, &end, 10);
596 if ((queue_size_arg[0] == '\0') || (end == NULL) ||
597 (*end != '\0') || (value == 0)) {
598 if (rx == 1)
599 rte_exit(EXIT_FAILURE, "Invalid rx-queue-size\n");
600 else
601 rte_exit(EXIT_FAILURE, "Invalid tx-queue-size\n");
602
603 return;
604 }
605
606 if (value > UINT16_MAX) {
607 if (rx == 1)
608 rte_exit(EXIT_FAILURE, "rx-queue-size %lu > %d\n",
609 value, UINT16_MAX);
610 else
611 rte_exit(EXIT_FAILURE, "tx-queue-size %lu > %d\n",
612 value, UINT16_MAX);
613
614 return;
615 }
616
617 *queue_size = value;
618}
619
620#ifdef RTE_LIB_EVENTDEV
621static void

Callers 1

parse_argsFunction · 0.85

Calls 2

strtoulFunction · 0.85
rte_exitFunction · 0.85

Tested by

no test coverage detected