Anatoly Burakov [Thu, 31 May 2018 09:51:00 +0000 (10:51 +0100)]
malloc: allow reserving biggest element
Add an internal-only function to allocate biggest element from
the heap. Nominally, it supports SOCKET_ID_ANY as its socket
argument, but it's essentially useless because other sockets
will only be allocated from if the entire heap on current or
specified socket is busy.
Still, asking to reserve a biggest element will allow fixing
race condition in memzone reserve that has been there for a
long time.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Anatoly Burakov [Thu, 31 May 2018 09:50:59 +0000 (10:50 +0100)]
malloc: add finding biggest free IOVA-contiguous element
Adding internal-only function to find biggest free IOVA-contiguous
malloc element. This is not exposed to external API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Anatoly Burakov [Thu, 31 May 2018 17:05:40 +0000 (18:05 +0100)]
malloc: fix pad erasing
Previously, when joining adjacent free elements, we were erasing
trailer and header, but did not erase the padding. Fix this by
accounting for padding on erase, and do not erase padding twice
by adjusting data pointer and data len to not include padding.
Fixes:
bb372060dad4 ("malloc: make heap a doubly-linked list")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Tue, 12 Jun 2018 09:46:16 +0000 (10:46 +0100)]
mem: provide thread-unsafe memseg list walk variant
Sometimes, user code needs to walk memseg list while being inside
a memory-related callback. Rather than making everyone copy around
the same iteration code and depending on DPDK internals, provide an
official way to do memseg_list_walk() inside callbacks.
Also, remove existing reimplementation from memalloc code and use
the new API instead.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Tue, 12 Jun 2018 09:46:15 +0000 (10:46 +0100)]
mem: provide thread-unsafe memseg walk variant
Sometimes, user code needs to walk memseg list while being inside
a memory-related callback. Rather than making everyone copy around
the same iteration code and depending on DPDK internals, provide an
official way to do memseg_walk() inside callbacks.
Also, remove existing reimplementation from sPAPR VFIO code and use
the new API instead.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Tue, 12 Jun 2018 09:46:14 +0000 (10:46 +0100)]
mem: provide thread-unsafe contig walk variant
Sometimes, user code needs to walk memseg list while being inside
a memory-related callback. Rather than making everyone copy around
the same iteration code and depending on DPDK internals, provide an
official way to do memseg_contig_walk() inside callbacks.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 31 May 2018 16:11:47 +0000 (17:11 +0100)]
mem: mark pages as freeable on exit
When rte_eal_cleanup() is called, it is expected that DPDK will be able to
release all of its memory back to the system. However, if pages are marked
as unfreeable, the pages will not be released back. Fix this to mark all
pages as freeable on calling rte_eal_cleanup(), but only do it for primary
process, as secondaries can come and go.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:42 +0000 (21:55 +0100)]
mem: allocate in reverse to reduce fragmentation
Currently, all hugepages are allocated from lower VA address to
higher VA address, while malloc heap allocates from higher VA
address to lower VA address. This results in heap fragmentation
over time due to multiple reserves leaving small space below the
allocated elements.
Fix this by allocating VA memory from the top, thereby reducing
fragmentation and lowering overall memory usage.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:41 +0000 (21:55 +0100)]
test/fbarray: add autotests
Introduce a suite of autotests to cover functionality of fbarray.
This will check for invalid parameters, check API return values and
errno codes, and will also do some basic functionality checks on the
indexing code.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:40 +0000 (21:55 +0100)]
fbarray: add reverse finding of contiguous
Add a function to return starting point of current contiguous
block, going backwards. All semantics are kept the same as the
existing function, with the only difference being that given the
same input, results will be returned in reverse order.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:39 +0000 (21:55 +0100)]
fbarray: add reverse finding of chunk
Add a function to look for N used/free slots, but going backwards
instead of forwards. All semantics are kept similar to the existing
function, with the difference being that given the same input, the
same results will be returned in reverse order.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:38 +0000 (21:55 +0100)]
fbarray: add reverse finding
Add function to look up used/free indexes starting from specified
index, but going backwards instead of forward. Semantics are kept
similar to the existing function, except for the fact that, given
the same input, the results returned will be in reverse order.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:37 +0000 (21:55 +0100)]
fbarray: reduce duplication in element finding
Just code move to put all checks and calls in one place.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:36 +0000 (21:55 +0100)]
fbarray: reduce duplication in chunk finding
Mostly code move, aside from more quick checks done to avoid
doing computations in obviously hopeless cases.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:35 +0000 (21:55 +0100)]
fbarray: reduce duplication in contiguous finding
Mostly a code move, to have all code related to find_contig in
one place. This slightly changes the API in that previously,
calling find_contig_free() on a full fbarray would've been
an error, but equivalent call to find_contig_used() on an empty
array does not return an error, leading to an inconsistency in
the API.
The decision was made to not treat this condition as an error,
because it is equivalent to calling find_contig() on an index
that just happens to be used/free, which is not an error and
will return 0.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Mon, 11 Jun 2018 20:55:34 +0000 (21:55 +0100)]
fbarray: fix errno values returned from functions
Errno values are supposed to be positive, yet they were negative.
This changes API, so not backporting.
Fixes:
c44d09811b40 ("eal: add shared indexed file-backed array")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 28 Jun 2018 11:41:49 +0000 (12:41 +0100)]
mem: make segment preallocation OS-specific
In the perfect world, it wouldn't matter how much memory was
preallocated because most of it was always going to be private
anonymous zero-page mappings for the duration of the program.
However, in practice, due to peculiarities of FreeBSD, we need
to additionally limit memory allocation there. This patch moves
the segment preallocation to EAL private functions that will be
implemented by an OS-specific EAL rather than being in the common
memory-related code.
Since there is no support for growing/shrinking memory use at
runtime on FreeBSD anyway, this does not inhibit any functionality
but makes core dumps faster even on default settings.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 28 Jun 2018 11:41:48 +0000 (12:41 +0100)]
eal/bsd: concatenate adjacent memory segments
Previously, memory allocator always left holes between mapped
contigmem segments, even if they were IOVA-contiguous. Fix this
by remembering last IOVA address and memseg index, and checking
against those when mapping new contigmem segments.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Anatoly Burakov [Thu, 28 Jun 2018 11:41:47 +0000 (12:41 +0100)]
eal/bsd: fix memory segment index display
Segment index was set to 0 at start but was never incremented.
This has no consequences other than displayed number of segments
allocated at initialization. Fix this by incrementing it after
displaying.
Fixes:
66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Tue, 10 Jul 2018 10:44:47 +0000 (12:44 +0200)]
eal: fix return codes on control thread failure
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 negative errnos. They
always returns positive ones, so this patch negates their
return values before returning.
Fixes:
9e5afc72c909 ("eal: add function to create control threads")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Dariusz Stojaczyk [Tue, 10 Jul 2018 10:44:46 +0000 (12:44 +0200)]
eal: fix return codes on thread naming failure
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
before returning.
Fixes:
3901ed99c2f8 ("eal: fix thread naming on FreeBSD")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Dariusz Stojaczyk [Tue, 10 Jul 2018 10:44:45 +0000 (12:44 +0200)]
eal: ignore failure of naming a control thread
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 <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Dariusz Stojaczyk [Mon, 18 Jun 2018 19:53:09 +0000 (21:53 +0200)]
mem: do not use --base-virtaddr in secondary processes
Since secondary process' address space is highly dictated
by the primary process' mappings, it doesn't make much
sense to use base-virtaddr for secondary processes.
This patch is intended to fix PCI resource mapping
in secondary processes using the same base-virtaddr
as their primary processes. PCI uses the end of the hugepage
memory area to map all resources. [pci_find_max_end_va()]
It works for primary processes, but can't be mapped 1:1
by secondary ones, as the same addresses are currently always
occupied by shadow memseg lists, which were created with
eal_get_virtual_area(NULL, ...).
```
PRIMARY PROCESS
0x6e00e00000 388K rw-s- fbarray_memseg-2048k-1-3
0x6e01000000 16777216K r---- [ anon ]
0x7201000000 16K rw-s- resource0
SECONDARY PROCESS
0x6e00e00000 388K rw-s- fbarray_memseg-2048k-1-3
0x6e01000000 16777216K r---- [ anon ]
0x7201000000 4K rw-s- fbarray_memseg-1048576k-0-0_203213
```
Fixes:
524e43c2ad9a ("mem: prepare memseg lists for multiprocess sync")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Fri, 15 Jun 2018 15:13:04 +0000 (17:13 +0200)]
mem: fix alignment requested with --base-virtaddr
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!" and let the system
pick an address instead. As a result, this breaks secondary
process support on many system configurations.
Fixes:
b7cc54187ea4 ("mem: move virtual area function in common directory")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Wed, 13 Jun 2018 19:08:14 +0000 (21:08 +0200)]
mem: fix alignment of requested virtual areas
Although the alignment mechanism works as intended, the
`no_align` bool flag was set incorrectly. We were aligning
buffers that didn't need extra alignment, and weren't
aligning ones that really needed it.
Fixes:
b7cc54187ea4 ("mem: move virtual area function in common directory")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Mon, 4 Jun 2018 05:33:41 +0000 (07:33 +0200)]
mem: avoid crash on memseg query with invalid address
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.
Fixes:
66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Fri, 1 Jun 2018 12:59:20 +0000 (14:59 +0200)]
mem: do not unmap overlapping region on mmap failure
This isn't documented in the manuals, but a failed
mmap(..., MAP_FIXED) may still unmap overlapping
regions. In such case, we need to remap these regions
back into our address space to ensure mem contiguity.
We do it unconditionally now on mmap failure just to
be safe.
Verified on Linux 4.9.0-4-amd64. I was getting
ENOMEM when trying to map hugetlbfs with no space
left, and the previous anonymous mapping was still
being removed.
Fixes:
582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Dariusz Stojaczyk [Fri, 1 Jun 2018 12:59:19 +0000 (14:59 +0200)]
mem: do not leave unmapped holes in EAL memory area
EAL reserves a huge area in virtual address space
to provide virtual address contiguity for e.g.
future memory extensions (memory hotplug). During
memory hotplug, if the hugepage mmap succeeds but
doesn't suffice EAL's requiriments, the EAL would
unmap this mapping straight away, leaving a hole in
its virtual memory area and making it available
to everyone. As EAL still thinks it owns the entire
region, it may try to mmap it later with MAP_FIXED,
possibly overriding a user's mapping that was made
in the meantime.
This patch ensures each hole is mapped back by EAL,
so that it won't be available to anyone else.
Fixes:
582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Nelio Laranjeiro [Wed, 11 Jul 2018 06:49:35 +0000 (08:49 +0200)]
ethdev: fix flow expansion matching types
Node RSS types are generally covering more RSS kind than the user is
requesting, it should accept to expand even if only a single bit is
remains after masking. Setting the correct RSS kind for the rule
remains the driver job.
Fixes:
4ed05fcd441b ("ethdev: add flow API to expand RSS flows")
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Xueming Li [Sat, 26 May 2018 15:15:20 +0000 (23:15 +0800)]
app/testpmd: distribute queues to cores
Current topology distribute forwarding streams to lcores by port, this
make unbalanced loading when port number larger than 2:
lcore 0: P0Q0->P1Q0, P0Q1->P1Q1
locre 1: P1Q0->P0Q0, P1Q1->P0Q1
If only one port has traffic, only one locre get fully loaded and the
other one get no forwarding. Performance is bad as only one core doing
forwarding in such case.
This patch distributes forwarding streams by queue, try to get streams
of each port handled by different lcore:
lcore 0: P0Q0->P1Q0, P1Q0->P1Q0
locre 1: P0Q1->P0Q1, P1Q1->P0Q1
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 17:00:01 +0000 (10:00 -0700)]
hash: add API to query the key count
Add a new function, rte_hash_count, to return the number of keys that
are currently stored in the hash table. Corresponding test functions are
added into hash_test and hash_multiwriter test.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 17:00:00 +0000 (10:00 -0700)]
test/hash: add test for read/write concurrency
This commits add a new test case for testing read/write concurrency.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:59 +0000 (09:59 -0700)]
test/hash: update for read/write concurrency perf
New code is added to support read-write concurrency for
rte_hash. Due to the newly added code in critial path,
the perf test is modified to show any performance impact.
It is still a single-thread test.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:58 +0000 (09:59 -0700)]
hash: support read/write concurrency
The existing implementation of librte_hash does not support read-write
concurrency. This commit implements read-write safety using rte_rwlock
and rte_rwlock TM version if hardware transactional memory is available.
Both multi-writer and read-write concurrency is protected by rte_rwlock
now. The x86 specific header file is removed since the x86 specific RTM
function is not called directly by rte hash now.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:57 +0000 (09:59 -0700)]
hash: move duplicated code into functions
This commit refactors the hash table lookup/add/del code
to remove some code duplication. Processing on primary bucket can
also apply to secondary bucket with same code.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:56 +0000 (09:59 -0700)]
hash: fix key slot size accuracy
This commit calculates the needed key slot size more
accurately. The previous local cache fix requires
the free slot ring to be larger than actually needed.
The calculation of the value is inaccurate.
Fixes:
5915699153d7 ("hash: fix scaling by reducing contention")
Cc: stable@dpdk.org
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:55 +0000 (09:59 -0700)]
hash: fix a multi-writer race condition
Current multi-writer implementation uses Intel TSX to
protect the cuckoo path moving but not the cuckoo
path searching. After searching, we need to verify again if
the same empty slot still exists at the beginning of the TSX
region. Otherwise another writer could occupy the empty slot
before the TSX region. Current code does not verify.
Fixes:
be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
Cc: stable@dpdk.org
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Yipeng Wang [Tue, 10 Jul 2018 16:59:54 +0000 (09:59 -0700)]
hash: fix multiwriter lock memory allocation
When malloc for multiwriter_lock, the align should be
RTE_CACHE_LINE_SIZE rather than LCORE_CACHE_SIZE.
Also there should be check to verify the success of
rte_malloc.
Fixes:
be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
Cc: stable@dpdk.org
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Pavan Nikhilesh [Tue, 3 Jul 2018 04:50:41 +0000 (10:20 +0530)]
mempool/octeontx: fix pool to aura mapping
HW needs each pool to be mapped to an aura set of 16 auras.
Previously, pool to aura mapping was considered to be 1:1.
Fixes:
02fd6c744350 ("mempool/octeontx: support allocation")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Radu Nicolau [Mon, 11 Jun 2018 10:03:23 +0000 (11:03 +0100)]
examples/l3fwd-power: add high/regular perf cores options
Added high/regular performance core pinning configuration options
that can be used in place of the existing 'config' option.
'--high-perf-cores CORELIST' option allow the user to specify a
high performance cores list; if this option is not used and the
'perf-config' option is used, the application will query the
system using the rte_power library in order to get a list of
available high performance cores. The cores that are considered
high performance are the cores that have turbo enabled.
'--perf-config (port,queue,hi_perf,lcore_index)'
option is similar to the existing config option, the cores are specified
as indices for bins containing high or regular performance cores.
Example:
l3fwd-power -l 6,7 -- -p 0xff \
--high-perf-cores 6 --perf-config="(0,0,0,0),(1,0,1,0)"
cores 6 and 7 are used, core 6 is specified as a high performance core.
port 0 queue 0 will use a regular performance core, index 0 (core 7)
port 1 queue 0 will use a high performance core, index 0 (core 6)
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Radu Nicolau [Mon, 11 Jun 2018 10:03:22 +0000 (11:03 +0100)]
test/power: add unit test for get capabilities API
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Radu Nicolau [Mon, 11 Jun 2018 10:03:21 +0000 (11:03 +0100)]
power: add get capabilities API
New API added, rte_power_get_capabilities(), that allows the
application to query the power and performance capabilities
of the CPU cores.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Jasvinder Singh [Tue, 10 Jul 2018 20:43:39 +0000 (21:43 +0100)]
examples/ip_pipeline: remove commands restriction
Currently, some CLI commands (for examples- add or delete pipeline
table entries, add meter profile etc.) fails to execute when
application pipeline threads are not running. Therefore,
command for enabling pipeline on the thread is required to be
executed first or specified in the script file before any of
such commands.
This patch removes above restriction and adds support for
executing all CLI commands regardless of the pipeline thread state.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:16 +0000 (18:21 +0100)]
app/testpmd: rework softnic forward mode
Modied the testpmd softnic forwarding mode as per the
changes in softnic PMD.
To run testpmd application with softnic fwd mode, following
command is used;
$ ./testpmd -c 0xc -n 4 --vdev 'net_softnic0,firmware=script.cli'
-- -i --forward-mode=softnic
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:15 +0000 (18:21 +0100)]
net/softnic: add firmware script
Add default firmware script for softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:14 +0000 (18:21 +0100)]
net/softnic: implement start and stop
Implements softnic start and stop function.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:13 +0000 (18:21 +0100)]
net/softnic: setup Rx/Tx queues
Implements softnic receive and transmit queues setup using swq object.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:12 +0000 (18:21 +0100)]
net/softnic: add command for TTL action
Add cli commands for ttl action in softnic pipeline objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:11 +0000 (18:21 +0100)]
net/softnic: add command for meter action
Add cli commands for meter action in softnic pipeline objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:10 +0000 (18:21 +0100)]
net/softnic: add command to read stats
Add cli commands to read port and table stats of
softnic pipeline objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:09 +0000 (18:21 +0100)]
net/softnic: add command for pipeline table entries
Add cli commands for table entries in softnic pipeline objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:08 +0000 (18:21 +0100)]
net/softnic: add command to enable/disable pipeline
Add cli commands to enable and disable pipelines on specific threads in
softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 8 Jun 2018 12:41:48 +0000 (13:41 +0100)]
net/softnic: add command to create objects
Add cli commands to create softnic objects such as mempool, swq,
pipeline, etc.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:06 +0000 (18:21 +0100)]
net/softnic: add connection agent
Add connection agent to enable connectivity with external agent
(e.g. telnet, netcat, Python script, etc).
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 8 Jun 2018 12:41:46 +0000 (13:41 +0100)]
net/softnic: add command interface
Add interface for softnic cli commands.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Cristian Dumitrescu [Wed, 11 Jul 2018 12:43:09 +0000 (13:43 +0100)]
net/softnic: add run API
Implements softnic API function to run pipeline objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:03 +0000 (18:21 +0100)]
net/softnic: add thread
Add thread data structure and init function to run softnic pipelines
objects.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:02 +0000 (18:21 +0100)]
net/softnic: add pipeline object
Add pipeline object implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:01 +0000 (18:21 +0100)]
net/softnic: add table action profile
Add pipeline's table action profile implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:21:00 +0000 (18:21 +0100)]
net/softnic: add port action profile
Add pipeline's port action profile implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:59 +0000 (18:20 +0100)]
net/softnic: add traffic manager object
Add traffic manager(tmgr) object to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:58 +0000 (18:20 +0100)]
net/softnic: add tap object
Add tap object implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:57 +0000 (18:20 +0100)]
net/softnic: add mempool object
Add mempool object implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:56 +0000 (18:20 +0100)]
net/softnic: add link object
Add link object implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:55 +0000 (18:20 +0100)]
net/softnic: add software queue object
Add swq object implementation to the softnic.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Jasvinder Singh [Fri, 6 Jul 2018 17:20:54 +0000 (18:20 +0100)]
net/softnic: restructure
Rework the softnic implementation to have flexiblity in enabling
more features to its receive and transmit data path.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Kevin Laatz [Fri, 22 Jun 2018 14:31:47 +0000 (15:31 +0100)]
examples/ip_pipeline: add link command
Add the functionality to track links in the application. This enables the
user to print the name, mac address and statistics for each link
in the application.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Hemant Agrawal [Thu, 21 Jun 2018 09:15:14 +0000 (14:45 +0530)]
raw/dpaa2_qdma: fix IOVA as VA flag
Fixes:
b1ee472fed58 ("raw/dpaa2_qdma: introduce the DPAA2 QDMA driver")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:12 +0000 (13:40 +0530)]
bus/dpaa: support scatter/gather config
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:11 +0000 (13:40 +0530)]
net/dpaa: move the push queue set to global init
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:10 +0000 (13:40 +0530)]
drivers: support function name in NXP logs
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:09 +0000 (13:40 +0530)]
bus/fslmc: cleanup unnecessary global variables
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:08 +0000 (13:40 +0530)]
bus/dpaa: cleanup unnecessary global variables
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:07 +0000 (13:40 +0530)]
net/dpaa: remove experimental tag from PMD API
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:06 +0000 (13:40 +0530)]
net/dpaa: support default queue mode
In case DPAA FMAN configuration tool (FMC) is not available,
the system can still work with default queue(1 queue per port).
This patch also fixes some logs related to FQ ids, which were
idetified while testing this support.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Nipun Gupta [Fri, 6 Jul 2018 08:10:05 +0000 (13:40 +0530)]
bus/dpaa: make vdqcr configurable
This patch add support for configurable vdqcr exact flag.
This boost the performance, however this can give
side effects for some extra packet fetch. Which has been
taken care in the patch as well.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Akhil Goyal [Fri, 6 Jul 2018 08:10:04 +0000 (13:40 +0530)]
bus/dpaa: add API to get MAC address
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:03 +0000 (13:40 +0530)]
bus/dpaa: optimize fq callback routine
Avoid array of fq as packets are dq only from a single q.
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:02 +0000 (13:40 +0530)]
net/dpaa2: fix prefetch Rx to honor number of packets
This patch fixes prefetch rx routine to
set the next prefetch request to the size of nb_pkts.
It assumes that next request would ideally be
of same size.
Fixes:
4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:01 +0000 (13:40 +0530)]
net/dpaa: fix queue error handling and logs
Fixes:
5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:10:00 +0000 (13:40 +0530)]
bus/dpaa: fix buffer offset setting in FMAN
The buffer offset was incorrectly being set at 64,
thus not honoring the packet headroom.
Fixes:
6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Hemant Agrawal [Fri, 6 Jul 2018 08:09:59 +0000 (13:39 +0530)]
bus/dpaa: fix SVR id fetch location
Otherwise the SVR may not be available for dpaa init.
Fixes:
3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Alok Makhariya [Fri, 6 Jul 2018 08:09:58 +0000 (13:39 +0530)]
bus/dpaa: fix phandle support for Linux 4.16
Fixes:
2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
Cc: stable@dpdk.org
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Sachin Saxena [Wed, 4 Jul 2018 09:54:45 +0000 (15:24 +0530)]
mk: change TLS model for DPAA machine
Random corruptions observed on platfoms with using
the dpdk library in shared mode with VPP software (plugin).
using traditional TLS scheme resolved the issue.
Tested with VPP with DPDK as a plugin.
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Honnappa Nagarahalli [Thu, 31 May 2018 15:30:49 +0000 (10:30 -0500)]
hash: validate hash bucket entries while compiling
Validate RTE_HASH_BUCKET_ENTRIES during compilation instead of
run time.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:19 +0000 (11:31 +0100)]
net/kni: fix check for meson build
The configuration value indicating that KNI was build was incorrect,
causing the driver to never be built.
Fixes:
3479586fe636 ("net/kni: add to meson build")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:18 +0000 (11:31 +0100)]
net/avp: fix 32-bit meson builds
When compiling with meson, extra warnings are enabled about casting from
integers to different size pointers. This triggers an error in AVP as the
addition of the offset to the pointer address causes the result to be a
64-bit integer which doesn't fit a 32-bit pointer. The fix here is to
explicitly indicate that the offset is of type "uintptr_t" which prevents
any promotion which would cause errors.
Fixes:
c0ad584222b5 ("net/avp: add device initialization")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:17 +0000 (11:31 +0100)]
examples/kni: fix dependency check for meson build
Rather than hard-coding the example app to be built only when a set of
conditions are met, we can simplify things by having the app built when
KNI library itself is available. That saves us duplicating the same set
of restrictions on both library and example app.
Fixes:
89f0711f9ddf ("examples: build some samples with meson")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:16 +0000 (11:31 +0100)]
bus/dpaa2: fix default IOVA setting for meson builds
By default, the DPAA2_USE_PHYS_IOVA setting with the make build-system
is "y", which is overridden to "n" in the config file specifically for
the arm64-dpaa2-linuxapp-gcc builds. The lack of this setting in meson
builds causes issues for 32-bit build, as the alternative code paths
have compiler warnings e.g. for i686 builds. Therefore we should align
the meson and make settings, setting the value to "true" by default and
overriding it to "false" for dpaa2-specific builds.
Fixes:
6ec78c2463ac ("build: add meson support for dpaaX platforms")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:15 +0000 (11:31 +0100)]
build: disable pointer to int warnings for 32-bit
Converting a 32-bit pointer to a 64-bit integer is generally safe, but
generates a lot of warnings when compiling 32-bit code with meson. The
warnings are not flagged when using make, so just disable them for
32-bit meson builds.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:14 +0000 (11:31 +0100)]
net/sfc: disable for 32-bit builds
The sfc driver is not supported on 32-bit so disable in meson in
those cases.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:13 +0000 (11:31 +0100)]
bpf: fix 32-bit build support with meson
The JIT is only supported on x86_64 so disable for 32-bit builds.
Fixes:
cc752e43e079 ("bpf: add JIT compilation for x86_64 ISA")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Tue, 3 Jul 2018 10:31:12 +0000 (11:31 +0100)]
kni: disable for 32-bit meson builds
The kni library is not supported on 32-bit so disable it for those
builds using meson.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Thomas Monjalon [Wed, 6 Jun 2018 13:50:27 +0000 (15:50 +0200)]
examples: make Linux environment check consistent
Some Makefiles are using CONFIG_RTE_EXEC_ENV and others
are using CONFIG_RTE_EXEC_ENV_LINUXAPP.
Use the latter one for consistency.
We could remove CONFIG_RTE_EXEC_ENV later if considered useless.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:35 +0000 (09:42 +0100)]
test/bpf: add test for external function call
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:34 +0000 (09:42 +0100)]
bpf: add extra validation for input BPF program
Add checks for:
- use/return uninitialized registers and/or stack data
- possible memory access boundaries violation
- invalid arguments for the function
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:33 +0000 (09:42 +0100)]
bpf: add extra information for external symbol definitions
Extend struct rte_bpf_xsym with new fields to provide information about:
- for variables - type and size
- for functions - number of arguments and type/size of each argument
and return value
Such information would allow validate code to perform
more extensive checking on input BPF program and catch
misbehaving BPF code.
That change would cause ABI/API breakage for librte_bpf.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Nikhil Rao [Thu, 28 Jun 2018 06:48:10 +0000 (12:18 +0530)]
eventdev: add callback for Rx adapter SW transfers
Add ability for application to register a callback function
for SW transfers, the callback can decide which packets can
be enqueued to the event device.
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Nikhil Rao [Mon, 2 Jul 2018 09:11:14 +0000 (14:41 +0530)]
test/event: add Rx adapter tests for interrupt driven queues
Add test for queue add and delete, the add/delete calls
also switch queues between poll and interrupt mode.
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Nikhil Rao [Mon, 2 Jul 2018 09:11:13 +0000 (14:41 +0530)]
eventdev: add interrupt driven queues to Rx adapter
Add support for interrupt driven queues when eth device is
configured for rxq interrupts and servicing weight for the
queue is configured to be zero.
A interrupt driven packet received counter has been added to
rte_event_eth_rx_adapter_stats.
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>