[dpdk-dev] [PATCH] eal/vfio: share the default container in multi process

2018-10-03 Thread Darek Stojaczyk
@intel.com Cc: gowrishanka...@linux.vnet.ibm.com Cc: sta...@dpdk.org While here, fix up the comment on rte_vfio_get_container_fd(). This function always opens a new container, never reuses an old one. Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/include/rte_vfio.h | 2 +- lib/librte_eal

[dpdk-dev] [PATCH] malloc: respect SIZE_HINT_ONLY when looking for the biggest free elem

2018-10-07 Thread Darek Stojaczyk
Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/malloc_heap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c index ac7bbb3ba..d2a8bd8dc 100644 --- a/lib/librte_eal/common/malloc_h

[dpdk-dev] [PATCH] ipc: fix undefined behavior in no-shconf mode

2018-10-24 Thread Darek Stojaczyk
early (with rc = 0) was placed before the `reply` initialization. Fix this by making the `reply` initialization occur first. Fixes: 5848e3d2813c ("ipc: support --no-shconf mode") Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/ea

[dpdk-dev] [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling

2018-10-24 Thread Darek Stojaczyk
This function is documented to return the number of unregistered callbacks or negative numbers on error, but pci_vfio checks for ret != 0 to detect failures. Not anymore. Fixes: c115fd000c32 ("vfio: handle hotplug request notifier") Cc: jia@intel.com Cc: sta...@dpdk.org Signed-off

[dpdk-dev] [PATCH] eal: fix rte_mp_request_sync() memleak on device hotplug

2018-10-25 Thread Darek Stojaczyk
rte_mp_request_sync() says that the caller is responsible for freeing one of its parameters afterwards. EAL didn't do that, causing a memory leak. Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: qi.z.zh...@intel.com Cc: sta...@dpdk.org Signed-off-by: Darek Stoj

[dpdk-dev] [PATCH] vdev: fix rte_mp_request_sync() memleak on scan

2018-10-25 Thread Darek Stojaczyk
org Signed-off-by: Paul Luse Signed-off-by: Darek Stojaczyk --- drivers/bus/vdev/vdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 688e31c21..685cc4e78 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -425,6 +425

[dpdk-dev] [PATCH] vfio: fix read-after-free on getting container fd

2018-10-25 Thread Darek Stojaczyk
We were reading some memory just after freeing it. Fixes: 83a73c5fef66 ("vfio: use generic multi-process channel") Cc: jianfeng@intel.com Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 3 ++- 1 file

[dpdk-dev] [PATCH] eal: fixup hotplugging an already present device

2018-10-25 Thread Darek Stojaczyk
the originally intented behavior. Fixes: e9d159c3d534 ("eal: allow probing a device again") Cc: tho...@monjalon.net Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/

[dpdk-dev] [PATCH] pci: propagate exact error codes in pci_probe_all_drivers()

2018-10-26 Thread Darek Stojaczyk
secondary to fail as well. Fixes: e9d159c3d534 ("eal: allow probing a device again") Cc: tho...@monjalon.net Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- drivers/bus/pci/pci_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/bus/pci/pc

[dpdk-dev] [PATCH v2] eal: fix IPC memleak on device hotplug

2018-10-29 Thread Darek Stojaczyk
rte_mp_request_sync() says that the caller is responsible for freeing one of its parameters afterwards. EAL didn't do that, causing a memory leak. Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: qi.z.zh...@intel.com Cc: anatoly.bura...@intel.com Signed-off-by:

[dpdk-dev] [PATCH] eal: fix memleak on device hotplug rollback

2018-10-31 Thread Darek Stojaczyk
Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: qi.z.zh...@intel.com Cc: anatoly.bura...@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/hotplug_mp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/hotpl

[dpdk-dev] [PATCH 1/3] bus/pci: update device devargs on each rescan

2018-11-04 Thread Darek Stojaczyk
ide") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- drivers/bus/pci/linux/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index f87533c5c..f3172960e 100644 --- a/drivers/bus/pci/linux/pci.c +++

[dpdk-dev] [PATCH 2/3] devargs: delay freeing previous devargs when overriding them

2018-11-04 Thread Darek Stojaczyk
subsequent patch. This one only extends the API. Signed-off-by: Darek Stojaczyk --- drivers/bus/vdev/vdev.c | 12 +--- lib/librte_eal/common/eal_common_dev.c | 11 +++ lib/librte_eal/common/eal_common_devargs.c | 21 ++--- lib/librte_eal

[dpdk-dev] [PATCH 3/3] eal: handle bus rescan failures during hotplug

2018-11-04 Thread Darek Stojaczyk
g add / remove") Cc: gaetan.ri...@6wind.com Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_dev.c | 30 ++ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_

[dpdk-dev] [PATCH] dev: don't remove devargs that are still referenced

2018-11-21 Thread Darek Stojaczyk
Even if a device failed to plug, it's still a device object that references the devargs. Those devargs will be freed automatically together with the device, but can't be freed any earlier. Fixes: 7e8b26650146 ("eal: fix hotplug add / remove") Cc: gaetan.ri...@6wind.com

[dpdk-dev] [PATCH] vfio: don't needlessly setup devices in secondary process

2018-11-21 Thread Darek Stojaczyk
This patch moves the proper error checks earlier in the code to fuly prevent setting up devices in secondary processes that weren't setup in the primary process. Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") Cc: anatoly.bura...@intel.com Signed-off-by: Darek Stojaczyk --

[dpdk-dev] [PATCH] dev: don't try to rollback a device attach that failed

2018-11-21 Thread Darek Stojaczyk
also for normal (non-rollback) detach, which could also theoretically segfault on non-plugged device. Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/hotplug_mp.c | 13 + 1 fi

[dpdk-dev] [PATCH v2] dev: don't remove devargs that are still referenced

2018-11-21 Thread Darek Stojaczyk
xes: 7e8b26650146 ("eal: fix hotplug add / remove") Cc: gaetan.ri...@6wind.com Cc: tho...@monjalon.net Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_dev.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/common/eal

[dpdk-dev] [PATCH] dev: fix devargs memleak on IPC detach request

2018-11-23 Thread Darek Stojaczyk
k, so they doesn't need to be freed. Then free the additional arguments string as soon as it's allocated, because we won't need it. Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- lib/

[dpdk-dev] [PATCH] dev: fix attach rollback of a device that was already attached

2018-11-23 Thread Darek Stojaczyk
lso print a warning "Devices may not be in sync [...]". Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/hotplug_mp.c | 12 ++-- 1 file changed, 10 insert

[dpdk-dev] [PATCH] dev: don't fail the hotplug request if device is attached in secondary

2018-11-23 Thread Darek Stojaczyk
o now this behavior is even more consistent. Looking by the code, this seems to be the originally intended behavior. Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/ho

[dpdk-dev] [PATCH v3] dev: don't remove devargs that are still referenced

2018-11-23 Thread Darek Stojaczyk
xes: 7e8b26650146 ("eal: fix hotplug add / remove") Cc: gaetan.ri...@6wind.com Cc: tho...@monjalon.net Signed-off-by: Darek Stojaczyk --- Changes since v2: * added an extra comment (Gaetan) Changes since v1: * described the failing scenario in commit msg (Thomas) lib/librte_eal/common/

[dpdk-dev] [PATCH v2] dev: fix attach rollback of a device that was already attached

2018-11-23 Thread Darek Stojaczyk
s -EEXIST. Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary") Cc: qi.z.zh...@intel.com Signed-off-by: Darek Stojaczyk --- Changes since v1: * attempt to detach the device in primary process (Qi) lib/librte_eal/common/eal_common_dev.c | 6 ++ 1 file

[dpdk-dev] [PATCH] pci/linux: use RTE_IOVA_VA whenever possible

2018-09-07 Thread Darek Stojaczyk
drivers which didn't explicitly report such flag could have been forced to work in RTE_IOVA_VA as well. This patch makes the RTE_PCI_DRV_IOVA_AS_VA explicitly a hint. If it's set, but RTE_IOVA_VA cannot be used, then EAL will print a proper warning. Signed-off-by: Darek Stojaczyk --- d

[dpdk-dev] [PATCH] eal/bus: use RTE_IOVA_PA only if phys addresses are available

2018-09-07 Thread Darek Stojaczyk
. Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_bus.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c index 0943851cc..8b56979d7 100644 --- a/lib/librte_eal

[dpdk-dev] [PATCH v2] eal/bus: use RTE_IOVA_PA only if phys addresses are available

2018-09-07 Thread Darek Stojaczyk
. Signed-off-by: Darek Stojaczyk --- Changes since v1: * added a missing rte_memory.h include lib/librte_eal/common/eal_common_bus.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common

[dpdk-dev] [PATCH 1/2] eal/vfio: check if we already have the group fd open

2018-09-17 Thread Darek Stojaczyk
From: Dariusz Stojaczyk Always attempt to find already opened fd for an iommu group as subsequent attempts to open it will fail. There's no public API to check if a group was already bound and has a container, so rte_vfio_container_group_bind() shouldn't fail in such case. Fixes: ea2dc1066870 (

[dpdk-dev] [PATCH 2/2] eal/vfio: cleanup getting group fd

2018-09-17 Thread Darek Stojaczyk
From: Dariusz Stojaczyk Factor out duplicated code. Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 119 ++--- 1 file changed, 45 insertions(+), 74 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal

[dpdk-dev] [PATCH v2] vhost: add external message handling callbacks to the public API

2019-01-13 Thread Darek Stojaczyk
External message callbacks are used e.g. by vhost crypto to parse crypto-specific vhost-user messages. We are now publishing the API to register those callbacks, so that other backends outside of DPDK can use them as well. Signed-off-by: Darek Stojaczyk --- lib/librte_vhost/rte_vhost.h | 66

[dpdk-dev] [PATCH v3] vhost: add external message handling callbacks to the public API

2019-01-17 Thread Darek Stojaczyk
External message callbacks are used e.g. by vhost crypto to parse crypto-specific vhost-user messages. We are now publishing the API to register those callbacks, so that other backends outside of DPDK can use them as well. Signed-off-by: Darek Stojaczyk Reviewed-by: Tiwei Bie --- lib

[dpdk-dev] [PATCH] eal: initialize alarms early

2019-03-26 Thread Darek Stojaczyk
Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/linux/eal/eal.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index 13f401684..75ed0cf10 100644 --- a/lib/librte_eal/linux

[dpdk-dev] [PATCH] fbarray: fix attach deadlock

2019-03-28 Thread Darek Stojaczyk
(). I believe this was the original intention. Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") Cc: anatoly.bura...@intel.com Cc: tho...@monjalon.net Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_fbarray.c | 2 ++ 1 file changed, 2 insertions(+) d

[dpdk-dev] [PATCH v2] fbarray: fix attach deadlock

2019-03-29 Thread Darek Stojaczyk
(). I believe this was the original intention. Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") Cc: anatoly.bura...@intel.com Cc: tho...@monjalon.net Signed-off-by: Darek Stojaczyk Reviewed-by: Gavin Hu --- v2: - fixed one more case where we could unlock the spi

[dpdk-dev] [PATCH v2] eal: initialize alarms early

2019-04-01 Thread Darek Stojaczyk
mentations. Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Cc: Qi Zhang Cc: Anatoly Burakov Cc: sta...@dpdk.org Signed-off-by: Darek Stojaczyk --- v2: - updated the bsd code as well (Thomas) lib/librte_eal/freebsd/eal/eal.c | 12 ++-- lib/librte_eal/li

[dpdk-dev] [PATCH v2] build: don't parse build configs of explicitly disabled drivers

2020-05-07 Thread Darek Stojaczyk
7;s a chance we don't need it. That's what this patch allows. Signed-off-by: Darek Stojaczyk Acked-by: Bruce Richardson --- v2: - simplified the code with if X.contains(), as Bruce suggested - removed the related comment from the code - it should be self-documented now

[dpdk-dev] [PATCH] pci: properly parse 32-bit domain numbers

2020-05-12 Thread Darek Stojaczyk
devices a PCI domain of 0x1. Parsing a BDF like 1:01:00.0 was failing before. To fix it, increase the upper limit of domain number to UINT32_MAX. This matches the size of struct rte_pci_addr->domain (uint32). Signed-off-by: Darek Stojaczyk --- lib/librte_pci/rte_pci.c | 4 ++-- 1 f

[dpdk-dev] [PATCH] build: don't parse build configs of explicitly disabled drivers

2020-03-26 Thread Darek Stojaczyk
7;s a chance we don't need it. That's what this patch allows. Signed-off-by: Darek Stojaczyk --- drivers/meson.build | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index 5502bf9924..a13c62a3b0 100644 --- a/drivers/