The Link bonding library is incorrectly using receive packet type flags
in the transmit policy hashing functions, which would cause packets
generated locally to be incorrectly distributed across the slave
devices. This patch completely removes the dependency on the packet
type flags and uses the ether_type from either the Ethernet header or
the VLAN headers for branching.
This patch also includes the associate changes in the test suite and in
the packet_burst_generator code to remove the dependences on the packet
type flags.
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Make sure that test_acl would not ignore error conditions.
Run classify() with all possible values.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This patch contains a fix for link bonding handling of vlan tagged packets in mode 3 and 5.
Currently xmit_slave_hash function misinterprets the PKT_RX_VLAN_PKT flag to mean that
there is a vlan tag within the packet when in actually means that there is a valid entry
in the vlan_tci field in the mbuf.
- Fixed VLAN tag support in hashing functions.
- Adds support for TCP in layer 4 header hashing.
- Splits transmit hashing function into separate functions for each policy to
reduce branching and to make the code clearer.
- Fixed incorrect flag set in test application packet generator.
Test report: http://dpdk.org/ml/archives/dev/2015-January/010792.html
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SunX Jiajia <sunx.jiajia@intel.com>
One occurrence call to strncmp had the closing brace in the wrong
place. Changing this form:
if (strncmp(X, Y, sizeof(X) != 0))
which does a comparison of length 1, to
if (strncmp(X, Y, sizeof(X)) != 0)
which does the correct length comparison and then compares the result
to zero in the "if" part.
Seen with clang-3.5:
"error: size argument in 'strncmp' call is a comparison"
This patch is similar to 261386248 but it looks that one occurrence
was forgotten.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
One of the test assertion macros was missing the "do" part of the
do-while. This issue was picked up by clang reporting an empty while
loop body for the closing while of the do-while pair.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
If mbuf allocation failed for whatever reason, we would get a NULL
pointer exception in test_table_acl.c:test_pipeline_single_filter test
case.
We fix this by causing an early break out of the application loop. If we
quit the test immediately we would leak any existing allocated mbufs,
but by breaking instead, we allow the test to continue and clean up the
mbufs already in the pipeline, while still having a test failure as the
mbuf counts should not match.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
In the kvargs test cases, we were checking for errors by checking if the
returned pointer value was NULL. In the error handling, we then tried to
free back the NULL pointer, which would cause a crash.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Since commit a155d4301 "support link bonding device initialization",
EAL probes drivers to the PCI devices in rte_eal_init,
then PCI resources are mapped if a device
is bound to igb_uio driver, for instance.
Therefore, test app probes all the devices and multiprocess unit test
tries to map resources twice in the secondary processes, and test fails,
caused by RTE_PCI_DRV_NEEDED_MAPPING flag in dummy pci driver my_driver2.
Test is fixed by setting the driver flags to 0.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Since commit b91c67e5a6,
maximum number of cores is 128, which has increase
the total memory necessary for a rte_mempool structure,
as the per-lcore local cache has been doubled in size.
Therefore, eal_flags unit test was broken since it needed
to use more hugepages.
Increased memory to 18MB, as that is the actual minimum memory necessary
(depending on the physical memory segments, DPDK may need less memory)
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Adding call to mac_address_slaves_update from the lsc handler when the
first slave become active to propagate any mac changes made while
devices are inactive
Changed removing slave logic to use memmove instead of memcpy to move
data within the same array, as this was corrupting the slave array.
Adding unit test to cover failing assignment scenarios
Test report: http://dpdk.org/ml/archives/dev/2014-December/009623.html
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SunX Jiajia <sunx.jiajia@intel.com>
When using test-pmd with flow director in FreeBSD, the application will
segfault/Bus error while parsing the command-line. This is due to how
each commands result structure is represented during parsing, where the offsets
for each tokens value is stored in a character array(char result_buf[BUFSIZ])
in cmdline_parse()(./lib/librte_cmdline/cmdline_parse.c).
The overflow occurs where BUFSIZ is less than the size of a commands result
structure, in this case "struct cmd_pkt_filter_result"
(app/test-pmd/cmdline.c) is 1088 bytes and BUFSIZ on FreeBSD is 1024 bytes as
opposed to 8192 bytes on Linux.
The problem can be reproduced by running test-pmd on FreeBSD:
./testpmd -c 0x3 -n 4 -- -i --portmask=0x3 --pkt-filter-mode=perfect
And adding a filter:
add_perfect_filter 0 udp src 192.168.0.0 1024 dst 192.168.0.0 1024 flexbytes
0x800 vlan 0 queue 0 soft 0x17
This patch removes the OS dependency on BUFSIZ and defines and uses a
library #define CMDLINE_PARSE_RESULT_BUFSIZE 8192
Added boundary checking to ensure this buffer size cannot overflow, with
an error message being produced.
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
http://git.droids-corp.org/?p=libcmdline.git;a=commitdiff;h=b1d5b169352e57df3fc14c51ffad4b83f3e5613f
Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
This Patch add unit tests for mode 5 - tlb - to the oders
link bonding unit tests.
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
CACHE_LINE_SIZE is a macro defined in machine/param.h in FreeBSD and
conflicts with DPDK macro version.
Adding RTE_ prefix to avoid conflicts.
CACHE_LINE_MASK and CACHE_LINE_ROUNDUP are also prefixed.
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
[Thomas: updated on HEAD, including PPC]
Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Curent implementation in test_memzone.c has bugs in finding the
second smallest memory segment. It's the last smallest memory segment,
but it's not the second smallest memory segment. This bug may cause test
failure in some cases. This patch fixes this bug.
Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
IBM Power architecture has different huge page sizes (16MB, 16GB) than
x86.This patch defines RTE_PGSIZE_16M and RTE_PGSIZE_16G in the
rte_page_sizes enum variable and adds huge page size support of DPDK
for IBM Power architecture.
Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
IBM Power architecture has different cache line size (128 bytes) than
x86 (64 bytes). This patch defines CACHE_LINE_SIZE to 128 bytes to
override the default value 64 bytes to support IBM Power Architecture.
Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
IBM Power processor doesn't have CPU flag hardware registers. This patch
uses aux vector software register to get CPU flags and add CPU flag
checking support for IBM Power architecture.
Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Updated the unit tests to cover both librte_power implementations as well as
the external API.
Signed-off-by: Alan Carew <alan.carew@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Enable users to specify the lcore id that is used as master lcore.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
In current version, used cores can only be specified using a bitmask.
It will now be possible to specify cores in 2 different ways:
- Using a bitmask (-c [0x]nnn): bitmask must be in hex format
- Using a list in following format: -l <c1>[-c2][,c3[-c4],...]
The letter -l can stand for lcore or list.
-l 0-7,16-23,31 being equivalent to -c 0x80FF00FF
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
No need to have different headers for Linux and BSD.
These files are identicals with exception of internal config which has
uio and vfio fields only useful for Linux.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Adding support for lsc interrupt from bonded device to link
bonding library with supporting unit tests in the test application.
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: SunX Jiajia <sunx.jiajia@intel.com>
This patch fixes two occurrences where a call to strncmp had the closing
brace in the wrong place. Changing this form:
if (strncmp(X,Y,sizeof(X) != 0))
which does a comparison of length 1, to
if (strncmp(X,Y,sizeof(X)) != 0)
which does the correct length comparison and then compares the result to
zero in the "if" part, as the author presumably originally intended.
Reported-by: Larry Wang <liang-min.wang@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
eal_flags and multiprocess unit tests use --file-prefix option
which is not supported in FreeBSD, so it has been removed
if compiled for this OS.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This field is added for librte_distributor. User of librte_distributor
is advocated to set value of mbuf->hash.usr before calling
rte_distributor_process. The value of usr is the tag which stands as
identifier of flow.
Signed-off-by: Qinglai Xiao <jigsaw@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The unit test can be used to measure cycles per packet in different rx/tx routines.
The NIC works in loopback mode. So it doesn't require test equipment to measure throughput.
As result, the unit test shows the average cycles per packet consuming.
When doing the test, make sure the link is UP.
Usage Example:
1. Run unit test app in interactive mode
app/test -c f -n 4 -- -i
2. Run and wait for the result
pmd_perf_autotest
There's option to choose rx/tx pair, default is vector.
set_rxtx_mode [vector|scalar|full|hybrid]
Note: To get acurate scalar fast, please choose 'vector' or 'hybrid' without INC_VEC=y in config
It supports to measure standalone rx or tx.
Usage Example:
Choose rx or tx standalone, default is both
set_rxtx_anchor [rxtx|rxonly|txonly]
It also supports to measure standalone RX burst cycles.
In this way, it won't repeat re-send received packets.
Now it measures two situations, poll before/after xmit(w or w/o desc. cache conflict)
Usage Example:
Set stream control mode, by default is continuous
set_rxtx_sc [continuous|poll_before_xmit|poll_after_xmit]
Test report: http://dpdk.org/ml/archives/dev/2014-October/007145.html
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Yong Liu <yong.liu@intel.com>
Add support to allow packet burst generator to create packets
in different sizes.
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Since commit a155d43011 ("support link bonding device initialization"),
rte_eal_pci_probe() is called in rte_eal_init().
pci_autotest called it to bind devices to the test_driver and test_driver2.
Therefore, the function is called twice and devices already allocated
will cause the test fail.
This patch solves that issue, unregistering all previous drivers before
calling rte_eal_pci_probe() for the first time, so DPDK does not try
to allocate data for the devices, binding them to their previous
drivers again.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
As a result of moving tailq's into local memory, some tailq data
is now reserved in rte_malloc heaps (because it needs to be
shared across DPDK processes). The first thing DPDK initializes
is a log mempool, and since it creates a tailq, it reserves
space in rte_malloc heap before allocating the mempool itself.
By default, rte_malloc allocates way more space than is necessary,
so under some conditions (namely, overall memory available is low)
this results in malloc heap eating up so much memory that log
mempool is not able to allocate its memzone.
This patch fixes the unit tests to account for that change.
Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Link bonding broadcast mode requires refcnt parameter in the mbuf struct to
allow efficient transmission of duplicated mbufs on slave ports.
This patch disables broadcast mode when the complication option RTE_MBUF_REFCNT
is disabled to allow clean building of the bonding library.
A warning message notify user of disabling of broadcast mode.
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The previous implementation of rte_kni_alloc() was allocating memzones with a
name composed of a fixed string and the interface name. When an application was
allocating and deallocating multiple interfaces with different names, memzones
were quickly exhausted, even though memzones from deallocated interfaces were
never used anymore (unless an interface with the same name was re-allocated).
As a result, the application was unable to allocate more KNI interfaces with
different names.
This patch implements the KNI memzone pool in order to prevent memzone
exhaustion when allocating/deallocating KNI interfaces. It adds a new API call,
rte_kni_init(max_kni_ifaces) that shall be called before any call to
rte_kni_alloc() if KNI is used. The memzones are pre-allocated with interface-
independent names so that they can be reused.
Signed-off-by: Marc Sune <marc.sune@bisdn.de>
Acked-by: Helin Zhang <helin.zhang@intel.com>
The four-byte-key (fbk) autotest was allocating the keys to be used for
the test on the stack. When the number of entries in the table was
increased significantly, for example, to test larger hashes by increase the
value of ENTRIES, this array of keys was greater than that
allowed on the stack, and so caused problems, i.e. crashes and core dumps.
The solution is to have the keys dynamically allocated on the heap using
malloc. Now if ENTRIES is increased and we run out of memory we get an
error message instead of a crash.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The function rte_snprintf() was deprecated in version 1.7.0
(commit 6f41fe75e2).
It's now totally removed.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Since commit a155d43011 ("support link bonding device initialization"),
rte_eal_pci_probe() is called in rte_eal_init().
So it doesn't have to be called by application anymore.
It has been fixed for testpmd in commit 2950a76931,
and this patch remove it from other applications.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This change splits the mbuf in two to move the pool and next pointers to
the second cache line. This frees up 16 bytes in first cache line.
The reason for this change is that we believe that there is no possible
way that we can ever fit all the fields we need to fit into a 64-byte
mbuf, and so we need to start looking at a 128-byte mbuf instead. Examples
of new fields that need to fit in, include -
* 32-bits more for filter information for support for the new filters in
the i40e driver (and possibly other future drivers)
* an additional 2-4 bytes for storing info on a second vlan tag to allow
drivers to support double Vlan/QinQ
* 4-bytes for storing a sequence number to enable out of order packet
processing and subsequent packet reordering
as well as potentially a number of other fields or splitting out fields
that are superimposed over each other right now, e.g. for the qos scheduler.
We also want to allow space for use by other non-Intel NIC drivers that may
be open-sourced to dpdk.org in the future too, where they support fields
and offloads that currently supported hardware doesn't.
If we accept the fact of a 2-cache-line mbuf, then the issue becomes
how to rework things so that we spread our fields over the two
cache lines while causing the lowest slow-down possible. The general
approach that we are looking to take is to focus the first cache
line on fields that are updated on RX , so that receive only deals
with one cache line. The second cache line can be used for application
data and information that will only be used on the TX leg. This would
allow us to work on the first cache line in RX as now, and have the
second cache line being prefetched in the background so that it is
available when necessary. Hardware prefetches should help us out
here. We also may move rarely used, or slow-path RX fields e.g. such
as those for chained mbufs with jumbo frames, to the second
cache line, depending upon the performance impact and bytes savings
achieved.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The mbuf structure already contains a pointer to the beginning of the
buffer (m->buf_addr). It is not needed to use 8 bytes again to store
another pointer to the beginning of the data.
Using a 16 bits unsigned integer is enough as we know that a mbuf is
never longer than 64KB. We gain 6 bytes in the structure thanks to
this modification.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
* Updated to apply to latest on mainline.
* Disabled vector PMD in config as it relies heavily on the mbuf layout
This will be re-enabled in a subsequent commit once vPMD has been
reworked to take account of mbuf changes.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
The vlan_macip structure combined a vlan tag id with l2 and l3 headers
lengths for tracking offloads. However, this structure was only used as
a unit by the e1000 and ixgbe drivers, not generally.
This patch removes the structure from the mbuf header and places the
fields into the mbuf structure directly at the required point, without
any net effect on the structure layout. This allows us to treat the vlan
tags and header length fields as separate for future mbuf changes. The
drivers which were written to use the combined structure still do so,
using a driver-local definition of it.
Reduce perf regression caused by splitting vlan_macip field. This is
done by providing a single uint16_t value to allow writing/clearing
the l2 and l3 lengths together. There is still a small perf hit to the
slow path TX due to the reads from vlan_tci and l2/l3 lengths being
separated. (<5% in my tests with testpmd with no extra params).
Unfortunately, this cannot be eliminated, without restoring the vlan
tags and l2/l3 lengths as a combined 32-bit field. This would prevent
us from ever looking to move those fields about and is an artificial tie
that applies only for performance in igb and ixgbe drivers. Therefore,
this patch keeps the vlan_tci field separate from the lengths as the
best solution going forward.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The rte_pktmbuf structure was initially included in the rte_mbuf
structure. This was needed when there was 2 types of mbuf (ctrl and
packet). As the control mbuf has been removed, we can merge the
rte_pktmbuf into the rte_mbuf structure.
Advantages of doing this:
- the access to mbuf fields is easier (ex: m->data instead of m->pkt.data)
- make the structure more consistent: for instance, there was no reason
to have the ol_flags field in rte_mbuf
- it will allow a deeper reorganization of the rte_mbuf structure in the
next commits, allowing to gain several bytes in it
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
[Bruce: updated for latest code and new example apps]
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The initial role of rte_ctrlmbuf is to carry generic messages (data
pointer + data length) but it's not used by the DPDK or it applications.
Keeping it implies:
- loosing 1 byte in the rte_mbuf structure
- having some dead code rte_mbuf.[ch]
This patch removes this feature. Thanks to it, it is now possible to
simplify the rte_mbuf structure by merging the rte_pktmbuf structure
in it. This is done in next commit.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
* Updated patch to HEAD.
* Modified patch to retain the old function names for ctrl mbufs as
macros. This helps with app compatibility, and allows the concept
of a control mbuf to be reintroduced via a single-bit flag in
a future change.
* Updated the packet framework ip_pipeline example application to
work following this change.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
It seems that RTE_MBUF_SCATTER_GATHER is not the proper name for the
feature it provides. "Scatter gather" means that data is stored using
several buffers. RTE_MBUF_REFCNT seems to be a better name for that
feature as it provides a reference counter for mbufs.
The macro RTE_MBUF_SCATTER_GATHER is poisoned to ensure this
modification is seen by drivers or applications using it.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Make ACL library to build/work on 'default' architecture:
- make rte_acl_classify_scalar really scalar
(make sure it wouldn't use sse4 instrincts through resolve_priority()).
- Provide two versions of rte_acl_classify code path:
rte_acl_classify_sse() - could be build and used only on systems with sse4.2
and upper, return -ENOTSUP on lower arch.
rte_acl_classify_scalar() - a slower version, but could be build and used
on all systems.
- Addition of a new function rte_acl_classify_alg. This function lets you
specify an enum value to override the acl contexts default algorithm when doing
a classification. This allows an application to specify a classification
algorithm without needing to publicize each method. I know there was concern
over keeping those methods public, but we don't have a static ABI at the moment,
so this seems to me a reasonable thing to do, as it gives us less of an ABI
surface to worry about.
- keep common code shared between these two codepaths.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Avoid building tests if their counterparts are not selected in config.
This has the nice side effect of fixing build errors when disabling parts of
the dpdk.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
The builtin commands list is now empty, we can remove it.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Remove all tests from the builtin commands list and use the dynamic commands
list register macro.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This patch adds a way to dynamically add a test without modifying commands.c.
Move all current tests in a builtin_commands[] list, next patch will convert
them to this new system.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This test is not linked to any code, remove it.
It may be some leftover from 24f42575df.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
refcnt field can not be accessed directly as it depends on the RTE_MBUF_REFCNT
build option.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
No need to test some build option multiple times in a Makefile.
Besides, such option is needed by the associated app, so move it at the
top of the Makefile.
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
- Fix bonding unit test suite which was failing due to a change
in pmd configuration behaviour introduced in commit
a130f53118 (add link state interrupt flag)
- Added fixes to allow the ability to re-run test suite from test
application without restarting application
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
- Adding common test assertion macros for unit testing
- Structs for encapsulating unit tests / test suites data.
- test suite runner method
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Rename structure and add a data pointer.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
As this unit test does not create devices anymore,
and uses devices created by EAL option --vdev,
there were unnecesary tests that were repeated,
so they have been removed.
So now there are three tests:
1 - Test two devices that share a ring, one device
with just one RX queue and the other with one
TX queue.
2 - Test a device connected to itself (loopback) by
a ring, with both RX and TX queue.
3 - Test two devices that share a ring, but both devices
with RX and TX queue, so they can send packets to themselves
and to the other device.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
In EAL flags unit test, vdev test was being included
(and broken) in whitelist test. It has been separated
in different test and fixed, by calling another
primary process, instead of a secondary one.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Cmdline unit test calls several functions that use snprintf,
with NULL pointer as the destination buffer. This patch
eliminates these NULL pointer tests.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
There were 2 typos since these commits (in 1.6.0 releases):
21a7f4e264 fix build without librte_cmdline
cac6d08c8b replace --use-device option by --pci-whitelist and --vdev
In makefiles, the build options are prefixed with CONFIG_RTE_
but in .c file, it is only RTE_.
These typos were disabling cmdline unit tests and test of "--vdev eth_ring" option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Including:
- code to generate packet bursts for testing rx and tx
functionality of bonded device
- virtual/stubbed out ethdev for use as slave ethdev in testing
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The function rte_snprintf serves no useful purpose. It is the
same as snprintf() for all valid inputs. Deprecate it and
replace all uses in current code.
Leave the tests for the deprecated function in place.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Mark the rte_log, cmdline_printf and rte_snprintf functions as
being printf-style functions. This causes compilation errors
due to mis-matched parameter types, so the parameter types are
fixed where appropriate.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Fix typos and false assumptions in malloc unit tests.
Without enhancements to lib rte_malloc, malloc autotest fails every
second (2nd) run. With enhancements, malloc autotest fails in
function test_multi_alloc_statistics, because we compare the wrong
sets of statistics.
Signed-off-by: Robert Sanford <rsanford2@gmail.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Unit tests for Packet Framework libraries.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Acked by: Ivan Boule <ivan.boule@6wind.com>
Unlike igb_uio, VFIO interrupt type is not set by kernel module
parameters but is set up via ioctl() calls at runtime. This warrants
a new EAL command-line parameter. It will have no effect if VFIO is
not compiled, but will set VFIO interrupt type to either "legacy", "msi"
or "msix" if VFIO support is compiled. Note that VFIO initialization
will fail if the interrupt type selected is not supported by the system.
If the interrupt type parameter wasn't specified, VFIO will try all
interrupt types (starting with MSI-X).
In unit tests, we don't know if VFIO is compiled (eal_vfio.h header is
internal to Linuxapp EAL), so we check this flag regardless.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Rename the RTE_PCI_DRV_NEED_IGB_UIO to be more generic.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Add a set of unit tests and some basic performance test for the
distributor library. These tests cover all the major functionality of
the library on both distributor and worker sides.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Allows to lookup four IP addresses in an LPM table.
Uses SSE instrincts.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
This commit removes trailing whitespace from lines in files. Almost all
files are affected, as the BSD license copyright header had trailing
whitespace on 4 lines in it [hence the number of files reporting 8 lines
changed in the diffstat].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove spaces before tabs in libs]
[Thomas: remove more trailing spaces in non-C files]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The existing rte scheduler can only be safely configured once per port
because a memory zone has a fixed size once it is created and can never
be freed or change in size.
This patch changes the scheduler to use rte_malloc instead. This allows
for a port to be reconfigured by doing rte_sched_port_free followed
rte_sched_port_config.
The patch also removes the now unused name parameter from the
port parameters structure.
Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Now that we've converted all the pmds in dpdk to use the driver registration
macro, rte_pmd_init_all has become empty. As theres no reason to keep it around
anymore, just remove it and fix up all the eample callers.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Convert the ring driver to use the PMD_REGISTER_DRIVER macro and fix up the
Makefile so that its linkage is only done if we are building static libraries.
This means that the test applications now have no reference to the ring library
when building DSO's and must specify its use on the command line with the -d
option. Static linking will still initalize the driver automatically.
Note that the ring driver was also written in such a way that it violated some
general layering principles, several functions were contained in the pmd which
were being called by example from the test application in the app/test
directory. Specifically it was calling eth_ring_pair_attach,
eth_ring_pair_create and rte_eth_ring_devinit, which should only be called
internally to the dpdk core library. To correct this I've removed those
functions, and instead allowed them to be called indirectly at initalization
time using the vdev command line argument key nodeaction=<name>:<node>:<action>
where action is one of ATTACH or CREATE. I've tested out the functionality of
the command line with the testpmd utility, with success, and have removed the
called functions from the test utility. This will affect how the test utility
is invoked (the -d and --vdev option will need to be specified on the command
line now), but honestly, given the way it was coded, I think the testing of the
ring pmd was not the best example of how to code with dpdk to begin with. I
have also left the two layer violating functions in place, so as not to break
existing applications, but added deprecation warnings to them so that apps can
migrate off them.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
It makes no sense to inline string functions, in fact snprintf
can't be inlined because the function supports variable number of
arguments.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: update includes]
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The DPDK dump functions are useful for remote debugging of an
applications. But when application runs as a daemon, stdout
is typically routed to /dev/null.
Instead change all these functions to take a stdio FILE * handle
instead. An application can then use open_memstream() to capture
the output.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: fix quota_watermark example]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Instead of having a list of virtual device drivers in EAL code, add an
API to register drivers. Thanks to this new registration method, we can
remove the references to pmd_ring, pmd_pcap and pmd_xenvirt in EAL code.
This also enables the ability to register a virtual device driver as
a shared library.
The registration is done in an init function flaged with
__attribute__((constructor)). The new convention is to name this
function rte_pmd_xyz_init(). The per-device init function is renamed
rte_pmd_xyz_devinit().
By the way the internal PMDs are now also .so/standalone ready. Let's do
it later on. It will be required to ease maintenance.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit splits the "--use-device" option in two new options:
- "--pci-whitelist or -w": add a PCI device in the white list
- "--vdev": instanciate a new virtual device
Before the patch, the same option "--use-device" was used for these 2
use-cases.
By the way, we also add "--pci-blacklist" in addition to the existing
"-b" for coherency with the whitelist parameter.
Test result:
echo 100 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 100 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
./app/test -c 0x15 -n 3 -m 64
RTE>>eal_flags_autotest
[...]
Test OK
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit changes the API of --use-device command line argument.
It changes the separators from ';' to ','. Indeed, ';' is not the best
choice as this character is also used to separate shell commands,
forcing the user to surround arguments with quotes.
This commit impacts both devargs and kvargs as each of them define
a separator in --use-device argument:
- devargs defines the separator between the device name or pci_id and
its arguments
- kvargs defines the separator between each key/value pairs in
arguments for drivers using the kvargs API to parse their arguments
The modification of devargs and kvargs is done in one commit to keep
the coherency of --use-device.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Remove old whitelist code:
- remove references to rte_pmd_ring, rte_pmd_pcap and pmd_xenvirt in
is_valid_wl_entry() as we want to be able to register external virtual
drivers as a shared library. Moreover this code was duplicated with
dev_types[] from eal_common_pci.c
- eal_common_whitelist.c was badly named: it was able to process PCI
devices white list and the registration of virtual devices
- the parsing code was complex: all arguments were prepended in
one string dev_list_str[4096], then split again
Use the newly introduced rte_devargs to get:
- the PCI white list
- the PCI black list
- the list of virtual devices
Rework the tests:
- a part of the whitelist test can be removed as it is now tested
in app/test/test_devargs.c
- the other parts are just reworked to adapt them to the new API
This commit induce a small API modification: it is not possible to specify
several devices per "--use-device" option. This notation was anyway a bit
cryptic. Ex:
--use-device="eth_ring0,eth_pcap0;iface=ixgbe0"
now becomes:
--use-device="eth_ring0" --use-device="eth_pcap0;iface=ixgbe0"
On the other hand, it is now possible to work in PCI blacklist mode and
instanciate virtual drivers, which was not possible before this patch.
Test result:
./app/test -c 0x15 -n 3 -m 64
RTE>>devargs_autotest
EAL: invalid PCI identifier <08:1>
EAL: invalid PCI identifier <00.1>
EAL: invalid PCI identifier <foo>
EAL: invalid PCI identifier <>
EAL: invalid PCI identifier <000f:0:0>
Test OK
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit introduces a new API for storing device arguments given by
the user. It only adds the framework and the test. The modification of
EAL to use this new module is done in next commit.
The final goals:
- unify pci-blacklist, pci-whitelist, and virtual devices arguments
in one file
- allow to register a virtual device driver from a dpdk extension
provided as a shared library. For that we will require to remove
references to rte_pmd_ring and rte_pmd_pcap in argument parsing code
- clarify the API of eal_common_whitelist.c, and rework its code that is
often complex for no reason.
- support arguments for PCI devices and possibly future non-PCI devices
(other than virtual devices) without effort.
Test result:
echo 100 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 100 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
./app/test -c 0x15 -n 3 -m 64
RTE>>eal_flags_autotest
[...]
Test OK
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
To avoid confusion with virtual devices, rename device_list as
pci_device_list and driver_list as pci_driver_list.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Some features are not available if LIBRTE_CMDLINE is disabled:
- interactive commands
- cmdline tests
Remove also cmdline_parse includes which are not needed.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Since DPDK 1.4, if RTE_EAL_UNBIND_PORTS is disabled, igb_uio mapping is
done for all devices (commit eee16c964c), breaking some non-Intel drivers.
But pci_uio_map_resource() should only be called for Intel devices
(using igb_uio kernel module).
The flag RTE_PCI_DRV_NEED_IGB_UIO is set for all those devices, even when
RTE_EAL_UNBIND_PORTS is disabled (fixes commit a22f5ce8fc).
Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
Add a file app/test/test_kvargs.c that checks the rte_kvargs API.
The test passes:
RTE>>kvargs
== test valid case ==
== test invalid case ==
PMD: Error parsing device, invalid key <wrong-key>
Test OK
I also tested that rte_eth_pcap runs with the following arguments:
./app/testpmd -c 0x15 -n 3 --proc-type=primary --huge-dir=/mnt/huge \
--use-device="eth_pcap0;iface=ixgbe0" \
-- -i --port-topology=chained
./app/testpmd -c 0x15 -n 3 --proc-type=primary --huge-dir=/mnt/huge \
--use-device="eth_pcap0;rx_iface=ixgbe0;rx_iface=ixgbe1;tx_iface=ixgbe0" \
-- -i --port-topology=chained
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Adding or subtracting a value to a pointer makes a new pointer
of unknown type.
So typeof() is replaced by (void*) in RTE_PTR_ADD() and RTE_PTR_SUB().
But RTE_PTR_ALIGN_* macros have in their explicit API to return a pointer
of the same type. Since RTE_PTR_ALIGN_CEIL is based on RTE_PTR_ADD, a
typeof() is added to keep the original behaviour.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
* Change behaviour to spread the memory specified across all sockets
rather than duplicating the memory for each one. This way the memory
size specified is the total memory needed by the test.
* Minor reordering of test cases, to ensure that ring autotest is the
final test run.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
It's no longer possible to run all autotests in
a single go and have them pass, so remove that option.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Minor chanes including replacing local DIM macro with more standard
RTE_DIM macro from rte_common.h.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
don't compile the timer autotests unless timer library is turned on in
the compile-time configuration.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Minor fixes/updates to the autotest app, including:
* replace hard-coded values with #defines in rte_power.h
* replace local DIM() macro with common RTE_DIM
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Core support for using the Intel DPDK with Xen Dom0 - including EAL
changes and mempool changes. These changes encompass how memory mapping
is done, including support for initializing a memory pool inside an
already-allocated block of memory.
KNI sample app updated to use KNI close function when used with Xen.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
These library changes provide a new Intel DPDK feature for communicating
with virtual machines using QEMU's IVSHMEM mechanism.
The feature works by providing a command line for QEMU to map several hugepages
into a single IVSHMEM device. For the guest to know what is inside any given IVSHMEM
device (and to distinguish between Intel(R) DPDK and non-Intel(R) DPDK IVSHMEM
devices), a metadata file is also mapped into the IVSHMEM segment. No work needs to
be done by the guest application to map IVSHMEM devices into memory; they are
automatically recognized by the Intel(R) DPDK Environment Abstraction Layer (EAL).
Changes in this patch:
* Changes to EAL to allow mapping of all hugepages in a memseg into a single file
* Changes to EAL to allow ivshmem devices to be transparently mapped in
the process running on the guest.
* New ivshmem library to create and manage metadata exported to guest VM's
* New ivshmem compilation targets
* Mempool and ring changes to allow export of structures to a VM and allow
a VM to attach to those structures.
* New autotests to unit tests this functionality.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
For certain functionality, e.g. Xen Dom0 support, it is required that
we can guarantee that memzones for descriptor rings won't cross 2M
boundaries. So add new memzone reserve function where we can pass in a
boundary condition parameter.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Changes to allow compilation and use on FreeBSD. Includes:
* contigmem and nic_uio driver for FreeBSD
* new EAL instance
* new "bsdapp" compilation target
* various compilation fixes due to differences between linux and freebsd
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
GCC 4.8 was producing this error:
argument to ‘sizeof’ in ‘strncmp’ call is the same expression as the
second source; did you mean to provide an explicit length?
[-Werror=sizeof-pointer-memaccess]
Signed-off-by: Intel
Fix warnings of type "Value stored to 'xxx' is never read".
Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
When a memory address must be read, for instance a [mapped] PCI register,
the read value is assigned to a local variable that is not used after,
as for instance:
x = *((uint8_t *) mem_addr);
Such instructions do not compile with gcc 4.6.
The fix consists in adding the "volatile" attribute to the accessed data type
and to not assign the read value:
*((volatile uint8_t *) mem_addr);
Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>