X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fbus%2Fvdev%2Fvdev.c;h=a89ea23530641c88244b45de9de2d6b5945a77e9;hb=0d2870c4f78e2273b3f359ef49ecb60b494c9b0e;hp=87f0e2b6bb3fa4b41d2a4d7ff6fb806f6c54613b;hpb=e892fa595e19b5cce315045444b3b7e31130ef19;p=dpdk.git diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 87f0e2b6bb..a89ea23530 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -192,7 +192,7 @@ alloc_devargs(const char *name, const char *args) else devargs->args = strdup(""); - ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name); + ret = strlcpy(devargs->name, name, sizeof(devargs->name)); if (ret < 0 || ret >= (int)sizeof(devargs->name)) { free(devargs->args); free(devargs); @@ -409,6 +409,10 @@ vdev_scan(void) if (rte_mp_action_register(VDEV_MP_KEY, vdev_action) < 0 && rte_errno != EEXIST) { + /* for primary, unsupported IPC is not an error */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY && + rte_errno == ENOTSUP) + goto scan; VDEV_LOG(ERR, "Failed to add vdev mp action"); return -1; } @@ -436,6 +440,7 @@ vdev_scan(void) /* Fall through to allow private vdevs in secondary process */ } +scan: /* call custom scan callbacks if any */ rte_spinlock_lock(&vdev_custom_scan_lock); TAILQ_FOREACH(custom_scan, &vdev_custom_scans, next) {