This adds a new flag to request reserved memzone to be IOVA
contiguous. This is useful for allocating hardware resources like
NIC rings/queues etc.For now, hugepage memory is always contiguous,
but we need to prepare the drivers for the switch.
No major changes, just add some checks in a few key places, and
a new parameter to pass around.
Also, add a function to check malloc element for physical
contiguousness. For now, assume hugepage memory is always
contiguous, while non-hugepage memory will be checked.
We will need to be able to remove entries from free lists from
heaps during certain events, such as rollbacks, or when freeing
memory to the system (where a previously element disappears and
thus can no longer be in the free list).
Down the line, we will need to join free segments to determine
whether the resulting contiguous free space is bigger than a
page size, allowing to free some memory back to the system.
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 dummy element at the end of
each heap, so get rid of that as well. Instead, let insert/remove/
join/split operations handle end-of-list conditions automatically.
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.
We already set IOVA addresses of memsegs and memzones to VA
address during initialization, so we don't need to check
whether we're in RTE_IOVA_VA mode anywhere else.
We already set IOVA addresses of memsegs and memzones to VA
address during initialization, so we don't need to check
whether we're in RTE_IOVA_VA mode anywhere else.
mem: do not use physical addresses in IOVA as VA mode
We already use VA addresses for IOVA purposes everywhere if we're in
RTE_IOVA_VA mode:
1) rte_malloc_virt2phy()/rte_malloc_virt2iova() always return VA addresses
2) Because of 1), memzone's IOVA is set to VA address on reserve
3) Because of 2), mempool's IOVA addresses are set to VA addresses
The only place where actual physical addresses are stored is in memsegs at
init time, but we're not using them anywhere, and there is no external API
to get those addresses (aside from manually iterating through memsegs), nor
should anyone care about them in RTE_IOVA_VA mode.
So, fix EAL initialization to allocate VA-contiguous segments at the start
without regard for physical addresses (as if they weren't available), and
use VA to set final IOVA addresses for all pages.
Fixes: 62196f4e0941 ("mem: rename address mapping function to IOVA") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Pablo de Lara [Wed, 28 Mar 2018 19:30:40 +0000 (20:30 +0100)]
maintainers: call out subtree committers
The MAINTAINERS file contains information of the maintainers
of the different components on DPDK.
However, it does not give any information on who maintains the
different subtrees which accept new commits for these components.
This commit adds a list of the subtree committers.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Jasvinder Singh [Thu, 29 Mar 2018 18:32:03 +0000 (19:32 +0100)]
examples/ip_pipeline: add l2fwd example
This patch add the configuration file for l2fwd example. It
includes commands to build the packet processing stage (pipeline),
defining action, add rules to its table, etc.
Jasvinder Singh [Thu, 29 Mar 2018 18:31:39 +0000 (19:31 +0100)]
examples/ip_pipeline: remove infra code
All the actions associated with application pipelines
tables and ports are now implemented using the new action
APIs. Therefore, thousands of lines of code are eliminated
from the application. The reduced code size is easier to
maintain and extend.
Jasvinder Singh [Thu, 29 Mar 2018 18:31:30 +0000 (19:31 +0100)]
pipeline: add port in action APIs
This API provides a common set of actions for pipeline input ports to speed
up application development.
Each pipeline input port can be assigned an action handler to be executed
on every input packet during the pipeline execution.
The pipeline library allows the user to define his own input port actions
by providing customized input port action handler. While the user can
still follow this process, this API is intended to provide a quicker
development alternative for a set of predefined actions.
The typical steps to use this API are:
* Define an input port action profile.
* Instantiate the input port action profile to create input port action
objects.
* Use the input port action to generate the input port action handler
invoked by the pipeline.
* Use the input port action object to generate the internal data structures
used by the input port action handler based on given action parameters.
Jasvinder Singh [Thu, 29 Mar 2018 18:31:20 +0000 (19:31 +0100)]
pipeline: add table action APIs
This API provides a common set of actions for pipeline tables to speed up
application development.
Each match-action rule added to a pipeline table has associated data
that stores the action context. This data is input to the table
action handler called for every input packet that hits the rule as
part of the table lookup during the pipeline execution.
The pipeline library allows the user to define his own table
actions by providing customized table action handlers (table
lookup) and complete freedom of setting the rules and their data
(table rule add/delete). While the user can still follow this
process, this API is intended to provide a quicker development
alternative for a set of predefined actions.
The typical steps to use this API are:
* Define a table action profile.
* Instantiate the table action profile to create table action objects.
* Use the table action object to generate the pipeline table action
handlers (invoked by the pipeline table lookup operation).
* Use the table action object to generate the rule data (for the
pipeline table rule add operation) based on given action parameters.
* Use the table action object to read action data (e.g. stats counters)
for any given rule.
Anatoly Burakov [Sat, 31 Mar 2018 17:08:13 +0000 (18:08 +0100)]
eal: provide API for querying valid socket ids
During lcore scan, find all socket ID's and store them, and
provide public API to query valid socket id's. This will break
the ABI, so bump ABI version.
Also, remove deprecation notice corresponding to this change.
Anatoly Burakov [Sat, 31 Mar 2018 17:06:16 +0000 (18:06 +0100)]
eal: add IPC asynchronous request
This API is similar to the blocking API that is already present,
but reply will be received in a separate callback by the caller
(callback specified at the time of request, rather than registering
for it in advance).
Under the hood, we create a separate thread to deal with replies to
asynchronous requests, that will just wait to be notified by the
main thread, or woken up on a timer.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Anatoly Burakov [Sat, 31 Mar 2018 17:06:15 +0000 (18:06 +0100)]
eal: rename IPC request as synchronous one
Rename rte_mp_request to rte_mp_request_sync to indicate
that this request will be done synchronously (as opposed to
asynchronous request, which comes in next patch).
Also, fix alphabetical ordering for .map file.
Suggested-by: Thomas Monjalon <thomas@monjalon.net> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Anatoly Burakov [Sat, 31 Mar 2018 17:06:14 +0000 (18:06 +0100)]
eal: rename IPC sync request to pending request
Originally, there was only one type of request which was used
for multiprocess synchronization (hence the name - sync request).
However, now that we are going to have two types of requests,
synchronous and asynchronous, having it named "sync request" is
very confusing, so we will rename it to "pending request". This
is internal-only, so no externally visible API changes.
Suggested-by: Jianfeng Tan <jianfeng.tan@intel.com> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Gcc-8 discovers issue with platform_mempool_ops.
rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Werror=stringop-truncation]
strncpy(mz->addr, ops_name, strlen(ops_name));
Since the ops_name is already checked for size, using strncpy
here is unnecessary; just use strcpy.
Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions") Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Remy Horton [Tue, 20 Feb 2018 16:05:59 +0000 (16:05 +0000)]
metrics: fix potential missing string termination
Fixes a potential memory overrun detected by Coverity.
This overrun cannot currently happen in practice because
rte_metrics_reg_names() explicitly forces the last name
character to be a NULL terminator.
This patches uses strlcpy instead of strncpy to copy name strings.
Coverity issue: 143434 Fixes: 349950ddb9c5 ("metrics: add information metrics library") Fixes: 710cab6f675a ("metrics: fix out of bound access") Signed-off-by: Remy Horton <remy.horton@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Bruce Richardson [Mon, 12 Mar 2018 11:32:59 +0000 (11:32 +0000)]
eal: support strlcpy function
The strncpy function is error prone for doing "safe" string copies, so
we generally try to use "snprintf" instead in the code. The function
"strlcpy" is a better alternative, since it better conveys the
intention of the programmer, and doesn't suffer from the non-null
terminating behaviour of it's n'ed brethern.
The downside of this function is that it is not available by default
on linux, though standard in the BSD's. It is available on most
distros by installing "libbsd" package.
This patch therefore provides the following in rte_string_fns.h to ensure
that strlcpy is available there:
* for BSD, include string.h as normal
* if RTE_USE_LIBBSD is set, include <bsd/string.h>
* if not set, fallback to snprintf for strlcpy
Using make build system, the RTE_USE_LIBBSD is a hard-coded value to "n",
but when using meson, it's automatically set based on what is available
on the platform.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
eal: add functions for previous power of 2 alignment
Add 32b and 64b API's to align the given integer to the previous power
of 2. Update common auto test to include test for previous power of 2 for
both 32 and 64bit integers.
This addresses potential issues where size_t and off_t can vary
on some platforms. For size_t the best way to format the value
is to use the z modifier to printf. For off_t need to cast to
long long to handle 64 bit offset on 32 bit platforms.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Fixes: fe93968722af ("net/mrvl: rename PMD as mvpp2") Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Pablo de Lara [Thu, 29 Mar 2018 10:36:45 +0000 (11:36 +0100)]
devtools: do not create kernel dir
get-maintainer script requires the creation of
some folders, including "kernel". Since now this folder
exists in DPDK folder, it is not required to create it.
Fixes: acaa9ee991b5 ("move kernel modules directories") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>