Commit Graph

423 Commits

Author SHA1 Message Date
Maryam Tahhan
22561383ea app: replace dump_cfg by proc_info
proc_info displays statistics information including extended stats for
given DPDK ports and dumps the memory information for DPDK.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-07-17 02:26:38 +02:00
Sergio Gonzalez Monroy
ff909fe21f mem: introduce memzone freeing
Implement rte_memzone_free which, as its name implies, would free a
memzone.

Currently memzone are tracked in an array and cannot be free.
To be able to reuse the same array to track memzones, we have to
change how we keep track of reserved memzones.

With this patch, any memzone with addr NULL is not used, so we also need
to change how we look for the next memzone entry free.

Add new unit test for rte_memzone_free API.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-16 14:01:04 +02:00
Sergio Gonzalez Monroy
89f3a81574 app/test: update malloc and memzone unit tests
Some unit test are not relevant anymore. It is the case of those malloc
UTs that checked corner cases when allocating MALLOC_MEMZONE_SIZE
chunks, and the case of those memzone UTs relaying of specific free
memsegs of rhte reserved memzone.

Other UTs just need to be update, for example, to calculate maximum free
block size available.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-16 14:01:04 +02:00
Helin Zhang
9e972be2b7 app: replace some offload flags with packet type
To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.
To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 00:57:47 +02:00
Bruce Richardson
24b4bb8123 hash: rename unused field
The cuckoo hash has a fixed number of entries per bucket, so the
configuration parameter for this is unused. We change this field in the
parameters struct to "reserved" to indicate that there is now no such
parameter value, while at the same time keeping ABI consistency.

Fixes: 48a3991196 ("hash: replace with cuckoo hash implementation")

Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-13 19:27:31 +02:00
Cyril Chemparathy
f7f500d245 app/test: restrict x86 cpu flags checks to x86 builds
The original code mistakenly defaulted to X86 when RTE_ARCH_PPC_64 was
left undefined.  This did not accommodate other non-PPC/non-X86
architectures.  This patch fixes this issue.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Signed-off-by: Zhigang Lu <zlu@ezchip.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-13 16:15:37 +02:00
Pablo de Lara
f9edbc9bb6 hash: add iterate function
Since now rte_hash structure is private, a new function
has been added to let the user iterate through the hash table,
returning next key and data associated on each iteration,
plus the position where they were stored.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-13 00:18:41 +02:00
Pablo de Lara
473d1bebce hash: allow to store data in hash table
Usually hash tables not only store keys, but also data associated
to them. In order to maintain the existing API, the old functions
will still return the index where the key was stored.
The new functions will return the data associated to that key.
In the case of the lookup_bulk function, it will return also
the number of entries found and a bitmask of which entries
were found.

Unit tests have been updated to use these new functions.

As a final point, a flag has been added in rte_hash_parameters
to indicate if there are new parameters for future versions,
so there is no need to maintain multiple versions
of the existing functions in the future.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: fix || operator in a precondition check]
2015-07-13 00:16:29 +02:00
Pablo de Lara
b26473ff8f hash: add reset function
Added reset function to be able to empty the table,
without having to destroy and create it again.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-13 00:15:03 +02:00
Pablo de Lara
48a3991196 hash: replace with cuckoo hash implementation
This patch replaces the existing hash library with another approach,
using the Cuckoo Hash method to resolve collisions (open addressing),
which pushes items from a full bucket when a new entry tries
to be added in it, storing the evicted entry in an alternative location,
using a secondary hash function.

This gives the user the ability to store more entries when a bucket
is full, in comparison with the previous implementation.
Therefore, the unit test has been updated, as some scenarios have changed
(such as the previous removed restriction).

Also note that the API has not been changed, although new fields
have been added in the rte_hash structure (structure is internal now).
The main change when creating a new table is that the number of entries
per bucket is fixed now, so its parameter is ignored now
(still there to maintain the same parameters structure).
The hash unit test has been updated to reflect these changes.

As a last note, the maximum burst size in lookup_burst function
hash been increased to 64, to improve performance.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-12 23:46:11 +02:00
Pablo de Lara
359e17bf08 app/test: improve hash unit tests
Add new unit test for calculating the average table utilization,
using random keys, based on number of entries that can be added
until we encounter one that cannot be added (bucket if full).

Also, replace current hash_perf unit test to see performance more clearly.
The current hash_perf unit test takes too long and add keys that
may or may not fit in the table and look up/delete that may not be
in the table. This new unit test gets a set of keys that we know
that fits in the table, and then measure the time to add/look up/delete
them.

Note that performance numbers include time to take a random key
from a pre-made array of keys, plus a quick check of return value.
Also, as stated above, expect higher numbers, as all operations
in the new unit tests will be successful, which means that
it will take more time, than mixing both successful and unsuccesful
operations.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-10 12:34:13 +02:00
Pablo de Lara
9ef1501ea6 hash: hide structure from header and make it internal
rte_hash structure should not be a public structure,
and therefore it should be moved to the C file and be declared
as internal. rte_hash_hash implementation is also moved
to the C file, as it uses the structure.

This patch also removes part of a unit test that was checking
a field of the structure.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-10 12:25:28 +02:00
John McNamara
c4bcc342c8 app/testpmd: refactor ieee1588 forwarding
Refactor the ieee1588_fwd mode in testpmd to use the new ethdev
APIs to enable and read IEEE1588 PTP timestamps.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-10 02:43:37 +02:00
Olivier Matz
2465980ad2 app/test: decrease size of requested mempool
In test application, the default size of allocated mempool is calculated
as following:

  (RTE_MAX_LCORE * (RTE_MEMPOOL_CACHE_MAX_SIZE + max_kept_objects)) - 1

The objective is to ensure that all cores can fill their cache and keep
'max_kept_objects' at the same time. As RTE_MAX_LCORE is 128 and
RTE_MEMPOOL_CACHE_MAX_SIZE is 512 in the default configuration, it can
produce very large mempools (170 MB).

We can replace the number of core by a dynamic value, which drastically
reduces the amount of memory needed for this test (5 MB with 4 cores).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-09 17:35:25 +02:00
Helin Zhang
0e3f2317bc app/testpmd: show the hash key size
As querying hash key size in byte was supported, it can be shown
in testpmd after getting the device information if not zero.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-09 01:14:56 +02:00
Jingjing Wu
75ba29fd14 app/testpmd: add flow director for L2 payload
This patch extends flow director commands to support l2_payload flow type.

Test report: http://dpdk.org/ml/archives/dev/2015-June/020238.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-07 23:23:36 +02:00
Jingjing Wu
7ba29a76b1 ethdev: rename and extend the mirror type
This path renames the mirror type in rte_eth_mirror_conf and macros,
and rework the mirror set in ixgbe drivers by using new definition.
It also fixes some coding style.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019118.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-07 17:45:45 +02:00
Jingjing Wu
b85e1cc502 ethdev: rename port mirroring structure
Rename rte_eth_vmdq_mirror_conf to rte_eth_mirror_conf and move
the maximum rule id check from ethdev level to driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-07 17:39:32 +02:00
Helin Zhang
92ebda07ee app/testpmd: add qinq stripping and insertion
If double vlan is detected, its stripped flag and vlan tags can be
printed on rxonly mode. Test command of 'tx_vlan set' is expanded
to set both single and double vlan tags on TX side for each packets
to be sent out.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-07-07 16:42:11 +02:00
Vladimir Medvedkin
c928adc4e7 hash: add unit test for thash
Add unit test for thash library

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-01 23:26:10 +02:00
Cyril Chemparathy
82be8d5442 mbuf: use offset macro
This patch simply applies the transform previously committed in
scripts/cocci/mtod-offset.cocci.  No other modifications have been
made here.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-24 12:01:14 +02:00
Cyril Chemparathy
e446bc731e app/testpmd: pack GRE header
Not packing this causes -Wcast-align breakage on machines that are
strict on alignment.  This patch fixes this bug.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-24 12:00:42 +02:00
Cyril Chemparathy
7621d6a8d0 eal: add and use unaligned integer types
On machines that are strict on pointer alignment, current code breaks
on GCC's -Wcast-align checks on casts from narrower to wider types.
This patch introduces new unaligned_uint(16|32|64)_t types, which
correctly retain alignment in such cases.  Strict alignment
architectures will need to define CONFIG_RTE_ARCH_STRICT_ALIGN in
order to effect these new types.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-24 12:00:41 +02:00
Tetsuya Mukawa
aa61307afc app/test: fix crash after mbuf allocation failure
The patch fixes potential null pointer accesses in test_mbuf.
If 'm[i]' is null, stop accessing it.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
2015-06-22 23:05:51 +02:00
Roman Dementiev
960e8a22fc app/test: add hash scalability test using HTM lock elision
This patch adds a new auto-test for testing the scaling
of concurrent inserts into rte_hash when protected by
the normal spinlock vs. the spinlock with HTM lock
elision. The test also benchmarks single-threaded
access without any locks.

Signed-off-by: Roman Dementiev <roman.dementiev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-19 16:34:32 +02:00
Konstantin Ananyev
043ef28b39 acl: add new test cases
Add several new test cases for ACL to cover different build configurations.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-18 18:12:47 +02:00
Konstantin Ananyev
ca132384ef acl: fix ambiguity between test rules
Some test rules had equal priority for the same category.
That can cause an ambiguity in build trie and test results.
Specify different priority value for each rule from the same category.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-18 18:10:59 +02:00
Konstantin Ananyev
12c4e86969 acl: remove redundant macro
Use global RTE_LEN2MASK macro, instead of local LEN2MASK.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-18 17:59:18 +02:00
Pablo de Lara
f3d9490098 app/test: verify more jhash functions
Added new test that verifies that rte_jhash_1words,
rte_jhash_2words and rte_jhash_3words return the same
values as rte_jhash.

Note that this patch has been added after the update
of the jhash function because these 3 functions did not
return the same values as rte_jhash before

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:19:20 +02:00
Pablo de Lara
7530c9eea7 hash: rename a jhash function
Changed name to something more meaningful,
and mark rte_jhash2 as deprecated.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:19:20 +02:00
Pablo de Lara
f1237c33d4 hash: update jhash function with the latest available
Jenkins hash function was developed originally in 1996,
and was integrated in first versions of DPDK.
The function has been improved in 2006,
achieving up to 35% better performance, compared to the original one.

This patch integrates that code into the rte_jhash library.
It also updates the precalculated hash values in the unit test,
as the code now returns different values (expected).

A final note has been added in release notes for stating
the changes made.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:18:55 +02:00
Pablo de Lara
6298d2c55a app/test: add new functional tests for hash functions
In order to make sure that the hash functions are returning
the correct values, new tests have been added:

- First test compares precalculated hash values with values calculated
from the existing hash functions.
- Second test compares values returned from rte_jhash2 and rte_jhash,
expecting same return (only for multiple of 4 bytes keys)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:18:55 +02:00
Pablo de Lara
5c2b9d9478 app/test: change order of loops in hash function tests
In order to see more clearly the performance difference
between different hash functions, order of the loops
have been changed, so it iterates first through initial values,
then key sizes and then the hash functions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:18:55 +02:00
Pablo de Lara
5d96e9463d app/test: update hash key size range and initial values
Previous key sizes used for testing did not have much purpose.
This patch substitutes them with some more meaninful
(standard multiple of 2 key sizes, plus IPv4/v6 tuple and others)

Also an arbitrary initial value has been added to increase
the test coverage, and RTE_DIM macro is used to iterate the loops.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:18:55 +02:00
Pablo de Lara
4072a35a87 app/test: improve accuracy on hash measurements
Cycles per hash calculation were measured per single operation.
It is much more accurate to run several iterations between measurements
and divide by number of iterations.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 12:17:52 +02:00
Pablo de Lara
4de41856c5 app/test: move hash performance tests to separate file
This patch moves hash function performance tests to a separate file,
so user can check performance of the existing hash functions quicker,
without having to run all the other hash operation performance tests,
which takes some time.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-16 11:58:35 +02:00
John McNamara
a8a9262de3 app/test: return error code on failed tests
This change returns a system error code if tests fail when
running any of the "make test" targets.

This allows the tests to report failures while running in
continuous integration environments.

Previously "make test" returned $? == 0 for all combinations
of success, failure and exception conditions.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
2015-06-15 15:17:52 +02:00
Gaetan Rivet
a3894e2fbc app/test: fix default numa memory assignment
Each test requires a certain minimal amount of memory.
Spreading memory on all sockets means that the test will get less memory than
what it wanted on multi sockets system.
So replace all_sockets() with per_sockets().

Also doubled memory on group_5 as current requirement is not enough.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
2015-06-15 15:04:22 +02:00
Ding Zhi
c76ee0d0ee app/testpmd: fix default flow control values
This variable has undefined values in some cases.

Fixes: 422a20a4e6 ("app/testpmd: fix uninitialized flow control variables")

Signed-off-by: Ding Zhi <zhi.ding@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
[Thomas: split lines to conform with guidelines]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-15 12:01:06 +02:00
Ivan Boule
8443ce8193 app/testpmd: fix reply to a multicast ICMP request
Set the IP source and destination addresses in the IP header of the
ICMP reply as follows:
  - Use the request IP source address as the reply IP destination address
  - If the request IP destination address is a multicast IP address
      - choose a reply IP source address different from the request IP
        source address,
      - re-compute the IP header checksum.
    Otherwise
      - switch the request IP source and destination addresses in the
        reply,
      - keep the IP header checksum unchanged.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
8fff667578 app/testpmd: new command to add/remove multicast MAC addresses
Add the new interactive command:
    mcast_addr add|remove X <mcast_addr>
to add/remove the multicast MAC address <mcast_addr> to/from the set of
multicast addresses filtered by port <X>.
Command used to test the function "rte_eth_dev_set_mc_addr_list"
that has been added to the API of PMDs.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Stephen Hemminger
f3618dcbcf app: fix whitespace
Fix trailing whitespace, space before tab and empty lines at end of file.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: fix indent and alignment in test_acl.h and test_sched.c]
2015-06-12 11:10:10 +02:00
Konstantin Ananyev
cd1fd93090 acl: add new test case for ranges build
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-04 11:14:45 +02:00
Adrien Mazarguil
f771913186 app/testpmd: compute checksum in ICMP reply
ICMP echo replies with invalid checksums may be dropped by network nodes or
ignored by the ping utility.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
2015-05-29 20:27:23 +02:00
Adrien Mazarguil
f161fb6ad5 app/testpmd: fix MAC address in ARP reply
In the icmpecho forwarding mode, ARP replies from testpmd contain
invalid zero-filled MAC addresses. This is broken since the commit below.

Fixes: 31db4d38de ("net: change arp header struct declaration")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
2015-05-29 20:27:23 +02:00
Bruce Richardson
980ed498eb drivers: create new directory
Add a new top-level "drivers" directory to which all PMDs will be moved
for easier maintenance of both lib folder and drivers themselves. This
new directory is a dependency of all the apps in the app folder, so
the makefiles for each app are updated.
To the new top-level directory add a "net" subdirectory to classify
more specifically our existing PMDs as ethernet drivers

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
[Thomas: fix dependencies and merge several patches]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 15:51:38 +02:00
Konstantin Ananyev
824cb29c0e apps: fix default mbuf size
Latest mbuf changes (priv_size addition and related fixes)
exposed small problem with testpmd and few other sample apps:
when mbuf size is exaclty 2KB or less, that causes
ixgbe PMD to select scattered RX even for configs with 'normal'
max packet length (max_rx_pkt_len == ETHER_MAX_LEN).
To overcome that problem and unify the code, new macro was created
to represent recommended minimal buffer length for mbuf.
When appropriate, samples are updated to use that macro.

Fixes: dfb03bbe2b ("app/testpmd: use standard functions to initialize
mbufs and mbuf pool")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-05-11 15:51:14 +02:00
Bruce Richardson
13501503a6 distributor: remove inclusion of mbuf header
The distributor header file includes the mbuf header file, but it does not
need to do so as it only uses pointers to the struct rte_mbuf type, and
does not use any of the mbuf internals, nor any of the mbuf functions or
macros. Therefore the inclusion is unnecessary, and can be replaced by a
forward declaration of the mbuf type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-05-11 15:36:37 +02:00
Olivier Matz
c660072c30 app/test: check cloning with different priv sizes
Verify that we can attach a mbuf to another one that does not have
the same data room size and priv_size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-04-28 11:42:31 +02:00
Olivier Matz
fd8dda68ca app/test: check cloning a clone
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-04-28 11:40:09 +02:00