X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-eventdev%2Ftest_pipeline_common.c;h=12a58fbbfb60eea4ac0745817b49e25ef84fb228;hb=b1c25748ddf5dcec834eed4d1e97068ebe5e2409;hp=b4dbe3769ce34a7df1cc5de353bdb6407d067d58;hpb=8728ccf37615904cf23fb8763895b05c9a3c6b0c;p=dpdk.git diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index b4dbe3769c..12a58fbbfb 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -166,7 +166,7 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues) */ lcores = 2; - if (!rte_eth_dev_count()) { + if (!rte_eth_dev_count_avail()) { evt_err("test needs minimum 1 ethernet dev"); return -1; } @@ -222,8 +222,6 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, - .offloads = DEV_RX_OFFLOAD_CRC_STRIP, - .ignore_offload_bitfield = 1, }, .rx_adv_conf = { .rss_conf = { @@ -234,23 +232,34 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) }; RTE_SET_USED(opt); - if (!rte_eth_dev_count()) { + if (!rte_eth_dev_count_avail()) { evt_err("No ethernet ports found.\n"); return -ENODEV; } RTE_ETH_FOREACH_DEV(i) { struct rte_eth_dev_info dev_info; + struct rte_eth_conf local_port_conf = port_conf; - memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); rte_eth_dev_info_get(i, &dev_info); mt_state = !(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MT_LOCKFREE); rx_conf = dev_info.default_rxconf; rx_conf.offloads = port_conf.rxmode.offloads; + local_port_conf.rx_adv_conf.rss_conf.rss_hf &= + dev_info.flow_type_rss_offloads; + if (local_port_conf.rx_adv_conf.rss_conf.rss_hf != + port_conf.rx_adv_conf.rss_conf.rss_hf) { + evt_info("Port %u modified RSS hash function based on hardware support," + "requested:%#"PRIx64" configured:%#"PRIx64"\n", + i, + port_conf.rx_adv_conf.rss_conf.rss_hf, + local_port_conf.rx_adv_conf.rss_conf.rss_hf); + } + if (rte_eth_dev_configure(i, nb_queues, nb_queues, - &port_conf) + &local_port_conf) < 0) { evt_err("Failed to configure eth port [%d]\n", i); return -EINVAL; @@ -419,7 +428,7 @@ pipeline_event_tx_service_setup(struct evt_test *test, struct evt_options *opt, tx->dev_id = opt->dev_id; tx->queue_id = tx_queue_id; tx->port_id = tx_port_id; - tx->nb_ethports = rte_eth_dev_count(); + tx->nb_ethports = rte_eth_dev_count_avail(); tx->t = t; /* Register Tx service */ @@ -467,7 +476,6 @@ pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt) RTE_ETH_FOREACH_DEV(i) { rte_event_eth_rx_adapter_stop(i); rte_eth_dev_stop(i); - rte_eth_dev_close(i); } }