Re: [dpdk-dev] [RFC v2, 2/2] eventdev: add crypto adapter API header

2018-03-03 Thread Vangati, Narender
Akhil, I'm probably missing a point somewhere but I don't follow the suggestions. To me, ethdev, cryptodev, eventdev, etc. are device abstractions, whereas the proposed ENQ mode isn't at the same level. The DEQ mode is a device abstraction for cryptodev->eventdev (whether h/w or s/w based), but

Re: [dpdk-dev] [PATCH 31/41] ethdev: use contiguous allocation for DMA memory

2018-03-03 Thread Andrew Rybchenko
On 03/03/2018 04:46 PM, Anatoly Burakov wrote: This fixes the following drivers in one go: Does it mean that these drivers are broken in the middle of patch set and fixed now? If so, it would be good to avoid it. It breaks bisect. grep -Rl rte_eth_dma_zone_reserve drivers/ drivers/net/avf/

[dpdk-dev] [PATCH 37/41] net/enic: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: It is not 100% clear that second call to memzone_reserve is allocating DMA memory. Corrections welcome. drivers/net/enic/enic_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/n

[dpdk-dev] [PATCH 41/41] net/vmxnet3: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: Not sure if DMA-capable memzones are needed for vmxnet3. Corrections welcome. drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmx

[dpdk-dev] [PATCH 24/41] vfio: allow to map other memory regions

2018-03-03 Thread Anatoly Burakov
Currently it is not possible to use memory that is not owned by DPDK to perform DMA. This scenarion might be used in vhost applications (like SPDK) where guest send its own memory table. To fill this gap provide API to allow registering arbitrary address in VFIO container. Signed-off-by: Pawel Wod

[dpdk-dev] [PATCH 33/41] net/avf: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- drivers/net/avf/avf_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index 4df6617..f69d697 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -1

[dpdk-dev] [PATCH 17/41] eal: enable memory hotplug support in rte_malloc

2018-03-03 Thread Anatoly Burakov
This set of changes enables rte_malloc to allocate and free memory as needed. The way it works is, first malloc checks if there is enough memory already allocated to satisfy user's request. If there isn't, we try and allocate more memory. The reverse happens with free - we free an element, check it

[dpdk-dev] [PATCH 40/41] net/virtio: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: Not sure if virtio needs to allocate DMA-capable memory, being a software driver and all. Corrections welcome. drivers/net/virtio/virtio_ethdev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virt

[dpdk-dev] [PATCH 23/41] mempool: add support for the new allocation methods

2018-03-03 Thread Anatoly Burakov
If a user has specified that the zone should have contiguous memory, use the new _contig allocation API's instead of normal ones. Otherwise, account for the fact that unless we're in IOVA_AS_VA mode, we cannot guarantee that the pages would be physically contiguous, so we calculate the memzone size

[dpdk-dev] [PATCH 22/41] eal: replace memzone array with fbarray

2018-03-03 Thread Anatoly Burakov
It's there, so we might as well use it. Some operations will be sped up by that. Since we have to allocate an fbarray for memzones, we have to do it before we initialize memory subsystem, because that, in secondary processes, will (later) allocate more fbarrays than the primary process, which will

[dpdk-dev] [PATCH 16/41] eal: make use of memory hotplug for init

2018-03-03 Thread Anatoly Burakov
Add a new (non-legacy) memory init path for EAL. It uses the new memory hotplug facilities, although it's only being run at startup. If no -m or --socket-mem switches were specified, the new init will not allocate anything, whereas if those switches were passed, appropriate amounts of pages would

[dpdk-dev] [PATCH 18/41] test: fix malloc autotest to support memory hotplug

2018-03-03 Thread Anatoly Burakov
The test was expecting memory already being allocated on all sockets, and thus was failing because calling rte_malloc could trigger memory hotplug event and allocate memory where there was none before. Fix it to instead report availability of memory on specific sockets by attempting to allocate a

[dpdk-dev] [PATCH 36/41] net/ena: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- drivers/net/ena/base/ena_plat_dpdk.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 8cba319..c1ebf00 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h

[dpdk-dev] [PATCH 14/41] eal: add support for mapping hugepages at runtime

2018-03-03 Thread Anatoly Burakov
Nothing uses this code yet. The bulk of it is copied from old memory allocation code (linuxapp eal_memory.c). We provide an EAL-internal API to allocate either one page or multiple pages, guaranteeing that we'll get contiguous VA for all of the pages that we requested. For single-file segments, we

[dpdk-dev] [PATCH 10/41] eal: add "single file segments" command-line option

2018-03-03 Thread Anatoly Burakov
For now, this option does nothing, but it will be useful in dynamic memory allocation down the line. Currently, DPDK stores all pages as separate files in hugetlbfs. This option will allow storing all pages in one file (one file per socket, per page size). Signed-off-by: Anatoly Burakov --- lib/

[dpdk-dev] [PATCH 39/41] net/qede: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: Doing "grep -R rte_memzone_reserve drivers/net/qede" returns the following: drivers/net/qede/qede_fdir.c: mz = rte_memzone_reserve_aligned(mz_name, QEDE_MAX_FDIR_PKT_LEN, drivers/net/qede/base/bcm_osal.c: mz = rte_memzone_reserve_al

[dpdk-dev] [PATCH 09/41] eal: add rte_fbarray

2018-03-03 Thread Anatoly Burakov
rte_fbarray is a simple indexed array stored in shared memory via mapping files into memory. Rationale for its existence is the following: since we are going to map memory page-by-page, there could be quite a lot of memory segments to keep track of (for smaller page sizes, page count can easily rea

[dpdk-dev] [PATCH 38/41] net/i40e: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: It is not 100% clear that all users of this function need to allocate DMA memory. Corrections welcome. drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_rxtx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/d

[dpdk-dev] [PATCH 35/41] net/cxgbe: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- Notes: It is not 100% clear if this memzone is used for DMA, corrections welcome. drivers/net/cxgbe/sge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index 3d5aa59..e31474c 100

[dpdk-dev] [PATCH 31/41] ethdev: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
This fixes the following drivers in one go: grep -Rl rte_eth_dma_zone_reserve drivers/ drivers/net/avf/avf_rxtx.c drivers/net/thunderx/nicvf_ethdev.c drivers/net/e1000/igb_rxtx.c drivers/net/e1000/em_rxtx.c drivers/net/fm10k/fm10k_ethdev.c drivers/net/vmxnet3/vmxnet3_rxtx.c drivers/net/liquidio/l

[dpdk-dev] [PATCH 25/41] eal: map/unmap memory with VFIO when alloc/free pages

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index bbeeeba..c03e7bc 100644 --- a/lib/librte_eal/linuxapp/eal/e

[dpdk-dev] [PATCH 32/41] crypto/qat: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- drivers/crypto/qat/qat_qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c index 87b9ce0..3f8ed4d 100644 --- a/drivers/crypto/qat/qat_qp.c +++ b/drivers/crypto/qat/qat_qp.c @@ -95

[dpdk-dev] [PATCH 34/41] net/bnx2x: use contiguous allocation for DMA memory

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_rxtx.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index fb02d0f..81f5dae 100644 --- a/drivers/net/bnx2x/bnx2x.c +++

[dpdk-dev] [PATCH 29/41] eal: add support for callbacks on memory hotplug

2018-03-03 Thread Anatoly Burakov
Each process will have its own callbacks. Callbacks will indicate whether it's allocation and deallocation that's happened, and will also provide start VA address and length of allocated block. Since memory hotplug isn't supported on FreeBSD and in legacy mem mode, it will not be possible to regis

[dpdk-dev] [PATCH 27/41] eal: add multiprocess init with memory hotplug

2018-03-03 Thread Anatoly Burakov
for legacy memory mode, attach to primary's memseg list, and map hugepages as before. for non-legacy mode, preallocate all VA space and then do a sync of local memory map. Signed-off-by: Anatoly Burakov --- lib/librte_eal/bsdapp/eal/eal_hugepage_info.c | 7 ++ lib/librte_eal/common/eal_commo

[dpdk-dev] [PATCH 20/41] eal: add backend support for contiguous allocation

2018-03-03 Thread Anatoly Burakov
No major changes, just add some checks in a few key places, and a new parameter to pass around. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memzone.c | 20 +++--- lib/librte_eal/common/malloc_elem.c| 101 ++--- lib/librte_eal/common/malloc

[dpdk-dev] [PATCH 30/41] eal: enable callbacks on malloc/free and mp sync

2018-03-03 Thread Anatoly Burakov
Also, rewrite VFIO to rely on memory callbacks instead of manually registering memory with VFIO. Callbacks will only be registered if VFIO is enabled. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_heap.c| 21 + lib/librte_eal/linuxapp/eal/eal_memalloc.c

[dpdk-dev] [PATCH 28/41] eal: add support for multiprocess memory hotplug

2018-03-03 Thread Anatoly Burakov
This enables multiprocess synchronization for memory hotplug requests at runtime (as opposed to initialization). Basic workflow is the following. Primary process always does initial mapping and unmapping, and secondary processes always follow primary page map. Only one allocation request can be ac

[dpdk-dev] [PATCH 21/41] eal: enable reserving physically contiguous memzones

2018-03-03 Thread Anatoly Burakov
This adds a new set of _contig API's to rte_memzone. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memzone.c | 44 lib/librte_eal/common/include/rte_memzone.h | 154 2 files changed, 198 insertions(+) diff --git a/lib/librte_eal/comm

[dpdk-dev] [PATCH 11/41] eal: add "legacy memory" option

2018-03-03 Thread Anatoly Burakov
This adds a "--legacy-mem" command-line switch. It will be used to go back to the old memory behavior, one where we can't dynamically allocate/free memory (the downside), but one where the user can get physically contiguous memory, like before (the upside). For now, nothing but the legacy behavior

[dpdk-dev] [PATCH 19/41] eal: add API to check if memory is contiguous

2018-03-03 Thread Anatoly Burakov
This will be helpful down the line when we implement support for allocating physically contiguous memory. We can no longer guarantee physically contiguous memory unless we're in IOVA_AS_VA mode, but we can certainly try and see if we succeed. In addition, this would be useful for e.g. PMD's who may

[dpdk-dev] [PATCH 04/41] eal: add function to dump malloc heap contents

2018-03-03 Thread Anatoly Burakov
Malloc heap is now a doubly linked list, so it's now possible to iterate over each malloc element regardless of its state. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/include/rte_malloc.h | 9 + lib/librte_eal/common/malloc_elem.c| 24 lib/l

[dpdk-dev] [PATCH 13/41] eal: replace memseg with memseg lists

2018-03-03 Thread Anatoly Burakov
Before, we were aggregating multiple pages into one memseg, so the number of memsegs was small. Now, each page gets its own memseg, so the list of memsegs is huge. To accommodate the new memseg list size and to keep the under-the-hood workings sane, the memseg list is now not just a single list, bu

[dpdk-dev] [PATCH 15/41] eal: add support for unmapping pages at runtime

2018-03-03 Thread Anatoly Burakov
This isn't used anywhere yet, but the support is now there. Also, adding cleanup to allocation procedures, so that if we fail to allocate everything we asked for, we can free all of it back. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_memalloc.h | 3 + lib/librte_eal/lin

[dpdk-dev] [PATCH 26/41] eal: prepare memseg lists for multiprocess sync

2018-03-03 Thread Anatoly Burakov
In preparation for implementing multiprocess support, we are adding a version number and write locks to memseg lists. There are two ways of implementing multiprocess support for memory hotplug: either all information about mapped memory is shared between processes, and secondary processes simply a

[dpdk-dev] [PATCH 08/41] eal: make malloc free return resulting malloc element

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_elem.c | 4 ++-- lib/librte_eal/common/malloc_elem.h | 2 +- lib/librte_eal/common/malloc_heap.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/ma

[dpdk-dev] [PATCH 12/41] eal: read hugepage counts from node-specific sysfs path

2018-03-03 Thread Anatoly Burakov
For non-legacy memory init mode, instead of looking at generic sysfs path, look at sysfs paths pertaining to each NUMA node for hugepage counts. Note that per-NUMA node path does not provide information regarding reserved pages, so we might not get the best info from these paths, but this saves us

[dpdk-dev] [PATCH 07/41] eal: make malloc free list remove public

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_elem.c | 12 ++-- lib/librte_eal/common/malloc_elem.h | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c index 2291ee1..008f5a3

[dpdk-dev] [PATCH 02/41] eal: move all locking to heap

2018-03-03 Thread Anatoly Burakov
Down the line, we will need to do everything from the heap as any alloc or free may trigger alloc/free OS memory, which would involve growing/shrinking heap. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_elem.c | 16 ++-- lib/librte_eal/common/malloc_heap.c | 38 +++

[dpdk-dev] [PATCH 03/41] eal: make malloc heap a doubly-linked list

2018-03-03 Thread Anatoly Burakov
As we are preparing for dynamic memory allocation, we need to be able to handle holes in our malloc heap, hence we're switching to doubly linked list, and prepare infrastructure to support it. Since our heap is now aware where are our first and last elements, there is no longer any need to have a

[dpdk-dev] [PATCH 01/41] eal: move get_virtual_area out of linuxapp eal_memory.c

2018-03-03 Thread Anatoly Burakov
Move get_virtual_area out of linuxapp EAL memory and make it common to EAL, so that other code could reserve virtual areas as well. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_memory.c | 101 ++ lib/librte_eal/common/eal_private.h | 33 +++

[dpdk-dev] [PATCH 06/41] eal: make malloc_elem_join_adjacent_free public

2018-03-03 Thread Anatoly Burakov
We need this function to join newly allocated segments with the heap. Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_elem.c | 6 +++--- lib/librte_eal/common/malloc_elem.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/malloc_elem.c

[dpdk-dev] [PATCH 00/41] Memory Hotplug for DPDK

2018-03-03 Thread Anatoly Burakov
This patchset introduces dynamic memory allocation for DPDK (aka memory hotplug). Based upon RFC submitted in December [1]. Dependencies (to be applied in specified order): - IPC bugfixes patchset [2] - IPC improvements patchset [3] - IPC asynchronous request API patch [4] - Function to return num

[dpdk-dev] [PATCH 05/41] test: add command to dump malloc heap contents

2018-03-03 Thread Anatoly Burakov
Signed-off-by: Anatoly Burakov --- test/test/commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test/commands.c b/test/test/commands.c index cf0b726..6bfdc02 100644 --- a/test/test/commands.c +++ b/test/test/commands.c @@ -137,6 +137,8 @@ static void cmd_dump_parsed(void *pars

Re: [dpdk-dev] [PATCH] eal: add asynchronous request API to DPDK IPC

2018-03-03 Thread Burakov, Anatoly
On 02-Mar-18 6:51 PM, Stephen Hemminger wrote: On Tue, 27 Feb 2018 14:59:29 + Anatoly Burakov wrote: This API is similar to the blocking API that is already present, but reply will be received in a separate callback by the caller. Under the hood, we create a separate thread to deal with r

Re: [dpdk-dev] [PATCH] eal: add asynchronous request API to DPDK IPC

2018-03-03 Thread Burakov, Anatoly
On 02-Mar-18 6:48 PM, Stephen Hemminger wrote: On Tue, 27 Feb 2018 14:59:29 + Anatoly Burakov wrote: +rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts) { + struct sync_request *dummy; + struct async_request_shared_param *param = NULL; + struct rte_

Re: [dpdk-dev] Fwd: SR-IOV dpdk testpmd bonding does not work

2018-03-03 Thread Hekai Wang
Thanks , I forget do "set portlist " cmd. But there is another problem is 1. enable testpmd bond active-backup mode , do send packet test , packet backtrack ,from some port out and then this port back. 2. down the active physical link , then testpmd show receive LSC event ,show port info all , fi