DPDK usage discussions
 help / color / mirror / Atom feed
From: Antonio Di Bacco <a.dibacco.ks@gmail.com>
To: users@dpdk.org
Subject: MEMIF usage with dpdk-replay
Date: Sun, 20 Mar 2022 16:35:47 +0100
Message-ID: <CAO8pfFnZ4rUaJHFUVC2qsNUAPxGqq6Jhpp8+DNYdzBVh1eFLGw@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2022-03-20 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 15:35 Antonio Di Bacco [this message]
2022-03-20 23:12 ` Dmitry Kozlyuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO8pfFnZ4rUaJHFUVC2qsNUAPxGqq6Jhpp8+DNYdzBVh1eFLGw@mail.gmail.com \
    --to=a.dibacco.ks@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK usage discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git