[dpdk-dev] [PATCH] vhost: added error log in vhost_user_set_features

2017-06-16 Thread Dariusz Stojaczyk
Since vhost_user_set_features failure is not handled in any way, a single error log has been added to at least to let the user know that something has gone wrong. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost_user.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[dpdk-dev] [PATCH 1/3] vhost: fix malloc in rte_vhost_get_mem_table

2017-05-10 Thread Dariusz Stojaczyk
Amount of allocated memory was too small, causing buffer overflow. Change-Id: I02293cd4bcddef14d2bbf314c79d8c65fc44e555 Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost

[dpdk-dev] [PATCH 3/3] vhost: access VhostUsrMsg via packed struct

2017-05-10 Thread Dariusz Stojaczyk
From: Daniel Verkamp Fixes unaligned access to fields. Change-Id: I2f8246481dc96d7e73134866f55a4227fc39031d Signed-off-by: Daniel Verkamp Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost_user.c | 56 +-- 1 file changed, 28 insertions(+), 28

[dpdk-dev] [PATCH 2/3] vhost: free virtio_net::guest_pages in vhost_backend_cleanup()

2017-05-10 Thread Dariusz Stojaczyk
guest_pages is being allocated in vhost_setup_mem_table(), reallocated in add_one_guest_page(), but never freed. This patch fixes a memory leak. Change-Id: I6edff00298a668054f4d106ffdaea828f41912fe Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost_user.c | 4 1 file changed, 4

[dpdk-dev] [PATCH v2 2/3] vhost: free virtio_net::guest_pages in vhost_backend_cleanup()

2017-05-11 Thread Dariusz Stojaczyk
guest_pages is being allocated in vhost_setup_mem_table(), reallocated in add_one_guest_page(), but never freed. This patch fixes a memory leak. Signed-off-by: Dariusz Stojaczyk --- Removed Gerrit Change-Id lib/librte_vhost/vhost_user.c | 4 1 file changed, 4 insertions(+) diff --git a

[dpdk-dev] [PATCH v2 1/3] vhost: fix malloc in rte_vhost_get_mem_table

2017-05-11 Thread Dariusz Stojaczyk
Amount of allocated memory was too small, causing buffer overflow. Signed-off-by: Dariusz Stojaczyk --- Removed Gerrit Change-Id lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 0b19d2e

[dpdk-dev] [PATCH v2 3/3] vhost: access VhostUsrMsg via packed struct

2017-05-11 Thread Dariusz Stojaczyk
From: Daniel Verkamp Fixes unaligned access to fields. Signed-off-by: Daniel Verkamp Signed-off-by: Dariusz Stojaczyk --- Removed Gerrit Change-Id lib/librte_vhost/vhost_user.c | 56 +-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a

[dpdk-dev] [PATCH v3 0/3] vhost undefined behavior fixes

2017-05-11 Thread Dariusz Stojaczyk
Fixes for memory-related undefined behavior issues in rte_vhost. Daniel Verkamp (1): vhost: access VhostUsrMsg via packed struct Dariusz Stojaczyk (2): vhost: fix malloc in rte_vhost_get_mem_table() vhost: free guest_pages in vhost_backend_cleanup() lib/librte_vhost/vhost.c | 2

[dpdk-dev] [PATCH v3 1/3] vhost: fix malloc in rte_vhost_get_mem_table()

2017-05-11 Thread Dariusz Stojaczyk
Amount of allocated memory was too small, causing buffer overflow. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 0b19d2e..1f565fb 100644 --- a/lib

[dpdk-dev] [PATCH v3 3/3] vhost: access VhostUsrMsg via packed struct

2017-05-11 Thread Dariusz Stojaczyk
From: Daniel Verkamp Fixes unaligned access to fields. Signed-off-by: Daniel Verkamp Signed-off-by: Dariusz Stojaczyk --- Fixed checkpatch warnings lib/librte_vhost/vhost_user.c | 60 +++ 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a

[dpdk-dev] [PATCH v3 2/3] vhost: free guest_pages in vhost_backend_cleanup()

2017-05-11 Thread Dariusz Stojaczyk
This patch fixes a memory leak. virtio_net::guest_pages is allocated in vhost_setup_mem_table(), reallocated in add_one_guest_page(), but never freed. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost_user.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH] vhost: fix deadlock on rte_vhost_driver_unregister()

2017-05-16 Thread Dariusz Stojaczyk
nge it's busy flag to 0. Thread A would have to finish vhost_user_read_cb() in order to set busy flag back to 0, but that can't happen due to the vsocket->conn_mutex lock. This patch synchronizes rte_vhost_driver_unregister() with vhost_user_read_cb() through vhost_user.mutex. Signed

[dpdk-dev] [PATCH v4 0/3] vhost: undefined behavior fixes

2017-05-26 Thread Dariusz Stojaczyk
Fixes for memory-related undefined behavior issues in rte_vhost. Daniel Verkamp (1): vhost: access VhostUsrMsg via packed struct Dariusz Stojaczyk (2): vhost: fix malloc in rte_vhost_get_mem_table() vhost: free guest_pages in vhost_backend_cleanup() lib/librte_vhost/vhost.c | 2

[dpdk-dev] [PATCH v4 1/3] vhost: fix malloc in rte_vhost_get_mem_table()

2017-05-26 Thread Dariusz Stojaczyk
Amount of allocated memory was too small, causing buffer overflow. Signed-off-by: Dariusz Stojaczyk --- v2: remove gerrit id lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 0b19d2e..1f565fb

[dpdk-dev] [PATCH v4 2/3] vhost: free guest_pages in vhost_backend_cleanup()

2017-05-26 Thread Dariusz Stojaczyk
This patch fixes a memory leak. virtio_net::guest_pages is allocated in vhost_setup_mem_table(), reallocated in add_one_guest_page(), but never freed. Signed-off-by: Dariusz Stojaczyk --- v2: remove gerrit id lib/librte_vhost/vhost_user.c | 4 1 file changed, 4 insertions(+) diff --git a

[dpdk-dev] [PATCH v4 3/3] vhost: access VhostUsrMsg via packed struct

2017-05-26 Thread Dariusz Stojaczyk
From: Daniel Verkamp Accessing fields of a packed struct through unaligned pointers is undefined behavior. Instead of passing pointers to particular fields, a pointer to the root struct should be used. This patch does exactly that. Signed-off-by: Daniel Verkamp Signed-off-by: Dariusz Stojaczyk

Re: [dpdk-dev] [RFC v3 0/7] vhost2: new librte_vhost2 proposal

2018-06-13 Thread Dariusz Stojaczyk
Hi Stefan, I'm sorry for the late response. My email client filtered out this mail. I fixed it just now. pt., 8 cze 2018 o 15:29 Stefan Hajnoczi napisaƂ(a): > > On Thu, Jun 07, 2018 at 05:12:20PM +0200, Dariusz Stojaczyk wrote: > > The proposed structure for the new library i

[dpdk-dev] [PATCH] memory: fix alignment in eal_get_virtual_area()

2018-06-13 Thread Dariusz Stojaczyk
directory") Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/common/eal_common_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c in

[dpdk-dev] [PATCH] memory: make eal_get_virtual_area() aware of base-virtaddr alignment

2018-06-15 Thread Dariusz Stojaczyk
From: Dariusz Stojaczyk Whenever a calculated base-virtaddr offset had to be manually aligned to requested page_sz, we did not take account of that alignment in incrementing the base-virtaddr offset further. The next requested virtual area could print a warning "hint [...] not respected!

[dpdk-dev] [PATCH v2] memory: make eal_get_virtual_area() aware of base-virtaddr alignment

2018-06-15 Thread Dariusz Stojaczyk
From: Dariusz Stojaczyk Whenever a calculated base-virtaddr offset had to be manually aligned to requested page_sz, we did not take account of that alignment in incrementing the base-virtaddr offset further. The next requested virtual area could print a warning "hint [...] not respected!

[dpdk-dev] [PATCH] memory: do not use base-virtaddr in secondary processes

2018-06-18 Thread Dariusz Stojaczyk
rw-s- fbarray_memseg-1048576k-0-0_203213 ``` Fixes: 524e43c2ad9a ("mem: prepare memseg lists for multiprocess sync") Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/common/eal_common_memory.c | 3 ++- 1 file changed, 2 insertions(+

Re: [dpdk-dev] [PATCH v3 2/6] mem: use address hint for mapping hugepages

2018-10-29 Thread Dariusz Stojaczyk
On Fri, Oct 5, 2018 at 2:47 PM Alejandro Lucero wrote: > > Linux kernel uses a really high address as starting address for > serving mmaps calls. If there exist addressing limitations and > IOVA mode is VA, this starting address is likely too high for > those devices. However, it is possible to us

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

2018-11-05 Thread Dariusz Stojaczyk
From: Darek Stojaczyk Bus rescan is done e.g. during the device hotplug, where devargs are re-allocated. By not updating the rte_device->devargs pointer we potentially make it a dangling one, as previous devargs could have been (or will be soon) freed. Fixes: 55e411b301c3 ("bus/pci: fix resource

[dpdk-dev] [PATCH v2 2/3] eal/thread: fix return codes for rte_thread_setname()

2018-07-10 Thread Dariusz Stojaczyk
From: Dariusz Stojaczyk The doc says this function returns negative errno on error, but it currently returns either -1 or positive errno. It was incorrectly assumed that pthread_setname_np() returns negative error numbers. It always returns positive ones, so this patch negates its return value

[dpdk-dev] [PATCH v2 3/3] eal/thread: fix return codes for rte_ctrl_thread_create()

2018-07-10 Thread Dariusz Stojaczyk
From: Dariusz Stojaczyk This function returned positive error numbers instead of negative ones as desbribed in the doc. What's worse, multiple of its callers only check for (rc < 0) to detect failure. It was incorrectly assumed that pthread_create and pthread_setaffinity_np return

[dpdk-dev] [PATCH v2 1/3] eal/thread: ignore rte_thread_setname() failure in ctrl thread

2018-07-10 Thread Dariusz Stojaczyk
From: Dariusz Stojaczyk The error is not fatal and we can physically continue creating the thread. It simply won't have a name. If rte_thread_setname() fails, we will just print a debug log now. EAL does the same for lcore threads. Signed-off-by: Dariusz Stojaczyk Acked-by: Anatoly Bu

[dpdk-dev] [RFC] vhost: new rte_vhost API proposal

2018-05-10 Thread Dariusz Stojaczyk
l functions for vDPA might be still required, but everything present here so far shouldn't need changing. Signed-off-by: Dariusz Stojaczyk --- lib/librte_virtio/rte_virtio.h | 245 + 1 file changed, 245 insertions(+) create mode 100644 lib/libr

[dpdk-dev] [RFC v2] vhost: new rte_vhost API proposal

2018-05-18 Thread Dariusz Stojaczyk
introduces the API. Some additional functions for vDPA might be still required, but everything present here so far shouldn't need changing. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost2/rte_vhost2.h | 331 + 1 file changed, 331 insertions(

[dpdk-dev] [PATCH 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area

2018-06-01 Thread Dariusz Stojaczyk
hat it won't be available to anyone else. Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 17 + 1 file changed, 17 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index 8c11f98..

[dpdk-dev] [PATCH 2/2] memalloc: keep in mind a failed MAP_FIXED mmap may still perform an unmap

2018-06-01 Thread Dariusz Stojaczyk
9.0-4-amd64. I was getting ENOMEM when trying to map in hugetlbfs with no space left, but the previous anonymous mapping was still being removed. Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --

[dpdk-dev] [PATCH] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr

2018-06-01 Thread Dariusz Stojaczyk
When trying to use it with an address that's not managed by DPDK it would segfault due to a missing check. The doc says this function returns either a pointer or NULL, so let it do so. Change-Id: Ib292f148914e67054f5d7b664077f19cba7000e4 Signed-off-by: Dariusz Stojaczyk --- lib/librt

[dpdk-dev] [PATCH v2 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area

2018-06-01 Thread Dariusz Stojaczyk
hat it won't be available to anyone else. Changes from v1: * checkpatch fixes Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 17 + 1 file changed, 17 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxap

[dpdk-dev] [PATCH 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area

2018-06-01 Thread Dariusz Stojaczyk
hat it won't be available to anyone else. Changes from v1: * checkpatch fixes Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 17 + 1 file changed, 17 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxap

[dpdk-dev] [PATCH v3 1/2] memalloc: do not leave unmapped holes in EAL virtual memory area

2018-06-01 Thread Dariusz Stojaczyk
hat it won't be available to anyone else. Changes from v2: * replaced rte_panic() with a CRIT log. * added "git fixline" tags Changes from v1: * checkpatch fixes Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") Cc: anatoly.bura...@intel.com Cc: sta...@dp

[dpdk-dev] [PATCH v3 2/2] memalloc: keep in mind a failed MAP_FIXED mmap may still perform an unmap

2018-06-01 Thread Dariusz Stojaczyk
bed1e1d1d ("mem: support mapping hugepages at runtime") Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/

[dpdk-dev] [PATCH v2] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr

2018-06-01 Thread Dariusz Stojaczyk
("mem: replace memseg with memseg lists") Cc: anatoly.bura...@intel.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/common/eal_common_memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/c

[dpdk-dev] [PATCH v3] memory: fix segfault on rte_mem_virt2memseg() call with invalid addr

2018-06-03 Thread Dariusz Stojaczyk
sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk Acked-by: Anatoly Burakov --- Changes from v2: * cleaned up commit msg Changes from v1: * removed gerrit change id * added "git fixline" tags lib/librte_eal/common/eal_common_memory.c | 3 +++ 1 file changed, 3 insertions(+) di

[dpdk-dev] [PATCH 1/2] eal/thread: fix return codes for rte_thread_setname()

2018-06-08 Thread Dariusz Stojaczyk
here, also ignore rte_thread_setname() failure in rte_ctrl_thread_create() and print a debug message instead. Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD") Cc: thomas.monja...@6wind.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/common/eal_commo

[dpdk-dev] [PATCH 2/2] eal/thread: fix return codes for rte_ctrl_thread_create()

2018-06-08 Thread Dariusz Stojaczyk
returns positive ones, so this patch negates their return values before returning. Fixes: 9e5afc72c909 ("eal: add function to create control threads") Cc: olivier.m...@6wind.com Cc: sta...@dpdk.org Signed-off-by: Dariusz Stojaczyk --- lib/librte_eal/common/eal_common_thread.c | 6 +++---

[dpdk-dev] [PATCH] vhost: remove vhost-net requirements from generic vhost APIs

2019-02-24 Thread Dariusz Stojaczyk
From: Darek Stojaczyk The rte_vhost API to put data into virtqueues operates on mbufs and hence it is strictly vhost-net specific. External backends need to implement virtqueue handling from scratch and that's just not possible without APIs to get/set vring base addresses. Those relevant APIs ar

[dpdk-dev] [PATCH] vhost: added user callbacks for socket open/close

2017-08-20 Thread Dariusz Stojaczyk
new_device/destroy_device callbacks and breaking the ABI, a set of new functions new_connection/destroy_connection has been added. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/rte_vhost.h | 5 - lib/librte_vhost/socket.c| 23 +++ 2 files changed, 23 insertions

[dpdk-dev] [PATCH v2] vhost: added user callbacks for socket open/close

2017-08-22 Thread Dariusz Stojaczyk
new_device/destroy_device callbacks and breaking the ABI, a set of new functions new_connection/destroy_connection has been added. Signed-off-by: Dariusz Stojaczyk --- v2: also updated vhost_lib.rst doc/guides/prog_guide/vhost_lib.rst | 15 +-- lib/librte_vhost/rte_vhost.h| 5

[dpdk-dev] [PATCH v3] rte_vhost: added user callbacks for socket open/close

2017-08-30 Thread Dariusz Stojaczyk
f new functions new_connection/destroy_connection has been added. Signed-off-by: Dariusz Stojaczyk --- v3: improved err-handling path and updated commit msg v2: also updated vhost_lib.rst lib/librte_vhost/rte_vhost.h | 5 - lib/librte_vhost/socket.c| 31 --- 2