| 1215 | } |
| 1216 | |
| 1217 | static void |
| 1218 | l3fwd_poll_resource_setup(void) |
| 1219 | { |
| 1220 | uint8_t socketid; |
| 1221 | uint16_t nb_rx_queue, queue; |
| 1222 | struct rte_eth_dev_info dev_info; |
| 1223 | uint32_t n_tx_queue, nb_lcores; |
| 1224 | struct rte_eth_txconf *txconf; |
| 1225 | struct lcore_conf *qconf; |
| 1226 | uint16_t queueid, portid; |
| 1227 | unsigned int nb_ports; |
| 1228 | unsigned int lcore_id; |
| 1229 | int ret; |
| 1230 | |
| 1231 | if (check_lcore_params() < 0) |
| 1232 | rte_exit(EXIT_FAILURE, "check_lcore_params failed\n"); |
| 1233 | |
| 1234 | ret = init_lcore_rx_queues(); |
| 1235 | if (ret < 0) |
| 1236 | rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n"); |
| 1237 | |
| 1238 | nb_ports = rte_eth_dev_count_avail(); |
| 1239 | |
| 1240 | if (check_port_config() < 0) |
| 1241 | rte_exit(EXIT_FAILURE, "check_port_config failed\n"); |
| 1242 | |
| 1243 | nb_lcores = rte_lcore_count(); |
| 1244 | |
| 1245 | /* initialize all ports */ |
| 1246 | RTE_ETH_FOREACH_DEV(portid) { |
| 1247 | struct rte_eth_conf local_port_conf = port_conf; |
| 1248 | |
| 1249 | /* skip ports that are not enabled */ |
| 1250 | if ((enabled_port_mask & (1 << portid)) == 0) { |
| 1251 | printf("\nSkipping disabled port %d\n", portid); |
| 1252 | continue; |
| 1253 | } |
| 1254 | |
| 1255 | /* init port */ |
| 1256 | printf("Initializing port %d ... ", portid ); |
| 1257 | fflush(stdout); |
| 1258 | |
| 1259 | nb_rx_queue = get_port_n_rx_queues(portid); |
| 1260 | n_tx_queue = nb_lcores; |
| 1261 | if (n_tx_queue > MAX_TX_QUEUE_PER_PORT) |
| 1262 | n_tx_queue = MAX_TX_QUEUE_PER_PORT; |
| 1263 | printf("Creating queues: nb_rxq=%d nb_txq=%u... ", |
| 1264 | nb_rx_queue, (unsigned)n_tx_queue ); |
| 1265 | |
| 1266 | ret = rte_eth_dev_info_get(portid, &dev_info); |
| 1267 | if (ret != 0) |
| 1268 | rte_exit(EXIT_FAILURE, |
| 1269 | "Error during getting device (port %u) info: %s\n", |
| 1270 | portid, strerror(-ret)); |
| 1271 | |
| 1272 | ret = config_port_max_pkt_len(&local_port_conf, &dev_info); |
| 1273 | if (ret != 0) |
| 1274 | rte_exit(EXIT_FAILURE, |
no test coverage detected