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

Function main

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

Source from the content-addressed store, hash-verified

1001}
1002
1003int
1004main(int argc, char **argv)
1005{
1006 /* Rewrite data of src and dst ether addr */
1007 uint8_t rewrite_data[2 * sizeof(struct rte_ether_addr)];
1008 /* Graph initialization. 8< */
1009 static const char * const default_patterns[] = {
1010 "ip4*",
1011 "ethdev_tx-*",
1012 "pkt_drop",
1013 };
1014 uint8_t socketid;
1015 uint16_t nb_rx_queue, queue;
1016 struct rte_graph_param graph_conf;
1017 struct rte_eth_dev_info dev_info;
1018 uint32_t nb_ports, nb_conf = 0;
1019 uint32_t n_tx_queue, nb_lcores;
1020 struct rte_eth_txconf *txconf;
1021 uint16_t queueid, portid, i;
1022 const char **node_patterns;
1023 struct lcore_conf *qconf;
1024 uint16_t nb_graphs = 0;
1025 uint16_t nb_patterns;
1026 uint8_t rewrite_len;
1027 uint32_t lcore_id;
1028 int ret;
1029
1030 /* Init EAL */
1031 ret = rte_eal_init(argc, argv);
1032 if (ret < 0)
1033 rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n");
1034 argc -= ret;
1035 argv += ret;
1036
1037 force_quit = false;
1038 signal(SIGINT, signal_handler);
1039 signal(SIGTERM, signal_handler);
1040
1041 /* Pre-init dst MACs for all ports to 02:00:00:00:00:xx */
1042 for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) {
1043 dest_eth_addr[portid] =
1044 RTE_ETHER_LOCAL_ADMIN_ADDR + ((uint64_t)portid << 40);
1045 *(uint64_t *)(val_eth + portid) = dest_eth_addr[portid];
1046 }
1047
1048 /* Parse application arguments (after the EAL ones) */
1049 ret = parse_args(argc, argv);
1050 if (ret < 0)
1051 rte_exit(EXIT_FAILURE, "Invalid L3FWD_GRAPH parameters\n");
1052
1053 if (check_lcore_params() < 0)
1054 rte_exit(EXIT_FAILURE, "check_lcore_params() failed\n");
1055
1056 if (check_worker_model_params() < 0)
1057 rte_exit(EXIT_FAILURE, "check_worker_model_params() failed\n");
1058
1059 ret = init_lcore_rx_queues();
1060 if (ret < 0)

Callers

nothing calls this directly

Calls 15

rte_exitFunction · 0.85
rte_eth_dev_count_availFunction · 0.85
rte_lcore_countFunction · 0.85
rte_eth_dev_info_getFunction · 0.85
rte_eth_dev_configureFunction · 0.85
rte_eth_macaddr_getFunction · 0.85
rte_ether_addr_copyFunction · 0.85
rte_lcore_is_enabledFunction · 0.85
rte_lcore_to_socket_idFunction · 0.85
rte_eth_tx_queue_setupFunction · 0.85

Tested by

no test coverage detected