DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] autotests: fix pmd ring
Date: Tue, 15 Mar 2016 13:25:29 +0100	[thread overview]
Message-ID: <1458044729-32694-1-git-send-email-olivier.matz@6wind.com> (raw)

This test expects that a vdev is instanciated on the command
line. If it's not the case, just skip this part.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test/test_pmd_ring.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 5568759..34fea09 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -425,7 +425,7 @@ static int
 test_pmd_ring(void)
 {
 	struct rte_ring *rxtx[NUM_RINGS];
-	int cmdl_port0 = 0;
+	int port, cmdl_port0 = -1;
 	uint8_t nb_ports;
 
 	nb_ports = rte_eth_dev_count();
@@ -501,8 +501,18 @@ test_pmd_ring(void)
 	if (test_pmd_ring_pair_create_attach(rxtx_portd, rxtx_porte) < 0)
 		return -1;
 
-	if (nb_ports > 0) {
-		/* test port 0 created with the --vdev=eth_ring0 command line option */
+	/* find a port created with the --vdev=eth_ring0 command line option */
+	for (port = 0; port < nb_ports; port++) {
+		struct rte_eth_dev_info dev_info;
+
+		rte_eth_dev_info_get(port, &dev_info);
+		if (!strcmp(dev_info.driver_name, "Rings PMD")) {
+			printf("found a command line ring port=%d\n", port);
+			cmdl_port0 = port;
+			break;
+		}
+	}
+	if (cmdl_port0 != -1) {
 		if (test_ethdev_configure_port(cmdl_port0) < 0)
 			return -1;
 		if (test_send_basic_packets_port(cmdl_port0) < 0)
-- 
2.1.4

             reply	other threads:[~2016-03-15 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 12:25 Olivier Matz [this message]
2016-03-24 20:15 ` Thomas Monjalon

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=1458044729-32694-1-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).