| 328 | #define NB_RX_DESC 128 |
| 329 | #define NB_TX_DESC 512 |
| 330 | int |
| 331 | pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) |
| 332 | { |
| 333 | uint16_t i, j; |
| 334 | int ret; |
| 335 | uint8_t nb_queues = 1; |
| 336 | struct test_pipeline *t = evt_test_priv(test); |
| 337 | struct rte_eth_rxconf rx_conf; |
| 338 | struct rte_eth_conf port_conf = { |
| 339 | .rxmode = { |
| 340 | .mq_mode = RTE_ETH_MQ_RX_RSS, |
| 341 | }, |
| 342 | .rx_adv_conf = { |
| 343 | .rss_conf = { |
| 344 | .rss_key = NULL, |
| 345 | .rss_hf = RTE_ETH_RSS_IP, |
| 346 | }, |
| 347 | }, |
| 348 | }; |
| 349 | |
| 350 | if (!rte_eth_dev_count_avail()) { |
| 351 | evt_err("No ethernet ports found."); |
| 352 | return -ENODEV; |
| 353 | } |
| 354 | |
| 355 | if (opt->max_pkt_sz < RTE_ETHER_MIN_LEN) { |
| 356 | evt_err("max_pkt_sz can not be less than %d", |
| 357 | RTE_ETHER_MIN_LEN); |
| 358 | return -EINVAL; |
| 359 | } |
| 360 | |
| 361 | port_conf.rxmode.mtu = opt->max_pkt_sz - RTE_ETHER_HDR_LEN - |
| 362 | RTE_ETHER_CRC_LEN; |
| 363 | |
| 364 | t->internal_port = 1; |
| 365 | RTE_ETH_FOREACH_DEV(i) { |
| 366 | struct rte_eth_dev_info dev_info; |
| 367 | struct rte_eth_conf local_port_conf = port_conf; |
| 368 | uint32_t caps = 0; |
| 369 | |
| 370 | ret = rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); |
| 371 | if (ret != 0) { |
| 372 | evt_err("failed to get event tx adapter[%d] caps", i); |
| 373 | return ret; |
| 374 | } |
| 375 | |
| 376 | if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) |
| 377 | t->internal_port = 0; |
| 378 | |
| 379 | ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id, i, &caps); |
| 380 | if (ret != 0) { |
| 381 | evt_err("failed to get event tx adapter[%d] caps", i); |
| 382 | return ret; |
| 383 | } |
| 384 | |
| 385 | if (!(caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) |
| 386 | local_port_conf.rxmode.offloads |= |
| 387 | RTE_ETH_RX_OFFLOAD_RSS_HASH; |
nothing calls this directly
no test coverage detected