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>
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>
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>
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>
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>
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>
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>
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]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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]
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>
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>
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>
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>
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>
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>