From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6AA152BBE for ; Tue, 18 Apr 2017 13:39:56 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2017 04:39:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,219,1488873600"; d="scan'208";a="1157478548" Received: from silpixa00381631.ir.intel.com (HELO silpixa00381631.ger.corp.intel.com) ([10.237.222.122]) by fmsmga002.fm.intel.com with ESMTP; 18 Apr 2017 04:39:51 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: zbigniew.bodek@caviumnetworks.com, jerin.jacob@caviumnetworks.com, declan.doherty@intel.com, Pablo de Lara Date: Tue, 18 Apr 2017 12:39:39 +0100 Message-Id: <1492515579-130563-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492515579-130563-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1492515579-130563-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 2/2] test/crypto: create unique driver name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Apr 2017 11:39:57 -0000 Since commit ("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 --- 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