X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Fsample_packet_forward.c;h=aa897274d851d98c17380d4bac7b131c5315f905;hb=a2dfcd1ff609f5a4fd3b65774618a35c5c9f73c6;hp=61384b3d9bdb50823d6e5e82ae0f99839bf21087;hpb=a9de470cc7c0649221e156fc5f30a2dbdfe7c166;p=dpdk.git diff --git a/app/test/sample_packet_forward.c b/app/test/sample_packet_forward.c index 61384b3d9b..aa897274d8 100644 --- a/app/test/sample_packet_forward.c +++ b/app/test/sample_packet_forward.c @@ -15,6 +15,35 @@ #include "sample_packet_forward.h" +/* + * heper function: configure and start test device + */ +int +test_dev_start(uint16_t port, struct rte_mempool *mp) +{ + int32_t rc; + struct rte_eth_conf pconf; + + memset(&pconf, 0, sizeof(pconf)); + + rc = rte_eth_dev_configure(port, NUM_QUEUES, NUM_QUEUES, &pconf); + if (rc != 0) + return rc; + + rc = rte_eth_rx_queue_setup(port, 0, RING_SIZE, SOCKET_ID_ANY, + NULL, mp); + if (rc != 0) + return rc; + + rc = rte_eth_tx_queue_setup(port, 0, RING_SIZE, SOCKET_ID_ANY, + NULL); + if (rc != 0) + return rc; + + rc = rte_eth_dev_start(port); + return rc; +} + /* Sample test to create virtual rings and tx,rx portid from rings */ int test_ring_setup(struct rte_ring **ring, uint16_t *portid)