devargs: do not replace already inserted device
authorThomas Monjalon <thomas@monjalon.net>
Wed, 7 Nov 2018 22:56:45 +0000 (23:56 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 11 Nov 2018 23:10:21 +0000 (00:10 +0100)
commitc7ad7754f8e2233a4a8837f04e267d38048e8c2d
tree9191882cb613b4ce0c019adb606c177fcc0c657f
parent86ce81af7352875f31efc01cb110b7b17c0ae235
devargs: do not replace already inserted device

The devargs of a device can be replaced by a newly allocated one
when trying to probe again the same device (multi-process or
multi-ports scenarios). This is breaking some pointer references.

It can be avoided by copying the new content, freeing the new devargs,
and returning the already inserted pointer.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
drivers/bus/vdev/vdev.c
lib/librte_eal/common/eal_common_dev.c
lib/librte_eal/common/eal_common_devargs.c
lib/librte_eal/common/include/rte_devargs.h