From: Pablo de Lara Date: Tue, 18 Apr 2017 11:39:39 +0000 (+0100) Subject: test/crypto: create unique driver name X-Git-Tag: spdx-start~3468 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=217179d1bca45b64cf77086ffca23aa89d8ce638;p=dpdk.git test/crypto: create unique driver name 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 Acked-by: Fan Zhang --- diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index ca7d6df1a4..9f1317149f 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"