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

Function parse_eth_dest

dpdk/examples/l3fwd-graph/main.c:463–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static void
464parse_eth_dest(const char *optarg)
465{
466 uint8_t c, *dest, peer_addr[6];
467 uint16_t portid;
468 char *port_end;
469
470 errno = 0;
471 portid = strtoul(optarg, &port_end, 10);
472 if (errno != 0 || port_end == optarg || *port_end++ != ',')
473 rte_exit(EXIT_FAILURE, "Invalid eth-dest: %s", optarg);
474 if (portid >= RTE_MAX_ETHPORTS)
475 rte_exit(EXIT_FAILURE,
476 "eth-dest: port %d >= RTE_MAX_ETHPORTS(%d)\n", portid,
477 RTE_MAX_ETHPORTS);
478
479 if (cmdline_parse_etheraddr(NULL, port_end, &peer_addr,
480 sizeof(peer_addr)) < 0)
481 rte_exit(EXIT_FAILURE, "Invalid ethernet address: %s\n",
482 port_end);
483 dest = (uint8_t *)&dest_eth_addr[portid];
484 for (c = 0; c < 6; c++)
485 dest[c] = peer_addr[c];
486 *(uint64_t *)(val_eth + portid) = dest_eth_addr[portid];
487}
488
489#define MAX_JUMBO_PKT_LEN 9600
490#define MEMPOOL_CACHE_SIZE 256

Callers 1

parse_argsFunction · 0.70

Calls 3

strtoulFunction · 0.85
rte_exitFunction · 0.85
cmdline_parse_etheraddrFunction · 0.85

Tested by

no test coverage detected