MEMIF usage with dpdk-replay
Antonio Di Bacco
a.dibacco.ks at gmail.com
Sun Mar 20 16:35:47 CET 2022
I'm using a dpdk-replay application (that reads from pcap and sends to a
port) and I'm passing the parameter --vdev net_memif in order that the
application sends packets to the memif PMD interface. Before launching
dpdk-replay I launch the testpmd like this:
dpdk-testpmd -l 4-5 --proc-type=primary --file-prefix=pmd1 --vdev=net_memif
The dpdk-replay is using the following code to start the port but
unfortunately the link status is always down and rte_eth_tx_burst doesn't
send anything.
/* Configure for each port (ethernet device), the number of rx queues &
tx queues */
if (rte_eth_dev_configure(port,
0, /* nb rx queue */
NB_TX_QUEUES, /* nb tx queue */
ðconf) < 0) {
fprintf(stderr, "DPDK: RTE ETH Ethernet device configuration
failed\n");
return (-1);
}
/* Then allocate and set up the transmit queues for this Ethernet
device */
for (i = 0; i < NB_TX_QUEUES; i++) {
ret = rte_eth_tx_queue_setup(port,
i,
TX_QUEUE_SIZE,
cpus->numacore,
&txconf);
if (ret < 0) {
fprintf(stderr, "DPDK: RTE ETH Ethernet device tx queue %i
setup failed: %s",
i, strerror(-ret));
return (ret);
}
}
/* Start the ethernet device */
if (rte_eth_dev_start(port) < 0) {
fprintf(stderr, "DPDK: RTE ETH Ethernet device start failed\n");
return (-1);
}
/* Get link status and display it. */
rte_eth_link_get(port, ð_link);
if (eth_link.link_status) {
printf(" Link up - speed %u Mbps - %s\n",
eth_link.link_speed,
(eth_link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
"full-duplex" : "half-duplex\n");
} else {
printf("Link down\n");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20220320/a4fd49ce/attachment.htm>
More information about the users
mailing list