Dumping of devices in a unittest is useless. Instead, test whether
the test has been set up well - i.e. there are no devices.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The SYSFS_PCI_DEVICES is a constant that makes the PCI testing
difficult as it points to an absolute path. We remove using this
constant and introducing a function pci_get_sysfs_path that gives
the same value. However, the user can pass a SYSFS_PCI_DEVICES env
variable to override the path. It is now possible to create a fake
sysfs hierarchy for testing.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The current test_pci is just a single test case that tests the
blacklisting of devices. Rename it to test_pci_blacklist and call it
from the test_pci. The setup and cleanup are moved out of the
test_pci_blacklist entirely to cover all other tests.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The test unregisters all drivers before start. The drivers were stored
into a fixed-sized array. This is inflexible. This patch change this to
utilize a linked list for the same purpose.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
When a more complex resource (a file hierarchy) is needed, packing
every single file as a single resource would be very ineffective. For
that purpose, it is possible to pack the files into a tar archive,
extract it before test from the resource and finally clean up all the
created files.
This patch introduces functions resource_untar and resource_rm_by_tar
to perform those tasks. An example of using those functions is included
as a test.
A new dependency is required to build the app/test: libarchive.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
A resource can be written into the target filesystem by calling
resource_fwrite or resource_fwrite_file. Such file can be created
before a test is started and removed after the test finishes.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
To include resources from other source that the C source code we
can take advantage of the objcopy behaviour, i.e. packing of an
arbitrary file as an object file that is linked to the target program.
A linked object file is always accessible as a pair
extern const char beg_<name>;
extern const char end_<name>;
(extern const char siz_<name>;)
A unit test that packs the resource.c source file is included.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Certain internal mechanisms of DPDK access different file system
structures (e.g. /sys/bus/pci/devices). It is difficult to test
those cases automatically by a unit test when such path is not
hard-coded and there is no simple way how to distribute fake ones
with the current testing environment.
This patch adds a possibility to declare a resource embedded in
the test binary itself. The structure resource cover the generic
situation - it provides a name for lookup and pointers to the
embedded data blob. A resource is registered in a constructor by
the macro REGISTER_RESOURCE.
Some initial tests of simple resources is included and added into
the group_1.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The program objcopy uses non-standard conventions to name the
target and arch. Define the values for supported architectures
(tile and ppc_64 are missing).
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
This patch adds missing DEPDIRS to avoid any library referring to
symbols they are not linked against.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Add the missing external dependency to pthread to avoid referring to
symbols the library is not linked against.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
The --whole-archive argument is only required for plugins (drivers)
and libraries used by these plugins.
Currently it covers all libraries.
Reducing the scope of this argument slightly reduce final application size
when statically linked.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
As stated in the comment:
Order is important: from higher level to lower level
This is an attempt to make the layering order better respected.
It will help to restrict the --whole-archive scope for plugins.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Replace --no-as-needed linker flag with --as-needed flag, which will
only link libraries directly called by application.
It can be achieved now that the libraries dependencies are handled
properly.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
>From "man ld":
Using this option has a significant performance cost.
It is best to use it only when there are unavoidable
circular references between two or more archives.
Remove the option since it does not seem necessary.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
On a linker command line, the dependencies must be declared after
the libraries using them.
It will avoid some issues when building an application with static
libraries and --as-needed option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
--exclude became a positional option in tar 1.29, breaking the
test app filtering in "make install", causing .map files and all test
apps to get installed in bindir. Adjust the tar arguments accordingly,
this is compatible with older versions too since they do not care about
the order.
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1337864
Fixes: 6b62a72a70 ("mk: install a standard cutomizable tree")
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
The libraries rte_mempool and rte_ring are not used in EAL,
except for the ivshmem part (CONFIG_RTE_LIBRTE_IVSHMEM).
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
The log history uses rte_mempool. In order to remove the mempool
dependency in EAL (and improve the build), this feature is deprecated.
The ABI is kept but the behaviour is now voided because it seems this
function was not used. The history can be read from syslog.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Up to now dependencies between DPDK internal libraries have been
untracked at shared library level, requiring applications to know
about library internal dependencies and often consequently overlinking.
Since the dependencies are already recorded for build ordering in the
makefiles with DEPDIRS-y we can use that information to generate LDLIBS
entries for internal libraries automatically.
Also revert commit 8180554d82 ("vhost: fix linkage of driver with
library") which is made redundant by this change.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Fix broken console directive in the ABI validator section of the
ABI versioning docs.
Fixes: f1ef9794f9 ("doc: add ABI guidelines")
Signed-off-by: John McNamara <john.mcnamara@intel.com>
A previous patch modified the CLIs witout updating the examples.
Fixes: 53b2bb9b7e ("app/testpmd: new flow director commands")
Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Port needs to be stopped and then closed before it can be detached,
but the documentation was only saying to close the port.
Also, both sections for port detaching and attaching has been reformatted
slightly, to show clearly how to use the commands.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
prefetch the next packet data address in advance in forwarding loop
for performance improvement.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Enhance the logs related to mbuf pool creation. Display an info level
log when creating the mbuf, and display the error as a string on failure.
After the patch, we have:
[...]
EAL: probe driver: 8086:10fb rte_ixgbe_pmd
USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=331456, \
size=2176, socket=0
EAL: Error - exiting with code: 1
Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate \
memory
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
"port config all txqflags <value>" allows for
specifying txq_flags value in command line.
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
"port config all scatter on|off" allows for
controlling rxmode.enable_scatter in command line.
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This parameter allows for controlling rxmode.enable_scatter
which in turn allow for multi-segment packet receive tests.
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
qw app at its init stage reserve 2*sizeof(int) memory space for quota
and low_watermark shared variables, but both apps (qw and qwctl) assign
wrong address for low_watermark pointer (out of reserved memzone space)
due to wrong pointer arithmetic.
CID 30709 : Extra sizeof expression (SIZEOF_MISMATCH)
suspicious_pointer_arithmetic: Adding 4UL /* sizeof (int) */ to pointer
(unsigned int *)(*qw_memzone).addr of type unsigned int * is suspicious
because adding an integral value to this pointer automatically scales
that value by the size, 4 bytes, of the pointed-to type, unsigned int.
Most likely, sizeof (int) is extraneous and should be replaced with 1.
Coverity issue: 30709
Fixes: 1d6c3ee332 ("examples/quota_watermark: initial import")
Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
After extending IPv4 next hop in lpm library, size of dst_port array was
changed from 16 to 32 bits in l3fwd-thread example, without modification
of the rest of path written for 16 bit value.
This patch uses similar approach for fix, like in commit 8353a36a9b
("examples/l3fwd: fix size of destination port ids"), restoring 16 bit size
for destination port ids and doing necessary conversion from 32 to 16 bit
after lpm_lookupx4.
Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
This fixes wrong logic in get_dst_port() on lpm path causing unpredictable
return value when ipv4/ipv6 lookup success (return with no value).
Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
If no SSE nor NEON are available the l3fwd should complain loudly
to quickly find out the reason.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
l3fwd sets the mempool cache size to 256, selected the same value for l2fwd
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
The sample configuration file demonstrates that network layer components such
as TCP, UDP, ICMP etc, can be easily integrated into ip pipeline infrastructure.
Similarily, various other functionalities such as IP Reassembly for input
traffic with local destination and IP Fragmentation to enforce the MTU for
the routed output traffic, can be added using SWQs enabled with
reassembly and fragmentation features.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
The routing pipeline registers a callback function with the nic ports and
this function is invoked for updating the routing entries (corresponding to
local host and directly attached network) tables whenever the nic ports
change their states (up/down).
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
As a result of tracking, output ports of routing pipelines are linked with
physical nic ports (potentially through other pipeline instances).
Thus, the mac addresses of the NIC ports are assigned to routing pipeline
out ports which are connected to them and are further used in routing table
entries instead of hardcoded default values.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit implements tracking mechanism for linking routing pipeline
output ports to physical NIC ports.
Once all the pipelines of the application are initialised, mechanism is
invoked during post initialisation phase for relating routing pipeline
output with NIC ports by navigating through the intermediate pipelines,
if present.
The tracking functions of the pipelines which help in navigating through
the intermediate pipelines are moved from pipeline_<pipeline_name>_be.c
to pipeline_<pipeline_name>.c. All pipelines except passthrough pipelines
use default tracking function (pipeline/pipeline_common_fe.c).
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To allow more queues, pipeline types, threads, source/sink ports,etc., in
the ip pipeline application, larger values of macros are set.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This patch enables rss (receive side scaling) per network interface
through the configuration file. The user can specify following
parameters in LINK section for enabling the rss feature - rss_qs,
rss_proto_ipv4, rss_proto_ipv6 and ip_proto_l2.
The "rss_qs" is mandatory parameter which indicates the queues to be
used for rss, while rest of the parameters are optional. When optional
parameters are not provided in the configuration file, default setting
(ETH_RSS_IPV4 | ETH_RSS_IPV6) is assumed for "rss_hf" field of the
rss_conf structure.
For example, following configuration can be applied for using the rss
on port 0 of the network interface;
[PIPELINE0]
type = MASTER
core = 0
[LINK0]
rss_qs = 0 1
[PIPELINE1]
type = PASS-THROUGH
core = 1
pktq_in = RXQ0.0 RXQ0.1 RXQ1.0
pktq_out = TXQ0.0 TXQ1.0 TXQ0.1
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit adds following changes to configuration file parsing of
the ip pipeline application;
1. Parsing routines related to packet queues (pktq_in/out fields in the
PIPELINE section) and message queues (msgq_in/out fields of in the MSGQ
Section) are updated.
In the parsing routines, function "strtok_r()" is used for parsing the
string instead of manually checking the string termination, white
spaces, tabs etc., between the string tokens. Each call to strtok_r()
returns a pointer to a null-terminated string containing the next token.
If no more tokens are found, strtok_r() returns NULL. As a result of
using strtok_r(), the code size of the parsing routines is reduced
significantly.
2. Replace PARSER_PARAM_ADD_CHECK macro by more specific macros such as
PARSE_CHECK_DUPLICATE_SECTION, PARSE_CHECK_DUPLICATE_SECTION_EAL to detect
duplicate entries in the various sections of the configuration file
3. Add new macros PARSER_ERROR_NO_ELEMENTS and PARSE_ERROR_TOO_MANY_ELEMENTS
for detecting no element and more elements than allowed situations
respectively, in the section entry.
4. Add new macros APP_PARAM_ADD_LINK_FOR_RXQ, APP_PARAM_ADD_LINK_FOR_TXQ
and APP_PARAM_ADD_LINK_FOR_TM which add corresponding nic ports entry to
the application param structure while parsing rx/tx queues, TM (Traffic
Manager) port sections and pktq_in/out entries of pipeline sections
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Several routing commands are merged into two commands:
route and arp - these two commands are handled by cli library.
Rest of the commands are handled internaly by the pipeline code.
Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This patch modifies flow classifications pipeline command line
interface. All commands are merged into one cmd_fc_parsed.
Additionally a classification for ipv6, ipv4 and qinq can be added from
configuration file.
1. flow add qinq bulk
File line format:
qinq <svlan> <cvlan> port <port ID> id <flow ID>
File line example:
qinq 1 2 port 3 id 0
2. flow add ipv4 bulk
File line format:
ipv4 <sipaddr> <dipaddr> <sport> <dport> <proto> port <port ID> id
<flowID>
File line example:
ipv4 1.2.3.4 10.20.30.40 63 127 6 port 2 id 999
3. flow add ipv6 bulk
File line format:
ipv6 <sipaddr> <dipaddr> <sport> <dport> <proto> port <port ID> id
<flowID>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>