@@ -553,6 +553,9 @@ rte_dpaa_bus_probe(void)
if (ret)
continue;
+ if (rte_dev_is_probed(&dev->device))
+ continue;
+
if (!drv->probe ||
(dev->device.devargs &&
dev->device.devargs->policy == RTE_DEV_BLACKLISTED))
@@ -384,6 +384,9 @@ rte_fslmc_probe(void)
if (!drv->probe)
continue;
+ if (rte_dev_is_probed(&dev->device))
+ continue;
+
if (dev->device.devargs &&
dev->device.devargs->policy == RTE_DEV_BLACKLISTED) {
DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping",
@@ -5,6 +5,7 @@
#include <string.h>
#include <inttypes.h>
#include <stdint.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/queue.h>
@@ -272,16 +273,22 @@ ifpga_probe_one_driver(struct rte_afu_driver *drv,
struct rte_afu_device *afu_dev)
{
int ret;
+ bool already_probed;
if (!rte_afu_match(drv, afu_dev))
/* Match of device and driver failed */
return 1;
+ already_probed = rte_dev_is_probed(&afu_dev->device);
+
/* reference driver structure */
- afu_dev->driver = drv;
+ if (!already_probed)
+ afu_dev->driver = drv;
/* call the driver probe() function */
ret = drv->probe(afu_dev);
+ if (already_probed)
+ return ret; /* no rollback if already succeeded earlier */
if (ret)
afu_dev->driver = NULL;
else
@@ -299,10 +306,6 @@ ifpga_probe_all_drivers(struct rte_afu_device *afu_dev)
if (afu_dev == NULL)
return -1;
- /* Check if a driver is already loaded */
- if (rte_dev_is_probed(&afu_dev->device))
- return 0;
-
TAILQ_FOREACH(drv, &ifpga_afu_drv_list, next) {
if (ifpga_probe_one_driver(drv, afu_dev)) {
ret = -1;
@@ -6,6 +6,7 @@
#include <string.h>
#include <inttypes.h>
#include <stdint.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/queue.h>
@@ -123,6 +124,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
struct rte_pci_device *dev)
{
int ret;
+ bool already_probed;
struct rte_pci_addr *loc;
if ((dr == NULL) || (dev == NULL))
@@ -153,6 +155,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
dev->device.numa_node = 0;
}
+ already_probed = rte_dev_is_probed(&dev->device);
+
RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->driver.name);
@@ -161,9 +165,10 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
* This needs to be before rte_pci_map_device(), as it enables to use
* driver flags for adjusting configuration.
*/
- dev->driver = dr;
+ if (!already_probed)
+ dev->driver = dr;
- if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
+ if (!already_probed && (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)) {
/* map resources for devices that use igb_uio */
ret = rte_pci_map_device(dev);
if (ret != 0) {
@@ -174,6 +179,8 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr,
/* call the driver probe() function */
ret = dr->probe(dr, dev);
+ if (already_probed)
+ return ret; /* no rollback if already succeeded earlier */
if (ret) {
dev->driver = NULL;
if ((dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) &&
@@ -244,10 +251,6 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
if (dev == NULL)
return -1;
- /* Check if a driver is already loaded */
- if (rte_dev_is_probed(&dev->device))
- return 0;
-
FOREACH_DRIVER_ON_PCIBUS(dr) {
rc = rte_pci_probe_one_driver(dr, dev);
if (rc < 0)
@@ -225,6 +225,11 @@ insert_vdev(const char *name, const char *args, struct rte_vdev_device **p_dev)
dev->device.name = devargs->name;
if (find_vdev(name)) {
+ /*
+ * A vdev is expected to have only one port.
+ * So there is no reason to try probing again,
+ * even with new arguments.
+ */
ret = -EEXIST;
goto fail;
}
@@ -3,6 +3,7 @@
* All Rights Reserved.
*/
+#include <stdbool.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
@@ -93,6 +94,7 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
struct rte_vmbus_device *dev)
{
char guid[RTE_UUID_STRLEN];
+ bool already_probed;
int ret;
if (!vmbus_match(dr, dev))
@@ -104,13 +106,16 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
/* TODO add blacklisted */
- /* map resources for device */
- ret = rte_vmbus_map_device(dev);
- if (ret != 0)
- return ret;
+ already_probed = rte_dev_is_probed(&dev->device);
+ if (!already_probed) {
+ /* map resources for device */
+ ret = rte_vmbus_map_device(dev);
+ if (ret != 0)
+ return ret;
- /* reference driver structure */
- dev->driver = dr;
+ /* reference driver structure */
+ dev->driver = dr;
+ }
if (dev->device.numa_node < 0) {
VMBUS_LOG(WARNING, " Invalid NUMA socket, default to 0");
@@ -120,6 +125,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
/* call the driver probe() function */
VMBUS_LOG(INFO, " probe driver: %s", dr->driver.name);
ret = dr->probe(dr, dev);
+ if (already_probed)
+ return ret; /* no rollback if already succeeded earlier */
if (ret) {
dev->driver = NULL;
rte_vmbus_unmap_device(dev);
@@ -142,12 +149,6 @@ vmbus_probe_all_drivers(struct rte_vmbus_device *dev)
struct rte_vmbus_driver *dr;
int rc;
- /* Check if a driver is already loaded */
- if (rte_dev_is_probed(&dev->device)) {
- VMBUS_LOG(DEBUG, "VMBUS driver already loaded");
- return 0;
- }
-
FOREACH_DRIVER_ON_VMBUS(dr) {
rc = vmbus_probe_one_driver(dr, dev);
if (rc < 0) /* negative is an error */
@@ -8,6 +8,8 @@ QAT_CRYPTO_DIR := $(RTE_SDK)/drivers/crypto/qat
QAT_COMPRESS_DIR := $(RTE_SDK)/drivers/compress/qat
VPATH=$(QAT_CRYPTO_DIR):$(QAT_COMPRESS_DIR)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
# external library include paths
CFLAGS += -I$(SRCDIR)/qat_adf
CFLAGS += -I$(SRCDIR)
@@ -16,7 +18,6 @@ CFLAGS += -I$(QAT_COMPRESS_DIR)
ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y)
- CFLAGS += -DALLOW_EXPERIMENTAL_API
LDLIBS += -lrte_compressdev
SRCS-y += qat_comp.c
SRCS-y += qat_comp_pmd.c
@@ -12,3 +12,4 @@ qat_sources = files('qat_common.c',
qat_includes = [include_directories('.', 'qat_adf')]
qat_ext_deps = []
qat_cflags = []
+allow_experimental_apis = true
@@ -194,6 +194,9 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
pci_dev->addr.devid,
pci_dev->addr.function);
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
qat_pci_dev = qat_pci_device_allocate(pci_dev);
if (qat_pci_dev == NULL)
return -ENODEV;
@@ -569,6 +569,9 @@ zip_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
(unsigned int)pci_dev->id.vendor_id,
(unsigned int)pci_dev->id.device_id);
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
rte_pci_device_name(&pci_dev->addr, compressdev_name,
sizeof(compressdev_name));
@@ -14,6 +14,7 @@ LIB = librte_pmd_virtio_crypto.a
CFLAGS += -I$(RTE_SDK)/lib/librte_vhost
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
EXPORT_MAP := rte_pmd_virtio_crypto_version.map
@@ -6,3 +6,4 @@ deps += 'bus_pci'
name = 'virtio_crypto'
sources = files('virtio_cryptodev.c', 'virtio_pci.c',
'virtio_rxtx.c', 'virtqueue.c')
+allow_experimental_apis = true
@@ -1439,6 +1439,9 @@ crypto_virtio_pci_probe(
pci_dev->addr.devid,
pci_dev->addr.function);
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
return crypto_virtio_create(name, pci_dev, &init_params);
@@ -150,6 +150,9 @@ ssowvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->mem_resource[0].addr == NULL ||
pci_dev->mem_resource[2].addr == NULL ||
pci_dev->mem_resource[4].addr == NULL) {
@@ -230,6 +233,9 @@ ssovf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->mem_resource[0].addr == NULL ||
pci_dev->mem_resource[2].addr == NULL) {
mbox_log_err("Empty bars %p %p",
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_skeleton_event.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_eventdev
LDLIBS += -lrte_pci -lrte_bus_pci
@@ -3,3 +3,4 @@
sources = files('skeleton_eventdev.c')
deps += ['bus_pci', 'bus_vdev']
+allow_experimental_apis = true
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_mempool_octeontx.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/common/octeontx/
EXPORT_MAP := rte_mempool_octeontx_version.map
@@ -5,4 +5,6 @@ sources = files('octeontx_fpavf.c',
'rte_mempool_octeontx.c'
)
+allow_experimental_apis = true
+
deps += ['mbuf', 'bus_pci', 'common_octeontx']
@@ -764,6 +764,9 @@ fpavf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->mem_resource[0].addr == NULL) {
fpavf_log_err("Empty bars %p ", pci_dev->mem_resource[0].addr);
return -ENODEV;
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_ark.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3 -I./
CFLAGS += $(WERROR_FLAGS) -Werror
@@ -11,3 +11,4 @@ sources = files('ark_ddm.c',
'ark_pktgen.c',
'ark_rqp.c',
'ark_udm.c')
+allow_experimental_apis = true
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_avf.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_avp.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
@@ -3,3 +3,4 @@
sources = files('avp_ethdev.c')
install_headers('rte_avp_common.h', 'rte_avp_fifo.h')
+allow_experimental_apis = true
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_axgbe.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
@@ -17,3 +17,5 @@ cflags += '-Wno-cast-qual'
if arch_subdir == 'x86'
sources += files('axgbe_rxtx_vec_sse.c')
endif
+
+allow_experimental_apis = true
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_bnx2x.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -DZLIB_CONST
@@ -12,3 +12,4 @@ sources = files('bnx2x.c',
'bnx2x_vfpf.c',
'ecore_sp.c',
'elink.c')
+allow_experimental_apis = true
@@ -15,6 +15,7 @@ EXPORT_MAP := rte_pmd_bnxt_version.map
LIBABIVER := 2
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
@@ -18,3 +18,4 @@ sources = files('bnxt_cpr.c',
'bnxt_util.c',
'bnxt_vnic.c',
'rte_pmd_bnxt.c')
+allow_experimental_apis = true
@@ -13,6 +13,7 @@ CFLAGS += -I$(SRCDIR)/base/
CFLAGS += -I$(SRCDIR)
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
EXPORT_MAP := rte_pmd_cxgbe_version.map
@@ -14,3 +14,5 @@ sources = files('cxgbe_ethdev.c',
'base/t4_hw.c',
'base/t4vf_hw.c')
includes += include_directories('base')
+
+allow_experimental_apis = true
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_e1000.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
@@ -15,3 +15,5 @@ sources = files(
)
includes += include_directories('base')
+
+allow_experimental_apis = true
@@ -13,6 +13,7 @@ EXPORT_MAP := rte_pmd_enic_version.map
LIBABIVER := 1
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -I$(SRCDIR)/base/
CFLAGS += -I$(SRCDIR)
CFLAGS += -O3
@@ -17,3 +17,5 @@ sources = files(
)
deps += ['hash']
includes += include_directories('base')
+
+allow_experimental_apis = true
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_fm10k.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
@@ -14,3 +14,5 @@ if arch_subdir == 'x86'
endif
includes += include_directories('base')
+
+allow_experimental_apis = true
@@ -633,6 +633,9 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_eth_devargs eth_da = { .nb_representor_ports = 0 };
int i, retval;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->device.devargs) {
retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
ð_da);
@@ -682,6 +682,9 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
list = rte_zmalloc("ifcvf", sizeof(*list), 0);
if (list == NULL)
goto error;
@@ -1735,6 +1735,9 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_eth_devargs eth_da;
int i, retval;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->device.devargs) {
retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
ð_da);
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_lio.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)/base -I$(SRCDIR)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
@@ -6,3 +6,4 @@ sources = files('base/lio_23xx_vf.c',
'lio_ethdev.c',
'lio_rxtx.c')
includes += include_directories('base')
+allow_experimental_apis = true
@@ -523,6 +523,10 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
(void)pci_drv;
assert(pci_drv == &mlx4_driver);
+
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
list = mlx4_glue->get_device_list(&i);
if (list == NULL) {
rte_errno = errno;
@@ -1296,6 +1296,10 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
assert(pci_drv == &mlx5_driver);
errno = 0;
+
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
ibv_list = mlx5_glue->get_device_list(&ret);
if (!ibv_list) {
rte_errno = errno ? errno : ENOSYS;
@@ -75,9 +75,6 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size)
struct rte_eth_dev *eth_dev;
const char *name;
- if (!dev)
- return NULL;
-
name = dev->device.name;
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
@@ -824,6 +821,12 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused,
PMD_INIT_FUNC_TRACE();
+ if (!dev)
+ return -EINVAL;
+
+ if (rte_dev_is_probed(&dev->device))
+ return -EEXIST;
+
eth_dev = eth_dev_vmbus_allocate(dev, sizeof(struct hn_data));
if (!eth_dev)
return -ENOMEM;
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_nfp.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
@@ -14,3 +14,4 @@ sources = files('nfpcore/nfp_cpp_pcie_ops.c',
'nfpcore/nfp_nsp_eth.c',
'nfpcore/nfp_hwinfo.c',
'nfp_net.c')
+allow_experimental_apis = true
@@ -3121,6 +3121,9 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
if (!dev)
return ret;
+ if (rte_dev_is_probed(&dev->device))
+ return -EEXIST;
+
/*
* When device bound to UIO, the device could be used, by mistake,
* by two DPDK apps, and the UIO driver does not avoid it. This
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_octeontx.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -I$(RTE_SDK)/drivers/common/octeontx/
CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
@@ -44,8 +45,6 @@ else
CFLAGS_octeontx_rxtx.o += -O3 -Ofast
endif
-CFLAGS_octeontx_ethdev.o += -DALLOW_EXPERIMENTAL_API
-
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_common_octeontx
LDLIBS += -lrte_mempool_octeontx
@@ -14,7 +14,7 @@ foreach d: depends
endforeach
base_lib = static_library('octeontx_base', sources,
- c_args: cflags,
+ c_args: cflags + ['-DALLOW_EXPERIMENTAL_API'],
dependencies: static_objs,
)
@@ -120,6 +120,9 @@ pkivf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
return 0;
}
@@ -536,6 +536,9 @@ pkovf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
if (pci_dev->mem_resource[0].addr == NULL ||
pci_dev->mem_resource[2].addr == NULL) {
octeontx_log_err("Empty bars %p %p",
@@ -10,6 +10,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_qede.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
@@ -10,3 +10,5 @@ sources = files(
'qede_main.c',
'qede_rxtx.c',
)
+
+allow_experimental_apis = true
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_szedata2.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lsze2
@@ -5,3 +5,4 @@ dep = cc.find_library('sze2', required: false)
build = dep.found()
ext_deps += dep
sources = files('rte_eth_szedata2.c')
+allow_experimental_apis = true
@@ -1804,6 +1804,9 @@ static int szedata2_eth_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
PMD_INIT_FUNC_TRACE();
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
ret = get_port_info(pci_dev, &port_count, port_info,
SZEDATA2_MAX_PORTS);
if (ret != 0)
@@ -9,6 +9,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_thunderx_nicvf.a
+CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lm
@@ -18,3 +18,5 @@ if cc.has_argument('-Wno-maybe-uninitialized')
endif
includes += include_directories('base')
+
+allow_experimental_apis = true
@@ -378,6 +378,9 @@ ifpga_rawdev_create(struct rte_pci_device *pci_dev,
goto cleanup;
}
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
memset(name, 0, sizeof(name));
snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
@@ -191,11 +191,6 @@ rte_dev_probe(const char *devargs)
goto err_devarg;
}
- if (rte_dev_is_probed(dev)) {
- RTE_LOG(ERR, EAL, "Device is already plugged\n");
- return -EEXIST;
- }
-
ret = da->bus->plug(dev);
if (ret) {
RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n",
@@ -158,7 +158,7 @@ struct rte_device {
const char *name; /**< Device name */
const struct rte_driver *driver; /**< Driver associated after probing */
int numa_node; /**< NUMA node connection */
- struct rte_devargs *devargs; /**< Device user arguments */
+ struct rte_devargs *devargs; /**< Arguments for latest probing */
};
/**
@@ -167,6 +167,9 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
struct rte_eth_dev *eth_dev;
int ret;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
eth_dev = rte_eth_dev_pci_allocate(pci_dev, private_data_size);
if (!eth_dev)
return -ENOMEM;
@@ -50,6 +50,9 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv,
if (devinit == NULL)
return -EINVAL;
+ if (rte_dev_is_probed(&pci_dev->device))
+ return -EEXIST;
+
rte_pci_device_name(&pci_dev->addr, eventdev_name,
sizeof(eventdev_name));