DPDK usage discussions
 help / color / mirror / Atom feed
* MEMIF usage with dpdk-replay
@ 2022-03-20 15:35 Antonio Di Bacco
  2022-03-20 23:12 ` Dmitry Kozlyuk
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Di Bacco @ 2022-03-20 15:35 UTC (permalink / raw)
  To: users

[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]

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 */
                              &ethconf) < 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, &eth_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");
    }

[-- Attachment #2: Type: text/html, Size: 2481 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-20 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-20 15:35 MEMIF usage with dpdk-replay Antonio Di Bacco
2022-03-20 23:12 ` Dmitry Kozlyuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).