X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Ftxonly.c;h=aed820f5d3403382b0c5be4d8e8fb1e8ed035dfa;hb=0a0821bcf312;hp=d55ee7ca00b8cb2117bc731b8a83e087295d495f;hpb=5ffc4a2acadad427f2f9ddf8e072632764ad2d47;p=dpdk.git diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index d55ee7ca00..aed820f5d3 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -266,9 +266,21 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, if (unlikely(timestamp_init_req != RTE_PER_LCORE(timestamp_idone))) { - struct rte_eth_dev *dev = &rte_eth_devices[fs->tx_port]; - unsigned int txqs_n = dev->data->nb_tx_queues; - uint64_t phase = tx_pkt_times_inter * fs->tx_queue / + struct rte_eth_dev_info dev_info; + unsigned int txqs_n; + uint64_t phase; + int ret; + + ret = eth_dev_info_get_print_err(fs->tx_port, &dev_info); + if (ret != 0) { + TESTPMD_LOG(ERR, + "Failed to get device info for port %d," + "could not finish timestamp init", + fs->tx_port); + return false; + } + txqs_n = dev_info.nb_tx_queues; + phase = tx_pkt_times_inter * fs->tx_queue / (txqs_n ? txqs_n : 1); /* * Initialize the scheduling time phase shift