Commit Graph

860 Commits

Author SHA1 Message Date
Wenzhuo Lu
1cfde13610 app/testpmd: fix PF/VF check of flow director
Parameters pf & vf are added into most of flow director
filter CLIs.
But mac-vlan and tunnel filters don't have these parameters,
the parameters should not be checked for mac-vlan and tunnel
filters.

Fixes: e6a68c0133 ("app/testpmd: extend commands for flow director in VF")

Reported-by: Frederico Cadete <frederico.cadete-ext@oneaccess-net.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-25 23:11:02 +02:00
Akhil Goyal
57af81f7fa app/test: store digest/IV at a DMA able address
For physical crypto devices, IV and digest are processed by the crypto
device which needs the contents to be written on some DMA able address.

So in order to do that, IV and digest are accomodated in the packet.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-13 21:58:44 +02:00
Piotr Azarewicz
b0f9296150 app/test: fix crypto mbuf pool size
The created pool for crypto mbufs may be too big in some
environments.
To avoid this issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf,
that is needed in large data test scenarios.

Fixes: ffbe3be0d4 ("app/test: add libcrypto")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
2016-10-13 21:58:44 +02:00
Marcin Kerlin
0640e96235 app/test: reduce libcrypto operations number
This patch reduce the number of total operations from 1M to 10K,
because test is taking too long time now.

Fixes: ffbe3be0d4 ("app/test: add libcrypto")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-13 21:58:44 +02:00
Bernard Iremonger
c1ceaf3ad0 ethdev: add an argument to internal callback function
add cb_arg parameter to the _rte_eth_dev_callback_process function.

Adding a parameter to this function allows passing information
to the application when an eth device event occurs such as
a VF to PF message.
This allows the application to decide if a particular function
is permitted.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Alex Zelezniak <alexz@att.com>
2016-10-14 02:01:52 +02:00
Bernard Iremonger
425781ff5a app/testpmd: add ixgbe VF management
add test for set vf vlan anti spoof
add test for set vf mac anti spoof
add test for set vf vlan stripq
add test for set vf vlan insert
add test for set tx loopback
add test for set all queues drop enable bit
add test for set vf split drop enable bit
add test for set vf mac address
add new APIs to testpmd help command.

add new APIs to the testpmd guide

Modify Makefile, add library rte_pmd_ixgbe to _LDLIBS-y.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2016-10-13 15:45:09 +02:00
Wei Dai
231fa88ed5 app/test: verify LPM tbl8 recycle
As a bug-fix for lpm tbl8 recycle is introduced,
add a test case to verify tbl8 group is correctly
freed when it only includes a rule with depth=24.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-10-13 22:17:41 +02:00
Olivier Matz
5896999295 app/testpmd: display LRO segment size
In csumonly engine, display the value of LRO segment if the
LRO flag is set.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-10-13 20:45:56 +02:00
Olivier Matz
5842289a54 mbuf: add new Rx checksum flags
Following discussions in [1] and [2], introduce a new bit to
describe the Rx checksum status in mbuf.

Before this patch, only one flag was available:
  PKT_RX_L4_CKSUM_BAD: L4 cksum of RX pkt. is not OK.

And same for L3:
  PKT_RX_IP_CKSUM_BAD: IP cksum of RX pkt. is not OK.

This had 2 issues:
- it was not possible to differentiate "checksum good" from
  "checksum unknown".
- it was not possible for a virtual driver to say "the checksum
  in packet may be wrong, but data integrity is valid".

This patch tries to solve this issue by having 4 states (2 bits)
for the IP and L4 Rx checksums. New values are:

 - PKT_RX_L4_CKSUM_UNKNOWN: no information about the RX L4 checksum
   -> the application should verify the checksum by sw
 - PKT_RX_L4_CKSUM_BAD: the L4 checksum in the packet is wrong
   -> the application can drop the packet without additional check
 - PKT_RX_L4_CKSUM_GOOD: the L4 checksum in the packet is valid
   -> the application can accept the packet without verifying the
      checksum by sw
 - PKT_RX_L4_CKSUM_NONE: the L4 checksum is not correct in the packet
   data, but the integrity of the L4 data is verified.
   -> the application can process the packet but must not verify the
      checksum by sw. It has to take care to recalculate the cksum
      if the packet is transmitted (either by sw or using tx offload)

  And same for L3 (replace L4 by IP in description above).

This commit tries to be compatible with existing applications that
only check the existing flag (CKSUM_BAD).

[1] http://dpdk.org/ml/archives/dev/2016-May/039920.html
[2] http://dpdk.org/ml/archives/dev/2016-June/040007.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-10-13 20:45:33 +02:00
Ajit Khaparde
f7103a9108 app/testpmd: support 25G and 50G speeds
Support to configure 25G and 50G speeds is missing from testpmd.
This patch also updates the testpmd user guide accordingly.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2016-10-13 18:09:27 +02:00
Maciej Czekaj
2ebacaa7d1 app/testpmd: configure flowgen packet size with --txpkts
"flowgen" forwarding mode has fixed packet size (300).
Let it re-use --txpkts option for specifying generated packet size.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-13 17:21:06 +02:00
Wenzhuo Lu
2a977b891f app/testpmd: fix DCB configuration
An issue is found that DCB cannot be configured on ixgbe
NICs. It's said the TX queue number is not right.
On ixgbe the max TX queue number is not fixed, it depends
on the multi-queue mode.

This patch adds the device configuration before getting
info in the DCB configuration process. So the right info
can be got depending on the configuration.

Fixes: 1a572499 ("app/testpmd: setup DCB forwarding based on traffic class")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2016-10-13 17:16:13 +02:00
Mohammad Abdul Awal
0f6f219e79 app/testpmd: fix RSS hash key size
RSS hash-key-size is retrieved from device configuration instead of
using a fixed size of 40 bytes.

Fixes: f79959ea15 ("app/testpmd: allow to configure RSS hash key")

Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-13 16:07:25 +02:00
Olivier Matz
e834daaf91 app/testpmd: fix TSO with checksum engine
The commit that disabled TSO for small packets was broken during the
rebase. The problem is the IP checksum is not calculated in software if:
- TX IP checksum is disabled
- TSO is enabled
- the current packet is smaller than tso segment size

When checking if the PKT_TX_IP_CKSUM flag should be set (in case
of tso), use the local tso_segsz variable, which is set to 0 when the
packet is too small to require tso. Therefore the IP checksum will be
correctly calculated in software.

Moreover, we should not use tunnel segment size for non-tunnel tso, else
TSO will stay disabled for all packets.

Fixes: 97c21329d4 ("app/testpmd: do not use TSO for small packets")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-13 15:59:38 +02:00
Thomas Monjalon
58c82067f1 app/testpmd: use consistent vdev names
The vdev eth_bond has been renamed to net_bond.
testpmd is creating a bonding device with the old prefix.
It is changed for consistency.

The script test-null.sh was failing because using the old name
for the null vdev.

Fixes also the bonding and testpmd doc.

Fixes: 2f45703c17 ("drivers: make driver names consistent")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-13 15:55:51 +02:00
Thomas Monjalon
5fc07e3eb7 app/test: fix vdev names
The vdev eth_ring has been renamed to net_ring.
Some unit tests are using the old name and fail.

Fixes also the vdev comments in EAL and ethdev.

Fixes: 2f45703c17 ("drivers: make driver names consistent")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-13 15:55:42 +02:00
Thomas Monjalon
5ce434a642 app/test: add mempool walk
The mempool function rte_mempool_walk was not tested.
It will print the name of all mempools.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-13 15:46:31 +02:00
Wei Dai
5450a8671b app/test: reduce IPv6 LPM data size
copy app/test/test_lpm6_routes.h to app/test/test_lpm6_data.h .
and then delete app/test/test_lpm6_routes.h and clear the
large_ips_table[ ] to make LPM6 test case size much smaller than
before. Also add codes in app/test/test_lpm6_data.h to generate test
data in large_ips_table[ ] at run time.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2016-10-13 15:40:58 +02:00
Wei Dai
17d60f5b5e app/test: remove large IPv4 LPM data file
remove the large file app/test/test_lpm_routes.h and add codes to
auto-generate similar large route rule table which keeps same depth
and IP class distribution as previous one in test_lpm_routes.h .
With the rule table auto-generated at run time, the performance
of looking up keep similar to that from pervious constant table.

Signed-off-by: Wei Dai <wei.dai@intel.com>
2016-10-13 15:40:43 +02:00
Pablo de Lara
4f117ebda0 app/test: fix hash multiwriter sequence
Hash multiwriter test consists of two subtests.
If the any of the subtests fails, the overall test should fail,
but the overall test only passed if the second subtest passed,
because the return of the first subtest was being overwritten.

Fixes: be856325cb ("hash: add scalable multi-writer insertion with Intel TSX")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-13 15:40:39 +02:00
Guruprasad Rao
4cf75ea8f4 app/test: add cuckoo hash table
This patch includes cuckoo hash table for testing all the APIs
The cuckoo hash is added for both test_table_tables and
test_table_combined cases.
The testing is completed and the results are OK.

Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Signed-off-by: Guruprasad Rao <guruprasadx.rao@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-10-12 22:10:08 +02:00
Guruprasad Rao
ad28e5f7d6 app/test-pipeline: add cuckoo hash
This patch inclides cuckoo hash table into test-pipeline
This allows to benchmark the performance of the cuckoo hash table
The following key sizes are supported for cuckoo hash table
8, 16, 32, 48, 64, 80, 96, 112 and 128.

The test-pipeline can be run using the following command
say for key size 8
./app/testpipeline -c 0xe -n 4 -- -p 0xf --hash-cuckoo-8

Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Signed-off-by: Guruprasad Rao <guruprasadx.rao@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-10-12 22:09:46 +02:00
Reshma Pattan
4e1c139f79 app/procinfo: free xstats memory upon failure
Some of the failures cases inside the nic_xstats_display()
function doesn't free the allocated memory for the xstats and
their names, memory is freed now.

Fixes: e2aae1c1 ("ethdev: remove name from extended statistic fetch")
Fixes: 22561383 ("app: replace dump_cfg by proc_info")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-10-12 18:40:50 +02:00
Olivier Matz
b9e18d416d app/testpmd: hide segment size when not relevant
When TSO is not asked, hide the segment size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:39:53 +02:00
Olivier Matz
97c21329d4 app/testpmd: do not use TSO for small packets
Asking for TSO (TCP Segmentation Offload) on packets that are already
smaller than (headers + MSS) does not work, for instance on ixgbe.

Fix the csumonly engine to only set the TSO flag when a segmentation
offload is really required, i.e. when packet is large enough.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:38:49 +02:00
Olivier Matz
6eab307859 app/testpmd: display Rx port in checksum engine
This information is useful when debugging, especially with
bidirectional traffic.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:38:35 +02:00
Olivier Matz
03d17e4d01 app/testpmd: do not change IP addrs in checksum engine
The csum forward engine was updated to change the IP addresses in the
packet data in
commit 51f694dd40 ("app/testpmd: rework checksum forward engine")

This was done to ensure that the checksum is correctly reprocessed when
using hardware checksum offload. But the functions
process_inner_cksums() and process_outer_cksums() already reset the
checksum field to 0, so this is not necessary.

Moreover, this makes the engine more complex than needed, and prevents
to easily use it to forward traffic (like iperf) as it modifies the
packets.

This patch drops this behavior.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:37:15 +02:00
Olivier Matz
4c3ea50880 app/testpmd: add option to enable LRO
Introduce a new argument '--enable-lro' to ask testpmd to enable the LRO
feature on enabled ports, like it's done for '--enable-rx-cksum' for
instance.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:36:55 +02:00
Olivier Matz
9c709b2edc app/testpmd: dump Rx flags in checksum engine
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:36:30 +02:00
Olivier Matz
3f3061f4a2 app/testpmd: dump offload flags with new functions
Use the functions introduced in the previous commit to dump the offload
flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-12 18:35:44 +02:00
Olivier Matz
144ba88912 app/testpmd: display software packet type
In addition to the packet type returned by the PMD, also display the
packet type calculated by parsing the packet in software. This is
particularly useful to compare the 2 values.

Note: it does not mean that both hw and sw always have to provide the
same value, since it depends on what hardware supports.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-11 18:22:46 +02:00
Olivier Matz
351537e99a app/testpmd: dump packet type with new function
Use the function introduced in previous commit to dump the packet type
of the received packet.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-11 18:22:46 +02:00
Jianfeng Tan
0f62d63593 app/testpmd: support tunneled TSO in checksum engine
Add a new command "tunnel_tso set <tso_segsz> <port>" to enable
segmentation offload and set MSS to tso_segsz. Another command,
"tunnel_tso show <port>" is added to show tunneled packet MSS.
Result 0 means tunnel_tso is disabled.

The original commands, "tso set <tso_segsz> <port>" and "tso show
<port>" are only reponsible for non-tunneled packets. And the new
commands are for tunneled packets.

Below conditions are needed to make it work:
  a. tunnel TSO is supported by the NIC;
  b. "csum parse_tunnel" must be set so that tunneled pkts are
     recognized;
  c. for tunneled pkts with outer L3 is IPv4, "csum set outer-ip"
     must be set to hw, because after tso, total_len of outer IP
     header is changed, and the checksum of outer IP header calculated
     by sw should be wrong; that is not necessary for IPv6 tunneled
     pkts because there's no checksum field to be filled anymore.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-09 23:19:45 +02:00
Fiona Trahe
83b1d3482f app/test: remove crypto queue number hard-coding
ts_params->conf.nb_queue_pairs should not be hard coded with device
specific number. It should be retrieved from the device info.
Any test which changes it should restore it to orig value.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-08 17:54:38 +02:00
Fiona Trahe
8cad932e25 app/test: cleanup unnecessary crypto ring size setup
Removed obsolete comments re inability to free and re-allocate
queue memory and obsolete workaround for it
which used to create maximum size queues first, then later
create smaller queues.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-08 17:54:38 +02:00
Fiona Trahe
5cba7cbd9f app/test: remove useless loop for crypto
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-08 17:54:38 +02:00
Slawomir Mrozowicz
ffbe3be0d4 app/test: add libcrypto
This patch contains unit tests for libcrypto PMD. User can
use app/test application to check how to use this pmd and to
verify crypto processing.

Test name is cryptodev_libcrypto_autotest.
For performance test cryptodev_libcrypto_perftest can be used.

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-08 17:54:38 +02:00
Slawomir Mrozowicz
e1809db624 app/test: rework AES
This patch rework AES tests .
In general - rename AES-named functions to blockcipher functions pattern.

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-08 17:54:37 +02:00
Pablo de Lara
4c99481f49 app/test: add ZUC
Add cipher and authentication ZUC algorithm tests.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-08 17:53:10 +02:00
Pablo de Lara
24cc6c78fc app/test: rename some SNOW 3G functions
Before adding the new ZUC tests, since they will use
the existing common functions for SNOW3G and KASUMI,
these functions are renamed to *_wireless_algo_*,
instead of *_snow3g_kasumi_*, as they are common
functions for all the three wireless algorithms.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-08 17:53:10 +02:00
Fiona Trahe
afd6aa6fd9 app/test: improve error message for disabled crypto
Improve error message if crypto PMD build is not enabled in config file

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-10-04 20:41:09 +02:00
Arek Kusztal
79521c4383 app/test: add AES GCM performance test
This patch adds AES Galois Counter Mode performance test case
for cryptodev QAT and AESNI GCM. Test is performed with different
buffer sizes, burst size of 32 and 128b key. Test vectors
are placed in app/test/test_cryptodev_perf_vectors.h file.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-04 20:41:09 +02:00
Pablo de Lara
1b529b0141 app/test: remove unnecessary conditional for crypto
Regardless the result of the conditional, the true and false
statements were the same, so the conditional can be removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Arek Kusztal
77debbbfdf app/test: fix verification of digest for GCM
This patch fixes verification of digest in test_cryptodev.c file
for AES GCM test cases.

Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-04 20:41:09 +02:00
Arek Kusztal
b2bb359747 crypto/aesni_gcm: move pre-counter block to driver
This patch moves computing of pre-counter block into the AESNI-GCM
driver so it can be moved from test files.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-04 20:41:09 +02:00
Pablo de Lara
6aef763816 crypto: rename some SNOW 3G references
SNOW 3G algorithm has all uppercase letters in its name
and a space between SNOW and 3G, but some references of it
had some lowercase letters or no space.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-04 20:41:09 +02:00
Arek Kusztal
84baeeb267 app/test: add GMAC for qat
Added Galois Message Authentication Code (GMAC) tests to cryptodev tests.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
73d648b888 app/test: add KASUMI for qat
This patch adds KASUMI tests in the QAT testsuite.
Alg-Chaining tests have also been added in the KASUMI
SW PMD.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
e66917150e app/test: rename some SNOW 3G functions
Renamed authenticated encryption and encrypted authentication
tests with easily recognized names.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
dac3985e7c app/test: cleanup crypto code
Cleanup the code for code design consistency.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
50914e6c18 app/test: add NULL operation for qat
Added NULL algorithm to test file for Intel(R) QuickAssist
Technology Driver.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
0cde3f55c9 app/test: add aes-sha384-hmac for qat
Added aes-sha384-hmac algorithm to test file for Intel(R) QuickAssist
Technology Driver.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Deepak Kumar Jain
a8f21164cb app/test: add aes-sha224-hmac for qat
Added aes-sha224-hmac algorithm to test file for Intel(R) QuickAssist
Technology Driver.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Arek Kusztal
4a38d46e44 app/test: add MD5 HMAC for qat
Added MD5 HMAC hash algorithm to test file for Intel QuickAssist
Technology driver.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2016-10-04 20:41:09 +02:00
Maxime Coquelin
a1b87645d3 app/testpmd: reset headroom after txonly packet allocation
This patch fixes txonly raw packets allocations by resetting the
available headroom.

Indeed, some PMDs such as Virtio might prepend some data to the
packet, resulting in mbuf's data_off field to be decremented each
time the mbuf gets re-allocated.

For Virtio PMD, it means that we use only single descriptors for the
first times mbufs get allocated, as at some point there is not
enough headroom to store the header.

Other alternative would be use standard API to allocate the packets,
which does reset the headroom, but the impact on performance is too
big to consider this an option.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-10-05 15:17:12 +02:00
Jan Viktorin
13a1317d3b pci: create device list and fallback on its members
Now that rte_device is available, drivers can start using its members
(numa, name) as well as link themselves into another rte_device list.

As of now no one is using this list, but can be used for moving over all
devices (pdev/vdev/Xdev) and perform bulk actions (like cleanup).

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Reword commit log for extra rte_device list]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:34:03 +02:00
Jan Viktorin
2f3193cf0f pci: inherit common driver in PCI driver
Remove the 'name' member from rte_pci_driver and move to generic
rte_driver.

Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(<name>..)
as well as assigning a name to eth_driver.pci_drv.name member.
In this patch, only the original DRIVER_REGISTER_PCI(<name>..) name has
been populated into the rte_driver.name member - assignments through
eth_driver has been removed.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Rebase and expand changes to newly added files]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:55 +02:00
David Marchand
6751f6deb7 ethdev: get rid of device type
Now that hotplug has been moved to eal, there is no reason to keep the
device type in this layer.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-10-03 16:33:39 +02:00
Shreyansh Jain
af424af840 pci: replace devinit/devuninit with probe/remove
Probe and Remove are more appropriate names for PCI init and uninint
operations. This is a cosmetic change.

Only MLX* uses the PCI direct registration, bypassing PMD_* macro.
The callbacks for this too have been updated.

VDEV are left out. For them, init/uninit are more appropriate.

Suggested-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:01 +02:00
Jozef Martiniak
b4d63fb622 eal: customize delay function
When running single-core, some drivers tend to call rte_delay_us for a
long time, and that is causing packet drops.
To avoid this, rte_delay_us can be replaced with user-defined delay
function with:

void rte_delay_us_callback_register(void(*userfunc)(unsigned));

When userfunc==rte_delay_us_block build-in blocking delay function is
restored.

Signed-off-by: Jozef Martiniak <jozmarti@cisco.com>
2016-09-26 14:48:42 +02:00
Maryam Tahhan
af2c6fffe6 app/proc_info: check for primary process
Add a check to see if the primary process is running and exit gracefully
if it is not.

Suggested-by: Patrick Kutch <patrick.g.kutch@intel.com>
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2016-09-23 20:42:30 +02:00
Ferruh Yigit
b2fbb98789 app/testpmd: fix help of MTU set commmand
Fixes: ae03d0d18a ("app/testpmd: command to configure MTU")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-23 20:29:46 +02:00
James Poole
594302c722 app/testpmd: fix timeout in Rx queue flushing
When testpmd is run, the application would hang on the second time
that "start" is executed. This is because the timer limit would get
multiplied to an unreachably high number.

At the start of flush_fwd_rx_queues(), the timer limit now resets
to stop it from getting to this high number.

The timer has been made local for this function.

Fixes: f487715f36 ("app/testpmd: add timeout in Rx queue flushing")

Signed-off-by: James Poole <james.g.poole@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-09-23 20:20:07 +02:00
Olivier Matz
24427bb914 app/testpmd: fix crash when mempool allocation fails
Avoid access to mempool pointer if it is NULL.

Coverity issue: 127553
Fixes: b19a0c75a0 ("app/testpmd: remove anonymous mempool code")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-23 20:16:23 +02:00
Guruprasad Rao
fcbddedc53 app/test-pipeline: fix table hash LRU initialization
macro ‘APP_METADATA_OFFSET’ was not used to initialize
‘signature_offset’ and ‘key_offset’ part of struct
rte_table_hash_lru_params.
Instead integer offset values were directly used.

with this fix 'hash-8-lru', 'hash-16-lru', 'hash-32-lru' table types are
able to forward traffic as expected.

Fixes: 48f31ca50c ("app/pipeline: packet framework benchmark")

Signed-off-by: Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
Signed-off-by: Guruprasad Rao <guruprasadx.rao@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-09-23 19:19:51 +02:00
Jasvinder Singh
a0d655ee2f app/test: fix packet framework table unit tests
The pipeline object is not freed when a particular test-case of the
unit-test finishes. Using rte_pipeline_free() before returning the
outcome for each test-case fixes the issue.

Fixes: 5205954791 ("app/test: packet framework unit tests")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-09-23 18:50:19 +02:00
Olivier Matz
1c03be3c61 app/test: decrease memory requirements for sched
The sched test consumes 35MB memory. When memory is too fragmented (with
2M hugepages), the test can fail.

To reduce this risk, decrease it to 4.5MB by modifying
n_pipes_per_subport and qsize.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-09-23 18:43:25 +02:00
Olivier Matz
c4783d9666 app/test: decrease memory requirements for hash
In hash autotest, the size of tables that should be successfully created
is 32K entries (256KB), except for the table called "different_name",
which is 1M entries (8MB). When memory is too fragmented (with 2M
hugepages), the test can fail.

To avoid allocation failures due to memory fragmentation, decrease the
size of the table to 32K.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-09-23 18:40:50 +02:00
Pablo de Lara
2f45703c17 drivers: make driver names consistent
As discussed in the past release, driver names are modified
to be more consistent, and the future driver should follow
this new convention.

Driver names consist of:
"driver category"_"driver folder name"_"optional extra name".

For example:
- Crypto null driver       -> "crypto_null"
- Network IXGBE VF driver  -> "net_ixgbe_vf"

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-16 11:55:59 +02:00
Amine Kherbouche
f03723017a remove unused ring includes
This patch removes all unused <rte_ring.h> headers.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
2016-09-16 10:16:02 +02:00
Gowrishankar Muthukrishnan
1d73135f9f acl: add AltiVec for ppc64
This patch adds port for ACL library in ppc64le.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-09-09 17:56:14 +02:00
Gowrishankar Muthukrishnan
d2cc795934 lpm: add AltiVec for ppc64
This patch adds ppc64le port for LPM library in DPDK.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
2016-09-09 17:56:08 +02:00
David Marchand
c711ccb309 ivshmem: remove library and its EAL integration
Following discussions on the mailing list [1] and since nobody stood up to
implement the necessary cleanups, here is the ivshmem integration removal.

There is not much to say about this patch, a lot of code is being removed.
The default configuration file for packet_ordering example is replaced with
the "native" x86 file.
The only tricky part is in eal_memory with the memseg index stuff.

More cleanups can be done after this but will come in subsequent patchsets.

[1]: http://dpdk.org/ml/archives/dev/2016-June/040844.html

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2016-08-23 12:23:58 +02:00
Thomas Monjalon
d7e61ad3ae log: remove deprecated history dump
The log history feature was deprecated in 16.07.
The remaining empty functions are removed in 16.11.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-08-03 18:48:54 +02:00
Thomas Monjalon
aaf6065be5 mk: fix link with glibc < 2.17
There is a dependency on librt with old glibc.
The -lrt option was added everywhere it is needed but was also
added in some applications makefiles as the first link option.
The problem is this option is really useful only if added after
the objects or libraries using it (except if using --whole-archive).
And the -lrt options put after were removed to avoid duplicates.

It was resulting in errors linking test application:
eal_timer.c:(.text+0x128): undefined reference to `clock_gettime'
eal_timer.c:(.text+0x166): undefined reference to `clock_gettime'
eal_alarm.c:(.text+0xda): undefined reference to `clock_gettime'
eal_alarm.c:(.text+0x211): undefined reference to `clock_gettime'

It is fixed by removing superfluous -lrt in app makefiles.

Fixes: 281948b475 ("mk: fix missing librt dependencies")
Fixes: 2f6414f4ba ("mk: fix static link with glibc < 2.17")

Reported-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-25 17:54:57 +02:00
Thomas Monjalon
a5d7a3f77d unify tools naming
The following tools may be installed system-wide.
It may be cleaner and more convenient to find them with the same
dpdk- prefix (especially for autocompletion).
Moreover, the script dpdk_nic_bind.py deserves a new name because it is
not restricted to NICs and can be used for e.g. crypto.

These files are renamed:
pmdinfogen       -> dpdk-pmdinfogen
pmdinfo.py       -> dpdk-pmdinfo.py
dpdk_pdump       -> dpdk-pdump
dpdk_proc_info   -> dpdk-procinfo
dpdk_nic_bind.py -> dpdk-devbind.py
setup.sh         -> dpdk-setup.sh

The tools pmdinfogen, pmdinfo.py and dpdk_pdump are new in 16.07.

The scripts dpdk_nic_bind.py and setup.sh may have been used with
previous releases by end users. That's why a symbolic link still
provide the old name in the installed tools directory.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22 22:31:02 +02:00
Reshma Pattan
1c4466cb99 app/pdump: cleanup rings upon failures
Function create_mp_ring_vdev() for failure cases exits without
freeing the created rte rings, because of this, pdump tool cannot be
rerun successfully. Added rte ring cleanup logic upon failures.

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-07-22 17:57:15 +02:00
Thomas Monjalon
6262b92eaa app/test: increase memory allocated for greedy autotests
The autotest lists, requirements and distribution needs a big rework
to reduce the amount of cores and memory required.
The root cause is not addressed yet.

This patch just increase some memory allocation for some greedy tests
which often fail because of memory fragmentation:
LPM6 and reentrancy tests in groups 3 and 6 respectively.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21 23:59:26 +02:00
Thomas Monjalon
521de644ee app/test: disable filtering with stripped binary
The unavailable tests are filtered out by autotest by looking for
the symbols in the binary:

PCI autotest:                  Skipped [Not Available]       [00m 00s]
Malloc autotest:               Success                       [00m 00s]

It results to skip everything if the binary has no symbol (stripped):

PCI autotest:                  Skipped [Not Available]       [00m 00s]
Malloc autotest:               Skipped [Not Available]       [00m 00s]

This case is handled by getting back to the old behaviour if the binary
has no symbol information:

PCI autotest:                  Fail [Not found]              [00m 00s]
Malloc autotest:               Success                       [00m 00s]

Fixes: d553c8f2b1 ("app/test: filter out unavailable tests")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21 23:58:53 +02:00
Santosh Shukla
cdc34f8721 app/test: fix mempool freeing
test_mempool func not using pointer variable 'mp_ext' and incorrectly
freed. So removing ptr var. Now freeing mp_stack var.

Fixes: ea151eb48a ("app/test: migrate custom mempool handler to stack handler")

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21 23:54:10 +02:00
Jerin Jacob
69238e3cbe app/test: fix ring size
rte_ring_create expects the size of the ring to
be a power of 2. REFCNT_RING_SIZE value is not
power of 2 in-case if RTE_MAX_LCORE == 96.
Fix it by aligning the size to next power of 2 value.

Fixes: af75078f ("first public release")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-21 23:49:46 +02:00
Reshma Pattan
a5f51527b3 app/pdump: add command line options for socket paths
Since users of the pdump library and tool can chose to have their own
server and client paths, it is must for the pdump tool to use the same
server socket path that was used by primary application while
initializing packet capture framework by rte_pdump_init() or
rte_pdump_set_socket_dir() APIs.

To pass the socket path info to pdump tool a new optional command
line options "server-socket-path" and "client-socket-path" are added.

"client-socket-path" is also added, if the users want to have client
sockets in their own defined paths.

Updated pdump tool guide with the new changes.

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-16 11:31:37 +02:00
Reshma Pattan
0e3d2a9efa app/testpmd: remove redundant timer update
Inside flush_fwd_rx_queues removed redundant prev_tsc update with cur_tsc,
as prev_tsc value is always updated with rte_rdtsc() in for loop.

Coverity issue: 127797
Fixes: f487715f36 ("app/testpmd: add timeout in Rx queue flushing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-15 23:40:09 +02:00
Thomas Monjalon
d553c8f2b1 app/test: filter out unavailable tests
Some tests can fail to run because they are not compiled.
It has been more visible recently when the PCI test became disabled
in the default configuration because of dependency on libarchive:
    PCI autotest:    Fail [Not found]

The autotest script catch them and do not count them as an error anymore:
    PCI autotest:    Skipped [Not Available]

The commands dump_ring and dump_mempool are removed from the autotest list
because they are some internal commands but not some registered tests.
Thus they cannot be parsed as available test commands.

Suggested-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-15 17:25:07 +02:00
Thomas Monjalon
26e09db6cb app/test: rework command registration
The tests are registered with their command name by adding a structure
to a list. The structure of each test was declared in each test file
and passed to the register macro.
This rework generate the structure inside the register macro.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-15 17:25:02 +02:00
Thomas Monjalon
d7cdc5065b mk: fix default rule of test subdirectory
When using "make -C app/test" (with RTE_SDK/RTE_TARGET adjusted)
without specifying the rule (all), the build is not done.
Indeed the default rule is not "all" anymore since there are some
rules added for external resources link.

It is fixed by adding a reference to "all" at the top of the file
which makes it the default rule.

Note that make app/test_sub (without environment variable) is preffered.

Fixes: ab64f5df80 ("app/test: support resources externally linked")

Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2016-07-15 17:23:56 +02:00
Pablo de Lara
516c26da83 app/test: fix hexdump length for crypto
Plaintexts and ciphertexts are dumped when debugging is enabled,
using TEST_HEXDUMP. For Snow3G and KASUMI, their lengths are in bits,
but TEST_HEXDUMP uses bytes, so lenghts are passed in bytes now.

Fixes: 47df73a1a6 ("app/test: use hexdump if debug log is enabled")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-07-11 16:07:55 +02:00
Ilya Maximets
8d4df4e120 app/testpmd: fix comment of RSS setup
Since commit f2bb7ae1d2, behavior of rss_fwd_config_setup() changed
and description of this function is wrong now.

Also, there is a type mismatch in a loop.

Fixes: f2bb7ae1d2 ("app/testpmd: handle all Rx queues in RSS setup")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
2016-07-11 15:54:40 +02:00
Reshma Pattan
f487715f36 app/testpmd: add timeout in Rx queue flushing
Testpmd can stuck inside do while loop of the flush_fwd_rx_queues()
function. As non-zero packets are returned always by rte_eth_rx_burst()
function when compiled with no optimizations and if input line rate is
high. "do while" loop must exit at one stage to proceed further to
enable packet forwarding and forward the packets. So timer is set to
exit the do while loop after 1 second.

Fixes: af75078f ("first public release")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-11 15:35:06 +02:00
Wenzhuo Lu
eeb431d0aa app/testpmd: remove ixgbe check for bypass
In testpmd code, device id is used directly to check if bypass
is supported. But APP should not know the details of HW, the NIC
specific info should not be exposed here.
As every bypass API does know if it's supported, no need to check
that at first. So, this patch removes the *bypass_is_supported*.

Suggested-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-07-11 15:16:27 +02:00
Thomas Monjalon
c7cda4d8b4 app/test: remove useless clock estimation
The function get_machclk_freq() in RED test can be replaced by
rte_get_timer_hz() which already estimates the clock frequency at EAL init.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:19:56 +02:00
Yari Adan Petralanda
6dc34e0afe hash: retrieve a key given its position
The function rte_hash_get_key_with_position is added in this patch.
As the position returned when adding a key is frequently used as an
offset into an array of user data, this function performs the operation
of retrieving a key given this offset.

A possible use case would be to delete a key from the hash table when
its entry in the array of data has certain value. For instance, the key
could be a flow 5-tuple, and the value stored in the array a time
stamp.

Signed-off-by: Juan Antonio Montesinos <juan.antonio.montesinos.delgado@ericsson.com>
Signed-off-by: Yari Adan Petralanda <yari.adan.petralanda@ericsson.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:56:45 +02:00
Deepak Kumar Jain
a50eb86855 app/test: fix missing operation initialization
Initializing the authentication op parameter.

Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-07-10 14:55:42 +02:00
Pablo de Lara
cdfb776ba2 crypto: normalize driver names with macros
Recently reported, the introduction of pmd information exports led to a
breakage of cryptodev unit tests because the test infrastructure relies on the
cryptodev names being available in macros.  This patch fixes the pmd naming to
use the macro names.  Note that the macro names were already pre-stringified,
which won't work as the PMD_REGISTER_DRIVER macro requires the name in both a
processing token and stringified form.  As such the names are defined now as
tokens, and converted where needed to stringified form on demand using RTE_STR.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-08 19:20:26 +02:00
Remy Horton
d085232a14 ethdev: remove redundant id field in xstats name lookup
For all drivers that currently implement xstats, the id field in the
rte_eth_stats_name structure equals the entry's array index. This
patch eliminates the redundant id field as a direct index lookup is
faster than a search for the matching id field.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-01 16:09:06 +02:00
David Hunt
ea151eb48a app/test: migrate custom mempool handler to stack handler
After introducing the stack handler in the previous commit,
we now have very similar code to the custom handler in test_mempool.c,
which creates a custom mempool based on simple mallocs.
The stack handler is a cleaner example of adding a new mempool handler,
so this commit replaces the custom handler test with a stack
handler test, and removes the custom handler code.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-01 12:35:57 +02:00
Bruce Richardson
a0fd91cefc mempool: rename functions with confusing names
The mempool_count and mempool_free_count behaved contrary to what their
names suggested. The free_count function actually returned the number of
elements that were allocated from the pool, not the number unallocated as
the name implied.

Fix this by introducing two new functions to replace the old ones,
* rte_mempool_avail_count to replace rte_mempool_count
* rte_mempool_in_use_count to replace rte_mempool_free_count

In this patch, the new functions are added, and the old ones are marked
as deprecated. All apps and examples that use the old functions are
updated to use the new functions.

Fixes: af75078fec ("first public release")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-01 12:35:57 +02:00
Pablo de Lara
017d680a91 app/testpmd: limit number of forwarding cores
Number of forwarding cores must be equal or less than
number of forwarding streams, otherwise two cores
would try to use a same queue on a port, which is not allowed.

Fixes: f2bb7ae1d2 ("app/testpmd: handle all Rx queues in RSS setup")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-30 19:34:15 +02:00
Lazaros Koromilas
4b5062755a mempool: allow user-owned cache
The mempool cache is only available to EAL threads as a per-lcore
resource. Change this so that the user can create and provide their own
cache on mempool get and put operations. This works with non-EAL threads
too. This commit introduces the new API calls:

    rte_mempool_cache_create(size, socket_id)
    rte_mempool_cache_free(cache)
    rte_mempool_cache_flush(cache, mp)
    rte_mempool_default_cache(mp, lcore_id)

Changes the API calls:

    rte_mempool_generic_put(mp, obj_table, n, cache, flags)
    rte_mempool_generic_get(mp, obj_table, n, cache, flags)

The cache-oblivious API calls use the per-lcore default local cache.

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 11:28:10 +02:00
Lazaros Koromilas
656f2d3ede mempool: deprecate specific get and put functions
This commit introduces the API calls:

    rte_mempool_generic_put(mp, obj_table, n, is_mp)
    rte_mempool_generic_get(mp, obj_table, n, is_mc)

Deprecates the API calls:

    rte_mempool_mp_put_bulk(mp, obj_table, n)
    rte_mempool_sp_put_bulk(mp, obj_table, n)
    rte_mempool_mp_put(mp, obj)
    rte_mempool_sp_put(mp, obj)
    rte_mempool_mc_get_bulk(mp, obj_table, n)
    rte_mempool_sc_get_bulk(mp, obj_table, n)
    rte_mempool_mc_get(mp, obj_p)
    rte_mempool_sc_get(mp, obj_p)

We also check cookies in one place now.

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 11:28:10 +02:00
Eric Kinzie
17a064531a app/test: add external state machine in mode 4
This adds test cases for exercising the external state machine API to
the mode 4 autotest.

Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2016-06-20 18:43:03 +02:00
Reshma Pattan
9115326d99 app/pdump: fix type casting of ring size
ring_size value is wrongly type casted to uint16_t.
It should be type casted to uint32_t, as maximum
ring size is 28bit long. Wrong type cast
wrapping around the ring size values bigger than 65535.

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-27 16:50:24 +02:00
Reshma Pattan
819d48b9d0 app/pdump: fix string overflow
replaced strncpy with snprintf for safely
copying the strings.

Coverity issue: 127351

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-27 16:50:20 +02:00
Pablo de Lara
f0cb66e3de app/test: avoid freeing mbufs twice in qat test
Test_multi_session was freeing mbufs used in the multiple sessions
created and setting obuf to NULL after it, but ibuf was not being
set to NULL, and therefore, it was being freed again (ibuf and obuf
are pointing at the same address), in the ut_teardown() function.

Fixes: 1b9cb73ece ("app/test: fix qat autotest failure")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-27 16:44:12 +02:00
Thomas Monjalon
ae80e59ff7 app/test: fix PCI class probing
The PCI test was failing because some fake devices had no PCI class.

Fixes: 1dbba1650c ("app/test: remove real PCI ids")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-06-27 12:43:49 +02:00
Pablo de Lara
643e942719 app/test: avoid freeing mbuf twice
In cryptodev tests, when input and output buffers were the same,
the mbuf was being freed twice, causing refcnt_atomic to be negative.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-27 12:43:49 +02:00
Deepak Kumar Jain
7e20853db5 app/test: fix build with icc
Icc complains about variable may be used without setting.

Fixes: 97fe6461c7 ("app/test: add SNOW 3G performance test")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: John Griffin <john.griffin@intel.com>
2016-06-27 12:43:49 +02:00
Thomas Monjalon
c175e542c0 mk: fix parallel build of test resources
The build was failing sometimes when building with multiple
parallel jobs:
    # rm build/build/app/test/*res*
    # make -j6
    objcopy: 'resource.tmp': No such file

The reason is that each resource was built from the same temporary file.
The failure is seen because of a race condition when removing the
temporary file after each resource creation.
It also means that some resources may be created from the wrong source.

The fix is to have a different input file for each resource.
The source file is not directly used because it may have a long path
which is used by objcopy to name the symbols after some transformations.
When linking a tar resource, the input file is already in the current
directory. The hard case is for simply linked resources.
The trick is to create a symbolic link of the source file if it is not
already in the current build directory.
Then there is a replacement of dot by an underscore to predict the
symbol names computed by objcopy which must be redefined.

There is an additional change for the test_resource_c which is both
a real source file and a test resource. An intermediate file
test_resource.res is created to avoid compiling resource.c from the
wrong directory through a symbolic link.

Fixes: 1e9e0a6270 ("app/test: fix resource creation with objcopy on FreeBSD")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-24 16:57:27 +02:00
Wei Shen
be856325cb hash: add scalable multi-writer insertion with Intel TSX
This patch introduced scalable multi-writer Cuckoo Hash insertion
based on a split Cuckoo Search and Move operation using Intel
TSX. It can do scalable hash insertion with 22 cores with little
performance loss and negligible TSX abortion rate.

* Added an extra rte_hash flag definition to switch default single writer
  Cuckoo Hash behavior to multiwriter.
    - If HTM is available, it would use hardware feature for concurrency.
    - If HTM is not available, it would fall back to spinlock.

* Created a rte_cuckoo_hash_x86.h file to hold all x86-arch related
  cuckoo_hash functions. And rte_cuckoo_hash.c uses compile time flag to
  select x86 file or other platform-specific implementations. While HTM check
  is still done at runtime (same idea with
  RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT)

* Moved rte_hash private struct definitions to rte_cuckoo_hash.h, to allow
  rte_cuckoo_hash_x86.h or future platform dependent functions to include.

* Following new functions are created for consistent names when new platform
  TM support are added.
    - rte_hash_cuckoo_move_insert_mw_tm: do insertion with bucket movement.
    - rte_hash_cuckoo_insert_mw_tm: do insertion without bucket movement.

* One extra multi-writer test case is added.

Signed-off-by: Wei Shen <wei1.shen@intel.com>
Signed-off-by: Sameh Gobriel <sameh.gobriel@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-24 16:25:07 +02:00
David Hunt
99ca3b7a82 app/test: add mempool handler
Create a minimal custom mempool handler and check that it
passes basic mempool autotests.

Signed-off-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-24 11:01:05 +02:00
David Hunt
449c49b93a mempool: support handler operations
Until now, the objects stored in a mempool were internally stored in a
ring. This patch introduces the possibility to register external handlers
replacing the ring.

The default behavior remains unchanged, but calling the new function
rte_mempool_set_ops_byname() right after rte_mempool_create_empty() allows
the user to change the handler that will be used when populating
the mempool.

This patch also adds a set of default ops (function callbacks) based
on rte_ring.

Signed-off-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-24 11:01:05 +02:00
Jingjing Wu
87ce17abbe mbuf: add NSH packet type
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Zhe Tao <zhe.tao@intel.com>
2016-06-23 21:39:42 +02:00
Jerin Jacob
f56620dddb ethdev: add tunnel and port RSS offload types
- added VXLAN, GENEVE and NVGRE tunnel flow types
- added PORT flow type for accounting physical/virtual
port or channel number in flow creation

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2016-06-22 17:32:28 +02:00
Remy Horton
21b5bd0d66 app/testpmd: fix memory leaks after xstats errors
Fixes memory leaks detected by Coverity. These are due to ephemeral
memory allocations not being freed when errors occur.

Coverity issue: 127348

Fixes: e2aae1c1ce ("ethdev: remove name from extended statistic fetch")

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-21 15:55:11 +02:00
Pablo de Lara
9fa91cd0f7 app/test: refactor SNOW 3G and KASUMI tests
SNOW3G and KASUMI unit tests are very similar and
they were using duplicated code, so this commit
refactor and remove some of the duplicated functions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:58 +02:00
Pablo de Lara
2b52e1e95a app/test: add SNOW 3G UEA2 with offset
With the new libsso library, buffers can be encrypted/decrypted,
providing an offset in bits, so an extra unit test has been
added to cover this case.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:57 +02:00
Pablo de Lara
0bde1d7f7d app/test: add bit-level SNOW 3G UIA2
Snow3G PMD supports now buffers that are non byte multiple,
so tests to cover this case have been added.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:51 +02:00
Pablo de Lara
834649219f app/test: add out-of-place cases for SNOW 3G
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:50 +02:00
Pablo de Lara
8bd4d819bf app/test: fix buffer lengths for SNOW 3G
No padding was added in the input buffers for snow3G tests,
due to a wrong calculation of the length (should be multiple
of the block size). This fix takes into account the case
where the length is not byte multiple.

Fixes: 8bdf665fe6 ("app/test: add SNOW 3G")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:49 +02:00
Pablo de Lara
3e03286f43 app/test: use new bit-level memcmp macro
Instead of modifying the content of the buffers, to compare them
at bit-level, use the new macro TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT,
which does not make any modifications in the buffers.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:38:48 +02:00
Pablo de Lara
27a1c4714d app/test: add KASUMI crypto
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:25:43 +02:00
Pablo de Lara
db4faf4698 app/test: add new buffer comparison macros
In order to compare buffers with length and offset in bits,
new macros have been created, which use the previous compare function
to compare full bytes and then, compare first and last bytes of
each buffer separately.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:25:43 +02:00
Pablo de Lara
47df73a1a6 app/test: use hexdump if debug log is enabled
Instead of using the previous RTE_APP_TEST_DEBUG macro,
to dump memory when it was enabled (with rte_hexdump),
a new TEST_HEXDUMP is defined, which will call rte_hexdump
if RTE_LOG_LEVEL is set to RTE_LOG_DEBUG.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2016-06-20 17:45:10 +02:00
Pablo de Lara
936724c816 app/test: remove unnecessary hexdump
Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2016-06-20 17:44:28 +02:00
Pablo de Lara
897578de70 app/test: fix debug build
When RTE_APP_TEST_DEBUG is set, there were some errors:

app/test/test_cryptodev.c: In function ‘create_gcm_operation’:
app/test/test_cryptodev.c:3619:18: error: ‘struct rte_crypto_op’ has no member named ‘digest’
     ut_params->op->digest.data,
                  ^
app/test/test_cryptodev.c:3620:18: error: ‘struct rte_crypto_op’ has no member named ‘digest’
     ut_params->op->digest.length);
                  ^
app/test/test_cryptodev.c:3662:41: error: ‘struct rte_crypto_op’ has no member named ‘iv’
  rte_hexdump(stdout, "iv:", ut_params->op->iv.data, iv_pad_len);
                                         ^
app/test/test_cryptodev.c:3664:17: error: ‘struct rte_crypto_op’ has no member named ‘additional_auth’
    ut_params->op->additional_auth.data, aad_len);

Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2016-06-20 17:43:15 +02:00
Pablo de Lara
25b7313fc1 app/test: remove useless hexdump include
Cryptodev performance tests do not need to use any function
from rte_hexdump.h.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2016-06-20 17:42:34 +02:00
Deepak Kumar Jain
5d39a127f2 app/test: fix crypto typos
Fixing typo in the performance tests for example preftest to perftest.

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 17:42:33 +02:00
Fiona Trahe
390919829f app/test: update AES SHA performance test
Updating the AES performance test in line with snow3g performance test.
Output format has been updated so as to get better understanding of numbers.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 17:42:32 +02:00
Fiona Trahe
97fe6461c7 app/test: add SNOW 3G performance test
Adding performance test for snow3g wireless algorithm.
Performance test can run over both software and hardware.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
2016-06-20 17:42:31 +02:00
Fan Zhang
f468db6fa8 app/test: add more AES algorithms
This patch adds the HMAC-SHA224 and HMAC-SHA384 digest generation and
verification tests to crypto

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-20 17:42:31 +02:00
Fan Zhang
9c0eed2f06 app/test: rework crypto AES unit test
This patch reworks the crypto AES unit test by introducing a new unified
test function

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-20 17:42:29 +02:00
Jan Viktorin
1e9e0a6270 app/test: fix resource creation with objcopy on FreeBSD
Using of the /dev/stdin generates a warning when compiling on FreeBSD:

 objcopy: Warning: '/dev/stdin' is not an ordinary file
 app/test/Makefile:78: recipe for target 'test_resource_c.res.o' failed
 # ls -l /dev/stdin
 lrwxr-xr-x  1 root  wheel  4 Jun 17 12:24 /dev/stdin -> fd/0

Replace /dev/stdin by a temporary file.

Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-06-17 15:29:55 +02:00
Thomas Monjalon
8688b18a99 mk: mute build of test resources
The objcopy and tar commands were printed even in quiet mode.
They are now replaced by a simple line and still visible in verbose mode.

Fixes: ab64f5df80 ("app/test: support resources externally linked")
Fixes: 66819e6c11 ("app/test: support resources archived by tar")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-17 12:10:27 +02:00
Reshma Pattan
102b732950 app/testpmd: initialize pdump
Call rte_pdump_init and rte_pdump_uninit for packet
capturing initialization and uninitialization.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:40:26 +02:00
Reshma Pattan
caa7028276 app/pdump: add tool for packet capturing
The new pdump tool is added for packet capturing on dpdk.
This tool runs as secondary process by default.
Tool facilitates the command line options like
port, device_id, queue which user should pass on
to the tool to request the packet capture on those devices.

Tool creates the rte ring, mempool and pcap vdev and
calls the enable API of the pdump library with port/device_id,
queue, ring and mempool as arguments to enable the packet
capture on specific devices and gets the packets from the
primary process over the ring. Once the packets are
received, those packets will be send to the pcap vdev.

Tool can be terminated by using ctrl+c(SIGINT) upon which tool
calls the disable API of the pdump library to disable the packet capture
and dequeues the rest of the packets from the ring and sends them on
to the pcap vdev, then after releases all allocated resources.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:40:21 +02:00
Remy Horton
e2aae1c1ce ethdev: remove name from extended statistic fetch
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:12:00 +02:00
Slawomir Mrozowicz
6efad95f15 app/testpmd: print RSS hash update error
Calling rte_eth_dev_rss_hash_update without checking return value.
Fixed by handle return value and print out error status.

Coverity issue: 119251
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:46:38 +02:00
Zhihong Wang
933617d87e app/testpmd: show topology at forwarding start
This patch show topology at forwarding start.

"show config fwd" also does this, but showing it directly can reduce the
possibility of misconfiguration.

Currently fwd_config_display() calls fwd_config_setup(), this misleading
behavior will be fixed in other patches.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:34:48 +02:00
Zhihong Wang
f2bb7ae1d2 app/testpmd: handle all Rx queues in RSS setup
This patch removes constraints in rxq handling when multiqueue is enabled
to handle all the rxqs.

Current testpmd forces a dedicated core for each rxq, some rxqs may be
ignored when core number is less than rxq number, and that causes confusion
and inconvenience.

One example: an engineer was doing multiqueue test, there're 2
ports in guest each with 4 queues, and testpmd was used as the forwarding
engine in guest, as usual he used 1 core for forwarding, as a results he
only saw traffic from port 0 queue 0 to port 1 queue 0, then a lot of
emails and quite some time are spent to root cause it, and of course it's
caused by this unreasonable testpmd behavior.

Moreover, even if we understand this behavior, if we want to test the
above case, we still need 8 cores for a single guest to poll all the
rxqs, obviously this is too expensive.

We met quite a lot cases like this, one recent example:
http://openvswitch.org/pipermail/dev/2016-June/072110.html

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:26:35 +02:00
Zhihong Wang
0e10698030 app/testpmd: show throughput in port stats
This patch adds throughput numbers (in the period since last use of this
command) in port statistics display for "show port stats (port_id|all)".

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:26:09 +02:00
Zhihong Wang
acbf77a690 app/testpmd: add tx_first burst number option
This patch enables configurable tx_first burst number.

Use "start tx_first (burst_num)" to specify how many bursts of packets to
be sent before forwarding start, or "start tx_first" like before for the
default 1 burst send.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:25:25 +02:00
Zhihong Wang
bf56fce1fb app/testpmd: add retry option
This patch adds retry option in testpmd to prevent most packet losses.
It can be enabled by "set fwd <mode> retry". All modes except rxonly
support this option.

Adding retry mechanism expands test case coverage to support scenarios
where packet loss affects test results.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 16:23:24 +02:00
Bernard Iremonger
d76c19309a app/testpmd: stop forwarding on exit
Stop forwarding on exit whether all ports are started or not.

Fixes: ce8d561418 ("app/testpmd: add port configuration settings")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:20:29 +02:00
Bernard Iremonger
1e1d6bdd6d app/testpmd: check for valid mbuf pool
Fixes: b6ea6408fb ("ethdev: store numa_node per device")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:20:29 +02:00
Bernard Iremonger
931126baaf app/testpmd: check for valid socket id when attaching port
Fixes: edab33b1c0 ("app/testpmd: support port hotplug")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2016-06-16 10:20:28 +02:00
Bernard Iremonger
edf87b4ad0 app/testpmd: move forward streams initialisation
Move call to init_fwd_streams from start_port function
to start_packet_forwarding function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:20:28 +02:00
Bernard Iremonger
0c0db76f42 app/testpmd: separate forward config setup from display
Add call to fwd_config_setup to init_config.
Add call to fwd_config_setup for corelist, coremask and nbcore setup.
Add call to fwd_config_setup for portlist, portmask and nbport setup.
Add call to fwd_config_setup for rxq, txq, rxd and txd setup.
Remove fwd_config_setup from fwd_config_display.
Call the pkt_fwd_config_display function directly,
and remove the fwd_config_display wrapper function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:19:29 +02:00
Bernard Iremonger
0e545d3047 app/testpmd: check stopping port is not in bonding
Add new function port_is_bonding_slave
Use this function in stop_port and close_port functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:19:29 +02:00
Bernard Iremonger
a8ef3e3a98 app/testpmd: check stopping port is not forwarding
Add calls to port_is_forwarding function in stop_port and
close_port functions to check that port is not forwarding.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:10:06 +02:00
Bernard Iremonger
ebf5e9b715 app/testpmd: do not update forwarding config
Do not update forwarding configuration when attaching or detaching a port
Remove checks on test_done variable.
Remove code to update forwarding configuration.

Fixes: edab33b1c0 ("app/testpmd: support port hotplug")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-06-16 10:10:06 +02:00