DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Cc: zbigniew.bodek@caviumnetworks.com,
	jerin.jacob@caviumnetworks.com, declan.doherty@intel.com,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] test/crypto: create unique driver name
Date: Tue, 18 Apr 2017 12:39:39 +0100	[thread overview]
Message-ID: <1492515579-130563-2-git-send-email-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <1492515579-130563-1-git-send-email-pablo.de.lara.guarch@intel.com>

Since commit <dda987315ca2> ("vdev: make virtual bus use
its device struct"), rte_eal_vdev_init cannot be called
with same name twice.

If several devices with the same driver are needed
(as in the crypto scheduler test), then driver name argument
has to be unique, concatenating the driver name and an index.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

---

I have tested all PMDs expect for the ARMv8 one, but I assume
it should work as well. Let me know if you see a problem.
---
 test/test/test_cryptodev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index ca7d6df..9f13171 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -7751,14 +7751,17 @@ test_scheduler_attach_slave_op(void)
 	uint8_t sched_id = ts_params->valid_devs[0];
 	uint32_t nb_devs, i, nb_devs_attached = 0;
 	int ret;
+	char vdev_name[32];
 
 	/* create 2 AESNI_MB if necessary */
 	nb_devs = rte_cryptodev_count_devtype(
 			RTE_CRYPTODEV_AESNI_MB_PMD);
 	if (nb_devs < 2) {
 		for (i = nb_devs; i < 2; i++) {
-			ret = rte_eal_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD), NULL);
+			snprintf(vdev_name, sizeof(vdev_name), "%s_%u",
+					RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD),
+					i);
+			ret = rte_eal_vdev_init(vdev_name, NULL);
 
 			TEST_ASSERT(ret == 0,
 				"Failed to create instance %u of"
-- 
2.7.4

  reply	other threads:[~2017-04-18 11:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 11:39 [dpdk-dev] [PATCH 1/2] test/crypto: create only one virtual device if needed Pablo de Lara
2017-04-18 11:39 ` Pablo de Lara [this message]
2017-04-18 13:12   ` [dpdk-dev] [PATCH 2/2] test/crypto: create unique driver name Zhang, Roy Fan
2017-04-18 15:46     ` De Lara Guarch, Pablo
2017-04-18 11:41 ` [dpdk-dev] [PATCH 1/2] test/crypto: create only one virtual device if needed De Lara Guarch, Pablo
2017-04-18 15:46   ` De Lara Guarch, Pablo

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=1492515579-130563-2-git-send-email-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=zbigniew.bodek@caviumnetworks.com \
    /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).