Commit Graph

2508 Commits

Author SHA1 Message Date
Andrew Rybchenko
9f3b3a96de ethdev: remove legacy MACVLAN filter type support
Instead of MACVLAN filter RTE flow API should be used.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-03 23:35:05 +01:00
Lijun Ou
1848b117cc app/testpmd: fix RSS key for flow API RSS rule
When a flow API RSS rule is issued in testpmd, device RSS key is changed
unexpectedly, device RSS key is changed to the testpmd default RSS key.

Consider the following usage with testpmd:
1. first, startup testpmd:
 testpmd> show port 0 rss-hash key
 RSS functions: all ipv4-frag ipv4-other ipv6-frag ipv6-other ip
 RSS key: 6D5A56DA255B0EC24167253D43A38FB0D0CA2BCBAE7B30B477CB2DA38030F
          20C6A42B73BBEAC01FA
2. create a rss rule
 testpmd> flow create 0 ingress pattern eth / ipv4 / udp / end \
          actions rss types ipv4-udp end queues end / end

3. show rss-hash key
 testpmd> show port 0 rss-hash key
 RSS functions: all ipv4-udp udp
 RSS key: 74657374706D6427732064656661756C74205253532068617368206B65792
          C206F76657272696465

This is because testpmd always sends a key with the RSS rule,
if user provides a key as part of the rule that key is used, if user
doesn't provide a key, testpmd default key is sent to the PMDs, which is
causing device programmed RSS key to be changed.

There was a previous attempt to fix the same issue [1], but it has been
reverted back [2] because of the crash when 'key_len' is provided
without 'key'.

This patch follows the same approach with the initial fix [1] but also
addresses the crash.

After change, testpmd RSS key is 'NULL' by default, if user provides a
key as part of rule it is used, if not no key is sent to the PMDs at all

[1]
Commit a4391f8bae ("app/testpmd: set default RSS key as null")

[2]
Commit f3698c3d09 ("app/testpmd: revert setting default RSS")

Fixes: d0ad8648b1 ("app/testpmd: fix RSS flow action configuration")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-03 23:24:26 +01:00
Min Hu (Connor)
393e557ea8 app/testpmd: fix bonding xmit balance policy command
Currently there exists inconsistency about name of transmission
policy for a Link Bonding device. "xmit_balance_policy" is not
correct, which should be modified to "balance_xmit_policy".

Fixes: 2950a76931 ("bond: testpmd support")
Fixes: ac718398f4 ("doc: testpmd application user guide")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-03 23:24:24 +01:00
Yi Yang
c0d002aed9 gso: fix mbuf freeing responsibility
rte_gso_segment decreased refcnt of pkt by one, but
it is wrong if pkt is external mbuf, pkt won't be
freed because of incorrect refcnt, the result is
application can't allocate mbuf from mempool because
mbufs in mempool are run out of.

One correct way is application should call
rte_pktmbuf_free after calling rte_gso_segment to free
pkt explicitly. rte_gso_segment must not handle it, this
should be responsibility of application.

This commit changed rte_gso_segment in functional behavior
and return value, so the application must take appropriate
actions according to return values, "ret < 0" means it
should free and drop 'pkt', "ret == 0" means 'pkt' isn't
GSOed but 'pkt' can be transmitted as a normal packet,
"ret > 0" means 'pkt' has been GSOed into two or multiple
segments, it should use "pkts_out" to transmit these
segments. The application must free 'pkt' after call
rte_gso_segment when return value isn't equal to 0.

Fixes: 119583797b ("gso: support TCP/IPv4 GSO")
Cc: stable@dpdk.org

Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-11-03 22:45:02 +01:00
Pablo de Lara
55ab4a8c4f test/crypto: disable wireless cases for CPU crypto API
SNOW3G, KASUMI and ZUC algorithms have been added to
aesni_mb PMD in this release. These algorithms are not supported
for the crypto synchronous API, so the crypto tests for these algorithms
are disabled.

Fixes: ae8e085c60 ("crypto/aesni_mb: support KASUMI F8/F9")
Fixes: 6c42e0cf4d ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2")
Fixes: fd8df85487 ("crypto/aesni_mb: support ZUC-EEA3/EIA3")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
f32e93b18f app/bbdev: dequeue full ring in offload test
update offload dequeue to retrieve the full ring to be
agnostic of implementation.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
2ad0b15294 app/bbdev: reduce duration of throughput test
Reducing number of repetitions from 1000 to 100
to save time. Results are accurate enough with
100 loops.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
7456706a29 app/bbdev: skip bler test when compression is used
bler test results are not valid when LLR compression
is used or for loopback scenarios. Skipping these.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
5c3f7fc537 app/bbdev: define wait for offload
Replacing magic number for default wait time for hw
offload.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
3d6063a035 app/bbdev: include explicit HARQ preloading
Run preloading explicitly for unit tests. Load each code block
by reusing existing input op then restore for the actual test.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
c25604355a app/bbdev: add explicit check for counters
Adding explicit check in ut that the stats counters
have the expect values.
This was identified as a gap from code coverage.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
2020-11-02 09:24:41 +01:00
Nicolas Chautru
0ab66275a1 app/bbdev: add explicit test for latency vs validation
Adding explicit different ut when testing for validation
or latency (early termination enabled or not).

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
2020-11-02 09:24:41 +01:00
Thomas Monjalon
af270529ad ethdev: include mbuf registration in Tx timestamp API
Previously, the Tx timestamp field and flag were registered in testpmd,
as described in mlx5 guide.
For consistency between Rx and Tx timestamps,
managing mbuf registrations inside the driver, as properly documented,
is a simpler expectation.

The only driver to support this feature (mlx5) is updated
as well as the testpmd application.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-11-03 16:21:15 +01:00
Thomas Monjalon
c7e857e16f mbuf: remove deprecated timestamp field
As announced in the deprecation note, the field timestamp
is removed to give more space to the dynamic fields.
The related offload flag PKT_RX_TIMESTAMP is also removed.

This is how the mbuf layout looks like (pahole-style):

word  type                              name                byte  size
 0    void *                            buf_addr;         /*   0 +  8 */
 1    rte_iova_t                        buf_iova          /*   8 +  8 */
      /* --- RTE_MARKER64               rearm_data;                   */
 2    uint16_t                          data_off;         /*  16 +  2 */
      uint16_t                          refcnt;           /*  18 +  2 */
      uint16_t                          nb_segs;          /*  20 +  2 */
      uint16_t                          port;             /*  22 +  2 */
 3    uint64_t                          ol_flags;         /*  24 +  8 */
      /* --- RTE_MARKER                 rx_descriptor_fields1;        */
 4    uint32_t             union        packet_type;      /*  32 +  4 */
      uint32_t                          pkt_len;          /*  36 +  4 */
 5    uint16_t                          data_len;         /*  40 +  2 */
      uint16_t                          vlan_tci;         /*  42 +  2 */
 5.5  uint64_t             union        hash;             /*  44 +  8 */
 6.5  uint16_t                          vlan_tci_outer;   /*  52 +  2 */
      uint16_t                          buf_len;          /*  54 +  2 */
 7    uint64_t                          dynfield0[1];     /*  56 +  8 */
      /* --- RTE_MARKER                 cacheline1;                   */
 8    struct rte_mempool *              pool;             /*  64 +  8 */
 9    struct rte_mbuf *                 next;             /*  72 +  8 */
10    uint64_t             union        tx_offload;       /*  80 +  8 */
11    struct rte_mbuf_ext_shared_info * shinfo;           /*  88 +  8 */
12    uint16_t                          priv_size;        /*  96 +  2 */
      uint16_t                          timesync;         /*  98 +  2 */
12.5  uint32_t                          dynfield1[7];     /* 100 + 28 */
16    /* --- END                                             128      */

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-11-03 16:21:15 +01:00
Thomas Monjalon
7a0c64910c app/testpmd: switch Rx timestamp to dynamic mbuf field
The mbuf timestamp is moved to a dynamic field
in order to allow removal of the deprecated static field.
The related mbuf flag is also replaced.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-11-03 16:21:15 +01:00
Timothy McDaniel
d1112958f4 event/dlb: add self-tests
Add a variety of self-tests for both ldb and directed
ports/queues, as well as configure, start, stop, link, etc...

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2020-11-02 14:46:01 +01:00
Timothy McDaniel
6f1b82886e event/dlb2: add self-tests
Add a variety of self-tests for both ldb and directed
ports/queues, as well as configure, start, stop, link, etc...

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2020-11-02 09:40:22 +01:00
Guy Kaneti
30cf171352 app/regex: add job context
Store mbuf pointer associated with that job.

Signed-off-by: Guy Kaneti <guyk@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-11-03 02:06:03 +01:00
Guy Kaneti
d96d0fa710 app/regex: configure queue according to capabilities
configure qp with OOS according to device capabilities
returned from rte_regexdev_info_get.

Signed-off-by: Guy Kaneti <guyk@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-11-03 02:03:52 +01:00
David Marchand
45a059b08a app/eventdev: switch sequence number to dynamic mbuf field
The order test stored a sequence number in the deprecated mbuf field
seqn.
It is moved to a dynamic field in order to allow removal of seqn.

Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-10-31 22:14:43 +01:00
David Marchand
01f3496695 reorder: switch sequence number to dynamic mbuf field
The reorder library used sequence numbers stored in the deprecated field
seqn.
It is moved to a dynamic mbuf field in order to allow removal of seqn.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2020-10-31 22:14:30 +01:00
Thomas Monjalon
a4931d5b2d app/eventdev: switch flow ID to dynamic mbuf field
The order test stored the flow ID in the deprecated mbuf field udata64.
It is moved to a dynamic field in order to allow removal of udata64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
e2e0158381 test/graph: switch user data to dynamic mbuf field
The test used the deprecated mbuf field udata64.
It is moved to a dynamic field in order to allow removal of udata64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
6e1096939d test/distributor: switch sequence to dynamic mbuf field
The test used the deprecated mbuf field udata64.
It is moved to a dynamic field in order to allow removal of udata64.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-10-31 16:13:11 +01:00
Thomas Monjalon
530de86a12 test/mbuf: skip field registration at busy offset
There is a test for dynamic field registration at a specific offset.
Depending on which driver is probed, some dynamic fields may be
already registered at this offset.
This failure is skipped with a warning.

Fixes: 4958ca3a44 ("mbuf: support dynamic fields and flags")
Cc: stable@dpdk.org

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-10-31 16:13:10 +01:00
Honnappa Nagarahalli
0ca6007efc test/rcu: fix build with low core count
When RTE_MAX_LCORE value is small, following compiler errors
are observed.

../app/test/test_rcu_qsbr.c:296:54: error: iteration 2 invokes
undefined behavior [-Werror=aggressive-loop-optimizations]

../app/test/test_rcu_qsbr.c:315:55: error: array subscript is above
array bounds [-Werror=array-bounds]

Fixes: b87089b0bb ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-10-30 15:43:57 +01:00
Honnappa Nagarahalli
f72299fd15 test/ring: add stress tests for zero copy API
Add stress tests for zero copy API.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-29 14:13:31 +01:00
Honnappa Nagarahalli
83342a1339 test/ring: add functional tests for zero copy API
Add functional tests for zero copy APIs. Test enqueue/dequeue
functions are created using the zero copy APIs to fit into
the existing testing method.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-29 14:13:31 +01:00
Honnappa Nagarahalli
6c3416659f test/ring: fix integer cast to pointer
Use uintptr_t instead of unsigned long while initializing the
array of pointers.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-29 14:13:31 +01:00
Honnappa Nagarahalli
31354c762c test/ring: remove unnecessary braces
Remove unnecessary braces to improve readability.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-29 14:13:31 +01:00
Honnappa Nagarahalli
3097cc9f03 test/ring: fix memory dump
Pass the correct number of bytes to dump the memory.

Fixes: bf28df24e9 ("test/ring: add contention stress test")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-29 14:13:31 +01:00
Vladimir Medvedkin
eda44ced0e app/fib: select lookup
Added -v option to switch between different lookup implementations
to measure their performance and correctness.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-10-28 21:29:13 +01:00
Vladimir Medvedkin
4f66d3be56 fib: remove maximum type enums
FIB type RTE_FIB_TYPE_MAX is used only for sanity checks,
remove it to prevent applications start using it.
The same is for FIB6's RTE_FIB6_TYPE_MAX.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-10-28 21:23:11 +01:00
David Marchand
5d73663728 app/procinfo: clean old build macro
When merging this series after Bruce changes on build macros, an old macro
usage has been re-introduced.

Fixes: d82d6ac643 ("app/procinfo: add crypto security context info")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-26 12:03:31 +01:00
Dharmik Thakkar
9c7d8eed1a test/hash: add RCU tests
Add functional and performance tests for the integrated RCU QSBR.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2020-10-24 11:11:46 +02:00
Dharmik Thakkar
2f14f0284c test/hash: use C11 atomics in lock-free perf test
Replace rte_atomic APIs with C11 atomic APIs in
test_hash_readwrite_lf_perf.c

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2020-10-24 09:25:16 +02:00
Thomas Monjalon
19653eed40 remove config prefix used with make
The config options CONFIG_RTE_* are simple RTE_* defines with meson.
Now that make support is dropped, update the names in logs and comments.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-10-23 19:25:21 +02:00
Stephen Hemminger
cb056611a8 eal: rename lcore master and slave
Replace master lcore with main lcore and
replace slave lcore with worker lcore.

Keep the old functions and macros but mark them as deprecated
for this release.

The "--master-lcore" command line option is also deprecated
and any usage will print a warning and use "--main-lcore"
as replacement.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-10-20 13:17:08 +02:00
Stephen Hemminger
1dd6cffb65 app/procinfo: provide way to request info on owned ports
There are cases where a port maybe owned by another (failsafe, netvsc,
bond); but currently proc-info has no way to look at stats of those
ports. This patch provides way for the user to explicitly ask for these
ports.

If no portmask is given the output is unchanged; it only shows the
top level ports. If portmask requests a specific port it will be
shown even if owned.

Increase the size of port mask variable to unsigned long to
allow up to 64 ports to be handled on 64 bit architecture.

The device owner is also a useful thing to show in port info.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:43:43 +02:00
Hemant Agrawal
d82d6ac643 app/procinfo: add crypto security context info
If crypto context is not present, no point in displaying it.

This patch adds the crypto based security context info.
Also improve the flag printing to SECURITY OFFLOAD from
INLINE.

Use common code for displaying crypto context information
when doing show_ports and show_crypto.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-10-20 00:43:30 +02:00
Stephen Hemminger
acc9761152 app/procinfo: dump Rx and Tx descriptor info
Many drivers will report per queue info
as well as how many descriptors are in use.
Also display per-queue offload flags.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:42:20 +02:00
Stephen Hemminger
2cff94b6ae app/procinfo: add more port info
Revise the display of port information to include more data
and be more human friendly.

  * Show driver and device information
  * Show MAC address
  * Show flow control information
  * Combine lines if possible
  * Show all multicast mode
  * Show queue mempool name

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:41:49 +02:00
Stephen Hemminger
94c4199dfb app/procinfo: hide EAL info messages
The DPDK EAL info messages at the start of a diagnostic application
are not helpful to end user. Suppress them by setting log-level
by default.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:41:22 +02:00
Stephen Hemminger
92a500e14a app/procinfo: eliminate useless borders
Printing extra borders does not improve readability, and is just
unnecessary. Putting TSC hz in header also makes no sense here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:41:19 +02:00
Stephen Hemminger
012b318beb app/procinfo: remove unused logtype
This logtype is defined but never used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-20 00:41:07 +02:00
Ophir Munk
06ca0e4baa app/regex: fix crash in options parsing
getopt_long() parses command-line arguments. One of its arguments
'longopts' is a pointer to the first element of an array of struct
option.  The last element of the array has to be filled with zeros
to mark the end of options. For example:

struct option longopts[] = {
{ "help",  0, 0, ARG_HELP},
....
/* End of options */
{ 0, 0, 0, 0 }
};

This commit adds the last element. Prior to this commit getopt_long()
continued parsing beyond the longopts[] array which occasionally caused
segmentation faults.

Fixes: de06137cb2 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-10-20 00:05:54 +02:00
Bruce Richardson
a8d0d473a0 build: replace use of old build macros
Use the newer macros defined by meson in all DPDK source code, to ensure
there are no errors when the old non-standard macros are removed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-19 22:15:44 +02:00
Bruce Richardson
a20b2c01a7 build: standardize component names and defines
As discussed on the dpdk-dev mailing list[1], we can make some easy
improvements in standardizing the naming of the various components in DPDK,
and their associated feature-enabled macros.

Following this patch, each library will have the name in format,
'librte_<name>.so', and the macro indicating that library is enabled in the
build will have the form 'RTE_LIB_<NAME>'.

Similarly, for libraries, the equivalent name formats and macros are:
'librte_<class>_<name>.so' and 'RTE_<CLASS>_<NAME>', where class is the
device type taken from the relevant driver subdirectory name, i.e. 'net',
'crypto' etc.

To avoid too many changes at once for end applications, the old macro names
will still be provided in the build in this release, but will be removed
subsequently.

[1] http://inbox.dpdk.org/dev/ef7c1a87-79ab-e405-4202-39b7ad6b0c71@solarflare.com/t/#u

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2020-10-19 22:15:34 +02:00
Bruce Richardson
fac83b3ef8 app: fix missing dependencies
A number of lib and driver dependencies for various apps were missed on
build because the proper macro names for their use were mismatched between
meson and make build systems. Before adding in equivalent compatibility
macros we need to ensure to add the proper dependencies to ensure a valid
build.

Fixes: 16ade738fd ("app/testpmd: build with meson")
Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Fixes: 996ef11761 ("app: add all remaining apps to meson build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2020-10-19 22:04:32 +02:00
Ciara Power
89ce9f09e2 test/telemetry: fix socket resource leak
If an error occurred when reading from the socket, the function
returned without closing the socket. This is now fixed to avoid the
resource leak of the sock variable going out of scope.

Coverity issue: 363043
Fixes: bd78cf693e ("test/telemetry: add unit tests for data to JSON")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2020-10-19 17:01:58 +02:00
Ciara Power
8b4a23f115 test/telemetry: fix error handling for socket
When the socket connection failed, an error was printed to screen but
the function did not return an error, and continued to try read from the
socket. This is now corrected to close the socket and return -1 when the
connection fails.

Fixes: bd78cf693e ("test/telemetry: add unit tests for data to JSON")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-10-19 17:01:58 +02:00
Stephen Hemminger
17b347dab7 malloc: add alloc_size attribute to functions
By using the alloc_size() attribute the compiler can optimize
better and detect errors at compile time.

For example, Gcc will fail one of the invalid allocation examples
in app/test/test_malloc.c because the allocation is outside the
limits of memory.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-10-19 16:25:43 +02:00
Hemant Agrawal
f030bff72f bitrate: add free function
This patch adds support for free function.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-10-19 16:08:36 +02:00
Sarosh Arif
0e8704a453 test/distributor: fix mbuf leak on failure
rte_mempool_get_bulk is used to get bufs/many_bufs from the pool,
but at some locations when test fails the bufs/many_bufs are
not returned back to the pool.
Due to this, multiple executions of distributor_autotest gives the
following error message: Error getting mbufs from pool.
To resolve this issue rte_mempool_put_bulk is used whenever the test
fails and returns.

Fixes: c3eabff124 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
f72bff0ec2 test/distributor: fix quitting workers in burst mode
Sending number of packets equal to number of workers isn't enough
to stop all workers in burst version of distributor as more than
one packet can be matched and consumed by a single worker. This way
some of workers might not be awaken from rte_distributor_get_pkt().

This patch fixes it by sending packets one by one. Each sent packet
causes exactly one worker to quit.

Fixes: 775003ad2f ("distributor: add new burst-capable library")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
e1f1400cf6 test/distributor: ensure all packets are delivered
In all distributor tests there is a chance that tests
will send packets to distributor with rte_distributor_process()
before workers are started and requested for packets.

This patch ensures that all packets are delivered to workers
by calling rte_distributor_process() in loop until number
of successfully processed packets reaches required by test.
Change is applied to every first call in test case.

Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
3c57ec0098 test/distributor: add test with packets marking
All of the former tests analyzed only statistics
of packets processed by all workers.
The new test verifies also if packets are processed
on workers as expected.
Every packets processed by the worker is marked
and analyzed after it is returned to distributor.

This test allows finding issues in matching algorithms.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
92e69743ed test/distributor: fix race conditions on shutdown
Instead of making delays in test code and waiting
for worker hopefully to reach proper states,
synchronize worker shutdown test cases with spin lock
on atomic variable.

Fixes: c0de0eb82e ("distributor: switch over to new API")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
79c5e12ac2 test/distributor: collect return mbufs
During quit_workers function distributor's main core processes
some packets to wake up pending worker cores so they can quit.
As quit_workers acts also as a cleanup procedure for next test
case it should also collect these packets returned by workers'
handlers, so the cyclic buffer with returned packets
in distributor remains empty.

Fixes: c3eabff124 ("distributor: add unit tests")
Fixes: c0de0eb82e ("distributor: switch over to new API")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
2dfdfcb404 test/distributor: fix lcores statistics
Statistics of handled packets are cleared and read on main lcore,
while they are increased in workers handlers on different lcores.

Without synchronization occasionally showed invalid values.
This patch uses atomic mechanisms to synchronize.
Relaxed memory model is used.

Fixes: c3eabff124 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
13b13100ea test/distributor: fix freeing mbufs
Sanity tests with mbuf alloc and shutdown tests assume that
mbufs passed to worker cores are freed in handlers.
Such packets should not be returned to the distributor's main
core. The only packets that should be returned are the packets
send after completion of the tests in quit_workers function.

This patch stops returning mbufs to distributor's core.
In case of shutdown tests it is impossible to determine
how worker and distributor threads would synchronize.
Packets used by tests should be freed and packets used during
quit_workers() shouldn't. That's why returning mbufs to mempool
is moved to test procedure run on distributor thread
from worker threads.

Additionally this patch cleans up unused variables.

Fixes: c0de0eb82e ("distributor: switch over to new API")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
cf669d6930 test/distributor: fix shutdown of busy worker
The sanity test with worker shutdown delegates all bufs
to be processed by a single lcore worker, then it freezes
one of the lcore workers and continues to send more bufs.
The freezed core shuts down first by calling
rte_distributor_return_pkt().

The test intention is to verify if packets assigned to
the shut down lcore will be reassigned to another worker.

However the shutdown core was not always the one, that was
processing packets. The lcore processing mbufs might be different
every time test is launched. This is caused by keeping the value
of wkr static variable in rte_distributor_process() function
between running test cases.

Test freezed always lcore with 0 id. The patch stores the id
of worker that is processing the data in zero_idx global atomic
variable. This way the freezed lcore is always the proper one.

Fixes: c3eabff124 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tested-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Lukasz Wojciechowski
6bd951b482 distributor: fix buffer use after free
rte_distributor_request_pkt and rte_distributor_get_pkt dereferenced
oldpkt parameter when in RTE_DIST_ALG_SINGLE even if number
of returned buffers from worker to distributor was 0.

This patch passes NULL to the legacy API when number of returned
buffers is 0. This allows passing NULL as oldpkt parameter.

Distributor tests are also updated passing NULL as oldpkt and
0 as number of returned packets, where packets are not returned.

Fixes: 775003ad2f ("distributor: add new burst-capable library")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: David Hunt <david.hunt@intel.com>
2020-10-19 10:57:17 +02:00
Akhil Goyal
e30b2833c4 security: update session create API
The API ``rte_security_session_create`` takes only single
mempool for session and session private data. So the
application need to create mempool for twice the number of
sessions needed and will also lead to wastage of memory as
session private data need more memory compared to session.
Hence the API is modified to take two mempool pointers
- one for session and one for private data.
This is very similar to crypto based session create APIs.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-10-19 09:54:54 +02:00
Andrew Rybchenko
f6c763fbed ethdev: unify error code if port ID is invalid
Use ENODEV as the error code if specified port ID is invalid.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-17 01:14:50 +02:00
Ivan Ilchenko
62024eb827 ethdev: change stop operation callback to return int
Change eth_dev_stop_t return value from void to int.
Make eth_dev_stop_t implementations across all drivers to return
negative errno values if case of error conditions.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 22:26:41 +02:00
Ivan Ilchenko
0ead65af87 test: check stop call status
rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across test/event
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 22:26:41 +02:00
Ivan Ilchenko
e62c5a12d9 app/testpmd: check stop call status
rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across app/testpmd
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 22:26:41 +02:00
Ivan Ilchenko
5a3f9f7f9c app/flow-perf: check stop call status
rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across app/flow-perf
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 22:26:41 +02:00
Viacheslav Ovsiienko
2befc67ff6 app/testpmd: add extended Rx queue setup
If Rx queue is configured with split feature the extended
setup with specified segment sizes and pool will be performed.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 22:26:41 +02:00
Viacheslav Ovsiienko
91c78e090e app/testpmd: add rxoffs commands and parameters
Add command line parameter:

--rxoffs=X[,Y]

Sets the offsets of packet segments from the beginning of the
receiving buffer if split feature is engaged. Affects only the
queues configured with split offloads (currently BUFFER_SPLIT
is supported only).

Add interactive mode command, providing the same:

testpmd> set rxoffs (x[,y]*)

Where x[,y]* represents a CSV list of values, without white space.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 22:26:40 +02:00
Viacheslav Ovsiienko
0f2096d7ab app/testpmd: add rxpkts commands and parameters
Add command line parameter:

--rxpkts=X[,Y]

Sets the length of segments to scatter packets on receiving if split
feature is engaged. Affects only the queues configured with split
offloads (currently BUFFER_SPLIT is supported only).

Add interactive mode command:

testpmd> set rxpkts (x[,y]*)

Where x[,y]* represents a CSV list of values, without white space.

Sets the length of segments to scatter packets on receiving if split
feature is engaged. Affects only the queues configured with split
offloads (currently BUFFER_SPLIT is supported only). Optionally the
multiple memory pools can be specified with --mbuf-size command line
parameter and the mbufs to receive will be allocated sequentially
from these extra memory pools.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 22:26:40 +02:00
Viacheslav Ovsiienko
3b13528ac7 app/testpmd: add buffer split offload configuration
This patch add support for RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT
providing per queue configuration for this offload.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 22:26:40 +02:00
Viacheslav Ovsiienko
26cbb4191e app/testpmd: add multiple pools per core creation
The command line parameter --mbuf-size is updated, it can handle
the multiple values like the following:

--mbuf-size=2176,512,768,4096

specifying the creation the extra memory pools with the requested
mbuf data buffer sizes. If some buffer split feature is engaged
the extra memory pools can be used to configure the Rx queues
with rte_the_dev_rx_queue_setup_ex().

The extra pools are created with requested sizes, and pool names
are assigned with appended index: mbuf_pool_socket_%socket_%index.
Index zero is used to specify the first mandatory pool to maintain
compatibility with existing code.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 22:26:40 +02:00
Gregory Etelson
1b9f274623 app/testpmd: add commands for tunnel offload
Tunnel Offload API provides hardware independent, unified model
to offload tunneled traffic. Key model elements are:
 - apply matches to both outer and inner packet headers
   during entire offload procedure;
 - restore outer header of partially offloaded packet;
 - model is implemented as a set of helper functions.

Implementation details:

* Create application tunnel:
flow tunnel create <port> type <tunnel type>
On success, the command creates application tunnel object and returns
the tunnel descriptor. Tunnel descriptor is used in subsequent flow
creation commands to reference the tunnel.

* Create tunnel steering flow rule:
tunnel_set <tunnel descriptor> parameter used with steering rule
template.

* Create tunnel matching flow rule:
tunnel_match <tunnel descriptor> used with matching rule template.

* If tunnel steering rule was offloaded, outer header of a partially
offloaded packet is restored after miss.

Example:
test packet=
<Ether  dst=24:8a:07:8d:ae:d6 src=50:6b:4b:cc:fc:e2 type=IPv4 |
<IP  version=4 ihl=5 proto=udp src=1.1.1.1 dst=1.1.1.10 |
<UDP  sport=4789 dport=4789 len=58 chksum=0x7f7b |
<VXLAN  NextProtocol=Ethernet vni=0x0 |
<Ether  dst=24:aa:aa:aa:aa:d6 src=50:bb:bb:bb:bb:e2 type=IPv4 |
<IP  version=4 ihl=5 proto=icmp src=2.2.2.2 dst=2.2.2.200 |
<ICMP  type=echo-request code=0 chksum=0xf7ff id=0x0 seq=0x0 |>>>>>>>
>>> len(packet)
92

testpmd> flow flush 0
testpmd> port 0/queue 0: received 1 packets
src=50:6B:4B:CC:FC:E2 - dst=24:8A:07:8D:AE:D6 - type=0x0800 -
length=92

testpmd> flow tunnel 0 type vxlan
port 0: flow tunnel #1 type vxlan
testpmd> flow create 0 ingress group 0 tunnel_set 1
         pattern eth /ipv4 / udp dst is 4789 / vxlan / end
         actions  jump group 0 / end
Flow rule #0 created
testpmd> port 0/queue 0: received 1 packets
tunnel restore info: - vxlan tunnel - outer header present # <--
  src=50:6B:4B:CC:FC:E2 - dst=24:8A:07:8D:AE:D6 - type=0x0800 -
length=92

testpmd> flow create 0 ingress group 0 tunnel_match 1
         pattern eth / ipv4 / udp dst is 4789 / vxlan / eth / ipv4 /
         end
         actions set_mac_dst mac_addr 02:CA:FE:CA:FA:80 /
         queue index 0 / end
Flow rule #1 created
testpmd> port 0/queue 0: received 1 packets
  src=50:BB:BB:BB:BB:E2 - dst=02:CA:FE:CA:FA:80 - type=0x0800 -
length=42

* Destroy flow tunnel
flow tunnel destroy <port> id <tunnel id>

* Show existing flow tunnels
flow tunnel list <port>

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
2020-10-16 19:48:19 +02:00
Junyu Jiang
8c2c75be6b app/testpmd: fix flow flush with invalid port
There is no error info displayed when running flow flush
command with invalid port. This patch fixed the issue.

Fixes: 2a449871a1 ("app/testpmd: align behaviour of multi-port detach")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
2020-10-16 19:48:19 +02:00
Dekel Peled
05292bf931 app/testpmd: support VLAN attributes
rte_flow update introduced has_vlan field for ETH header item,
and field has_more_vlan for VLAN header item.
The new fields are used to clearly indicate packet tagging chrasteristics.
This patch updates testpmd CLI to support the new fields.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-10-16 19:48:19 +02:00
Bing Zhao
01817b10d2 app/testpmd: change hairpin queues setup
A new parameter `hairpin-mode` is introduced to the testpmd command
line. Bitmask value is used to provide a more flexible configuration.
This parameter should be used when `hairpinq` is specified in the
command line.

Bit 0 in the LSB indicates the hairpin will use the loop mode. The
previous port Rx queue will be connected to the current port Tx
queue.
Bit 1 in the LSB indicates the hairpin will use pair port mode. The
even index port will be paired with the next odd index port. If the
total number of the probed ports is odd, then the last one will be
paired to itself.
If this byte is zero, then each port will be paired to itself.
Bit 0 takes a higher priority in the checking.

Bit 4 in the second bytes indicate if the hairpin will use explicit
Tx flow mode.

e.g. in the command line, "--hairpinq=2 --hairpin-mode=0x11"

If not set, default value zero will be used and the behavior will
try to get aligned with the previous single port mode. If the ports
belong to different vendors' NICs, it is suggested to use the `self`
hairpin mode only.

Since hairpin configures the hardware resources, the port mask of
packets forwarding engine will not be used here.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-10-16 19:48:19 +02:00
Dekel Peled
8d035cb217 app/testpmd: support IPv6 fragment extension item
rte_flow update, following RFC [1], added to ethdev the rte_flow item
ipv6_frag_ext.
This patch updates testpmd CLI to support the new item and its fields.

To match on fragmented IPv6 packets, this item is added to pattern:
... ipv6 / ipv6_frag_ext ...

[1] http://mails.dpdk.org/archives/dev/2020-March/160255.html

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-10-16 19:48:18 +02:00
Dekel Peled
4bdd265768 app/testpmd: support IPv6 fragments
rte_flow update, following RFC [1], introduced has_frag_ext field for
IPv6 header item, used to indicate match on fragmented/non-fragmented
packets.
This patch updates testpmd CLI to support the new field.

To match on non-fragmented IPv6 packets, need to use pattern:
... ipv6 has_frag_ext spec 0 has_frag_ext mask 1 ...
To match on fragmented IPv6 packets, need to use pattern:
... ipv6 has_frag_ext spec 1 has_frag_ext mask 1 ...
To match on any IPv6 packets, the has_frag_ext field should
not be specified for match.

[1] https://mails.dpdk.org/archives/dev/2020-August/177257.html

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-10-16 19:48:18 +02:00
Dekel Peled
b3259edcf8 app/testpmd: support IPv4 fragments
This patch updates testpmd CLI to support fragment_offset field of
IPv4 header item.

To match on non-fragmented IPv4 packets, need to use pattern:
... ipv4 fragment_offset spec 0 fragment_offset mask 0x3fff ...
To match on fragmented IPv4 packets, need to use pattern:
... ipv4 fragment_offset spec 1 fragment_offset last 0x3fff
fragment_offset mask 0x3fff ...
(Use the full available range 1 to 0x3fff to include all possible
values.)
To match on any IPv4 packets, fragmented and non-fragmented,
the fragment_offset field should not be specified for match.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2020-10-16 19:48:18 +02:00
Andrey Vesnovaty
55509e3a49 app/testpmd: support shared flow action
This patch adds shared action support to testpmd CLI.

All shared actions created via testpmd CLI assigned ID for further
reference in other CLI commands. Shared action ID supplied as CLI
argument or assigned by testpmd is similar to flow ID & limited to
scope of testpdm CLI.

Create shared action syntax:
flow shared_action {port_id} create [action_id {shared_action_id}]
	[ingress] [egress] action {action} / end

Create shared action examples:
	flow shared_action 0 create action_id 100 \
		ingress action rss queues 1 2 end / end
	This creates shared rss action with id 100 on port 0.

	flow shared_action 0 create action_id \
		ingress action rss queues 0 1 end / end
	This creates shared rss action with id assigned by testpmd
	on port 0.

Update shared action syntax:
flow shared_action {port_id} update {shared_action_id}
	action {action} / end

Update shared action example:
	flow shared_action 0 update 100 \
		action rss queues 0 3 end / end
	This updates shared rss action having id 100 on port 0
	with rss to queues 0 3 (in create example rss queues were
	1 & 2).

Destroy shared action syntax:
flow shared_action {port_id} destroy action_id {shared_action_id} [...]

Destroy shared action example:
	flow shared_action 0 destroy action_id 100 action_id 101
	This destroys shared actions having id 100 & 101

Query shared action syntax:
flow shared_action {port} query {shared_action_id}

Query shared action example:
	flow shared_action 0 query 100
	This queries shared actions having id 100

Use shared action as flow action syntax:
flow create {port_id} ... / end actions [action / [...]]
	shared {action_id} / [action / [...]] end

Use shared action as flow action example:
	flow create 0 ingress pattern ... / end \
		actions shared 100 / end
	This creates flow rule where rss action is shared rss action
	having id 100.

All shared action CLIs report status of the command.
Shared action query CLI output depends on action type.

Signed-off-by: Andrey Vesnovaty <andreyv@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-10-16 19:48:18 +02:00
Michael Pfeiffer
9863627f52 net: add function to calculate IPv4 header length
Add a function to calculate the length of an IPv4 header as suggested
on the mailing list [1]. Call where appropriate.

[1] https://mails.dpdk.org/archives/dev/2020-October/184471.html

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:48:17 +02:00
Dekel Peled
2f622174bf app/testpmd: support query of age action
Following ethdev update in the previous patch of this series, this
patch adds CLI support to query information related to AGE action.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-10-16 19:48:17 +02:00
Jiawei Wang
43eda38f51 app/testpmd: support port and encap for sample action
Use sample action with ratio is 1 for mirroring flow, add
supports to set the different port or encap action for mirrored
packets.

The example of test-pmd command:

1. set sample_actions 1 port_id id 1 / end
   flow create 0 ... pattern eth / end actions
	sample ratio 1 index 1 / port_id id 2...
The flow will result in all the matched ingress packets will be sent to
port 2, and also mirrored the packets and sent to port 1.

2. set raw_encap 0 eth src.../ ipv4.../...
   set raw_encap 1 eth src.../ ipv4.../...
   set sample_actions 2 raw_encap index 0 / port_id id 0 / end
   flow create 0 ... pattern eth / end actions
	sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...
The flow will result in all the matched egress packets will be
encapsulated and sent to wire, and also mirrored the packets and with
the different encapsulated data and sent to wire.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 19:47:58 +02:00
Jiawei Wang
135e7de932 app/testpmd: add command for sample action
Add a new testpmd command 'set sample_actions' that supports the
multiple sample actions list configuration by using the index:
set sample_actions <index> <actions list>

The examples for the sample flow use case and result as below:

1. set sample_actions 0 mark id 0x8 / queue index 2 / end
.. pattern eth / end actions sample ratio 2 index 0 / jump group 2 ...

This flow will result in all the matched ingress packets will be
jumped to next flow table, and the each second packet will be
marked and sent to queue 2 of the control application.

2. ...pattern eth / end actions sample ratio 2 / port_id id 2 ...

The flow will result in all the matched ingress packets will be
duplicated and sent to the representor peer (VF or wire) on DPDK port 2,
and the each second packet will also be sent to E-Switch manager vport.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-10-16 19:47:58 +02:00
Ophir Munk
df655504e3 app/testpmd: cleanup tunnel protocols parsing
This is a cleanup commit.
It assembles all tunnel outer updates into one function call to avoid
code duplications.
It defines RTE_VXLAN_GPE_DEFAULT_PORT (4790) in accordance with all
other tunnel protocol definitions.
It replaces all numeric values 4789 in their corresponding definition
RTE_VXLAN_GPE_DEFAULT_PORT.
It updates the 'csum parse-tunnel' documentation.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:18:47 +02:00
Ophir Munk
2f60c649b1 app/testpmd: enable configuring GENEVE port
IANA has assigned port 6081 as the fixed well-known destination port for
GENEVE. Nevertheless draft-ietf-nvo3-geneve-09 recommends that
implementations make this configurable.  This commit enables specifying
any positive UDP destination port number for GENEVE protocol parsing.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:18:47 +02:00
Ophir Munk
ea0e711b8a app/testpmd: add GENEVE parsing
GENEVE is a widely used tunneling protocol in modern Virtualized
Networks. testpmd already supports parsing of several tunneling
protocols including VXLAN, VXLAN-GPE, GRE. This commit adds GENEVE
parsing of inner protocols (IPv4-0x0800, IPv6-0x86dd, Ethernet-0x6558)
based on IETF draft-ietf-nvo3-geneve-09. GENEVE is considered more
flexible than the other protocols.  In terms of protocol format GENEVE
header has a variable length options as opposed to other tunneling
protocols which have a fixed header size.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:18:47 +02:00
Sarosh Arif
a16baafbac app/testpmd: add speed capability in device info
Called rte_eth_dev_info_get() in testpmd, to get device info
so that speed capabilities can be printed under "show device info"

Bugzilla ID: 496

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:18:47 +02:00
Omkar Maslekar
4ffc2276e2 eal: add cache line demotion API
rte_cldemote is similar to a prefetch hint - in reverse.
On x86, cldemote(addr) enables software to hint to hardware that line is
likely to be shared. This is quite useful in core-to-core communications
where cache-line is likely to be shared.
ARM and PPC implementation is provided with NOP and can be added if any
equivalent instructions could be used for implementation on those
architectures.

Signed-off-by: Omkar Maslekar <omkar.maslekar@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2020-10-16 14:11:45 +02:00
Kevin Laatz
52bb6be259 test/service: fix race condition on stopping lcore
There is a potential race condition in 'service_attr_get' which will cause
test failures since the service core thread is still running while the
values are being retrieved/reset.

This patch fixes the race condition by waiting for the service core thread
to stop before continuing with the unit test checks.

Fixes: 4d55194d76 ("service: add attribute get function")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2020-10-16 13:47:07 +02:00
Timothy McDaniel
75d113136f eventdev: express DLB/DLB2 PMD constraints
This commit implements the eventdev ABI changes required by
the DLB/DLB2 PMDs.  Several data structures and constants are modified
or added in this patch, thereby requiring modifications to the
dependent apps and examples.

The DLB/DLB2 hardware does not conform exactly to the eventdev interface.
1) It has a limit on the number of queues that may be linked to a port.
2) Some ports a further restricted to a maximum of 1 linked queue.
3) DLB does not have the ability to carry the flow_id as part
   of the event (QE) payload. Note that the DLB2 hardware is capable of
   carrying the flow_id.

Following is a detailed description of the changes that have been made.

1) Add new fields to the rte_event_dev_info struct. These fields allow
the device to advertise its capabilities so that applications can take
the appropriate actions based on those capabilities.

    struct rte_event_dev_info {
	uint32_t max_event_port_links;
	/**< Maximum number of queues that can be linked to a single event
	 * port by this device.
	 */

	uint8_t max_single_link_event_port_queue_pairs;
	/**< Maximum number of event ports and queues that are optimized for
	 * (and only capable of) single-link configurations supported by this
	 * device. These ports and queues are not accounted for in
	 * max_event_ports or max_event_queues.
	 */
    }

2) Add a new field to the rte_event_dev_config struct. This field allows
the application to specify how many of its ports are limited to a single
link, or will be used in single link mode.

    /** Event device configuration structure */
    struct rte_event_dev_config {
	uint8_t nb_single_link_event_port_queues;
	/**< Number of event ports and queues that will be singly-linked to
	 * each other. These are a subset of the overall event ports and
	 * queues; this value cannot exceed *nb_event_ports* or
	 * *nb_event_queues*. If the device has ports and queues that are
	 * optimized for single-link usage, this field is a hint for how many
	 * to allocate; otherwise, regular event ports and queues can be used.
	 */
    }

3) Replace the dedicated implicit_release_disabled field with a bit field
of explicit port capabilities. The implicit_release_disable functionality
is assigned to one bit, and a port-is-single-link-only  attribute is
assigned to other, with the remaining bits available for future assignment.

	* Event port configuration bitmap flags */
	#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL    (1ULL << 0)
	/**< Configure the port not to release outstanding events in
	 * rte_event_dev_dequeue_burst(). If set, all events received through
	 * the port must be explicitly released with RTE_EVENT_OP_RELEASE or
	 * RTE_EVENT_OP_FORWARD. Must be unset if the device is not
	 * RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE capable.
	 */
	#define RTE_EVENT_PORT_CFG_SINGLE_LINK         (1ULL << 1)

	/**< This event port links only to a single event queue.
	 *
	 *  @see rte_event_port_setup(), rte_event_port_link()
	 */

	#define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3
	/**
	 * The implicit release disable attribute of the port
	 */

	struct rte_event_port_conf {
		uint32_t event_port_cfg;
		/**< Port cfg flags(EVENT_PORT_CFG_) */
	}

This patch also removes the depreciation notice and announce
the new eventdev ABI changes in release note.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-10-15 23:16:07 +02:00
Harman Kalra
95aef85164 app/eventdev: enable fast free offload
Since we are not holding the mbufs or creating any references
in the app, hence mbuf fast free offload can be enabled.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-10-15 23:03:49 +02:00
Ankur Dwivedi
07405a00c4 test/event: free resources after crypto adapter test
The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2020-10-15 22:07:39 +02:00
Ankur Dwivedi
45eb85e9bf test/event: fix function arguments for crypto adapter
The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Fixes: 3c2c535ecf ("test: add event crypto adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2020-10-15 22:01:47 +02:00
Ankur Dwivedi
3c56316517 test/event: check unsupported crypto adapter mode
The capability of a hardware event device should be checked before
creating a event crypto adapter in a particular mode. The test case
returns error if the mode is not supported.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2020-10-15 21:55:53 +02:00
Jay Jayatheerthan
df19eda6b1 test/event: add null dev creation in Rx adapter autotest
Allows creation of net_null if vdev EAL option is not specified and
uninit vdev created in the test. The change also adds error checks
for vdev init and uninit.

Signed-off-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2020-10-15 21:49:59 +02:00
Jay Jayatheerthan
aaa75327ac test/event: uninit vdevs in Rx adapter autotest
adapter_multi_eth_add_del() does vdev init but doesn't uninit them.
This causes issues when running event_eth_rx_adapter_autotest multiple
times.

The fix does vdev uninit before exiting the test.

Signed-off-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
2020-10-15 21:44:03 +02:00
Franck Lenormand
e7794508ae test/crypto: add PDCP-SDAP cases
A new functions which uses the structure of the test vectors for SDAP
is added and call a functions responsible to call the test_pdcp_proto
with the test vector both for encapsulation and decapsulation.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:24:41 +02:00
Franck Lenormand
1ba59ffebe test/crypto: rework PDCP function
The function test_pdcp_proto was relying to heavily on the structure
of test vectors for PDCP making it difficult to be reusable.

The function is changed to take all the test parameters as input and
does not need access to the tests vectors anymore.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
2020-10-14 22:24:41 +02:00
Franck Lenormand
003afde411 test/crypto: add test vectors for PDCP-SDAP
The test vectors are structured in a more readable way compared
to test vector for PDCP. This structure allows to have all the
information about a test vector at the same place.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:24:41 +02:00
Abhinandan Gujjar
7444937523 test/event_crypto_adapter: fix configuration
This patch updates the xform with right configuration.
For session based ops, sym session pool is created with
valid userdata size.

Fixes: 24054e3640 ("test/crypto: use separate session mempools")
Cc: stable@dpdk.org

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:22:06 +02:00
Fan Zhang
4868f6591c test/crypto: add cases for raw datapath API
This patch adds the cryptodev raw API test support to unit test.
In addition a new test-case for QAT PMD for the test type is
enabled.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:22:06 +02:00
Fan Zhang
8d928d47a2 cryptodev: change crypto symmetric vector structure
This patch updates ``rte_crypto_sym_vec`` structure to add
support for both cpu_crypto synchronous operation and
asynchronous raw data-path APIs. The patch also includes
AESNI-MB and AESNI-GCM PMD changes, unit test changes and
documentation updates.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:22:06 +02:00
Pablo de Lara
dcdd01691f test/crypto: add GMAC SGL
Add Scatter-Gather List tests for AES-GMAC.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-10-14 22:22:06 +02:00
Vikas Gupta
cee518e317 test/crypto: add bcmfs
Add global test suite for bcmfs crypto pmd

Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 22:22:06 +02:00
Ruifeng Wang
b65bf3c243 test/crypto: replace armv8 test suite
Switched from device specific test suite to unified
cryptodev test suite. Removed the armv8 device specific test suite.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 21:34:04 +02:00
Ruifeng Wang
b450503612 test/crypto: fix stats test
ut_setup / ut_teardown are invoked for each test case by test framework.
The call inside test_stats is unnecessary and even incorrect.
This caused double free of objects such as crypto operation structure.
Trapped the issue when RTE_LIBRTE_MEMPOOL_DEBUG was enabled.
Fix issue by removing ut_setup / ut_teardown from test case implementation.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Adam Dybkowski <adamx.dybkowski@intel.com>
2020-10-14 21:34:04 +02:00
Marcel Cornu
c94c520b41 crypto/aesni_mb: support AES-ECB
This patch adds AES-ECB 128, 192 and 256 support to the aesni_mb PMD.
AES-ECB 128, 192 and 256 test vectors added to cryptodev tests.

Signed-off-by: Marcel Cornu <marcel.d.cornu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-10-14 21:34:02 +02:00
Nicolas Chautru
99c886d3e3 app/bbdev: fix test vector symlink
5G DL default symlink was pointing to a 4G vector.

Fixes: d762705308 ("app/bbdev: add test vectors for 5GNR")
Cc: stable@dpdk.org

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
2020-10-14 21:32:11 +02:00
Adam Dybkowski
85b00824ae crypto/scheduler: rename slave to worker
This patch replaces the usage of the word 'slave' with more
appropriate word 'worker' in QAT PMD and Scheduler PMD
as well as in their docs. Also the test app was modified
to use the new wording.

The Scheduler PMD's public API was modified according to the
previous deprecation notice:
rte_cryptodev_scheduler_slave_attach is now called
rte_cryptodev_scheduler_worker_attach,
rte_cryptodev_scheduler_slave_detach is
rte_cryptodev_scheduler_worker_detach,
rte_cryptodev_scheduler_slaves_get is
rte_cryptodev_scheduler_workers_get.

Also, the configuration value RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES
was renamed to RTE_CRYPTODEV_SCHEDULER_MAX_NB_WORKERS.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 21:31:46 +02:00
Nagadheeraj Rottela
ce96577b4d test/crypto: replace NITROX PMD specific test suite
Replace NITROX PMD specific tests with generic test suite.

Signed-off-by: Nagadheeraj Rottela <rnagadheeraj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-10-14 21:30:10 +02:00
Maxime Coquelin
e6925585d9 baseband/fpga_lte_fec: fix API naming
DPDK APIs have to be prefixed with "rte_" in order to avoid
namespace pollution.

Let's fix it while fpga_lte_fec API is still experimental.
Fixes: efd453698c ("baseband/fpga_lte_fec: add driver for FEC on FPGA")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2020-10-14 21:29:59 +02:00
Maxime Coquelin
7adbb468fb baseband/fpga_5gnr_fec: fix API naming
DPDK APIs have to be prefixed with "rte_" in order to avoid
namespace pollution.

Let's fix it while fpga_5gnr_fec API is still experimental.

Fixes: 2d4306438c ("baseband/fpga_5gnr_fec: add configure function")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2020-10-14 21:28:31 +02:00
Nicolas Chautru
b17d70922d baseband/acc100: add configure function
Add configure function to configure the PF from within
the bbdev-test itself without external application
configuration the device.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-10-14 21:26:25 +02:00
Nicolas Chautru
9200ffa5cd baseband/acc100: add info get function
Add in the "info_get" function to the driver, to allow us to query the
device.
No processing capability are available yet.
Linking bbdev-test to support the PMD with null capability.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Liu Tianjiao <tianjiao.liu@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-10-14 21:06:56 +02:00
Ankur Dwivedi
ff56727b4f test/crypto: fix device number
In testsuite_setup(), ts_params is configured for first valid device.
The same device should be used as valid device in
test_device_configure_invalid_dev_id test case.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2020-10-14 21:06:56 +02:00
Vladimir Medvedkin
d26ec0d90e app/test-sad: fix uninitialized variable
Coverity issue: 362055
Fixes: 908be0651a ("app/test-sad: add test application for IPsec SAD")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-10-14 21:06:56 +02:00
Thomas Monjalon
3cd73a1a1c eal: simplify exit functions
The option RTE_EAL_ALWAYS_PANIC_ON_ERROR was off by default,
and not customizable with meson. It is completely removed.

The function rte_dump_registers is a trace of the bare metal support
era, and was not supported in userland. It is completely removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-10-15 22:33:47 +02:00
Harry van Haaren
31f83163cf eal: add new prefetch write variants
This commit adds new rte_prefetchX_write() variants, that suggest to the
compiler to use a prefetch instruction with intention to write. As a
compiler builtin, the compiler can choose based on compilation target
what the best implementation for this instruction is.

Three versions are provided, targeting the different levels of cache.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2020-10-15 21:49:59 +02:00
Savinay Dharmappa
b393ad5f56 test/sched: update subport rate dynamically
Modify the test_sched application to build the hierarchical scheduler
with default subport bandwidth profile. It also allows to update
a subport with different subport rates dynamically

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-10-15 02:14:21 +02:00
Savinay Dharmappa
ac6fcb841b sched: update subport rate dynamically
Add support to update subport rate dynamically.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-10-15 02:13:08 +02:00
Dmitry Kozlyuk
51fcb6a1fe cmdline: make implementation logically opaque
struct cmdline exposes platform-specific members it contains, most
notably struct termios that is only available on Unix. While ABI
considerations prevent from hinding the definition on already supported
platforms, struct cmdline is considered logically opaque from now on.
Add a deprecation notice targeted at 20.11.

* Remove tests checking struct cmdline content as meaningless.

* Fix missing cmdline_free() in unit test.

* Add cmdline_get_rdline() to access history buffer indirectly.
  The new function is currently used only in tests.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-10-15 00:39:10 +02:00
Konstantin Ananyev
45da22e42e acl: add 512-bit AVX512 classify method
Introduce classify implementation that uses AVX512 specific ISA.
rte_acl_classify_avx512x32() is able to process up to 32 flows in parallel.
It uses 512-bit width registers/instructions and provides higher
performance then rte_acl_classify_avx512x16(), but can cause
frequency level change.
Note that for now only 64-bit version is supported.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-14 14:23:01 +02:00
Konstantin Ananyev
b64c2295f7 acl: add 256-bit AVX512 classify method
Introduce classify implementation that uses AVX512 specific ISA.
rte_acl_classify_avx512x16() is able to process up to 16 flows in parallel.
It uses 256-bit width registers/instructions only
(to avoid frequency level change).
Note that for now only 64-bit version is supported.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-14 14:23:00 +02:00
Konstantin Ananyev
fdec15b801 test/acl: expand classify test coverage
Make classify test to run for all supported methods.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-14 14:23:00 +02:00
Konstantin Ananyev
bcb9a01659 app/acl: enhance displayed statistics
- enhance output to print extra stats
- use rte_rdtsc_precise() for cycle measurements

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-10-14 14:23:00 +02:00
Mairtin o Loingsigh
17a937baed net: add CRC AVX512 implementation
This patch enables the optimized calculation of CRC32-Ethernet and
CRC16-CCITT using the AVX512 and VPCLMULQDQ instruction sets. This CRC
implementation is built if the compiler supports the required instruction
sets. It is selected at run-time if the host CPU, again, supports the
required instruction sets.

Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-10-13 19:26:15 +02:00
Wei Hu (Xavier)
d9739192a7 test/cpuflags: add new Arm flags
This patch adds new flags into the test_cpuflags() functions for ARM64
platform, such as RTE_CPUFLAG_SVE, etc.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2020-10-13 17:57:52 +02:00
Ruifeng Wang
e9b9739264 config: remap flags used for Arm platforms
RTE_ARCH_xx flags are used to distinguish platform architectures.
These flags can be used to pick different code paths for different
architectures at compile time.
For Arm platforms, there are 3 flags in use: RTE_ARCH_ARM,
RTE_ARCH_ARMv7 and RTE_ARCH_ARM64.
RTE_ARCH_ARM64 is for 64-bit aarch64 platforms,
and RTE_ARCH_ARM & RTE_ARCH_ARMv7 are for 32-bit platforms.
RTE_ARCH_ARMv7 is for ARMv7 platforms as its name suggested.

The issue is meaning of RTE_ARCH_ARM is not clear enough.
Because no info about platform word length is included in the name.
To make the flag names more clear, a naming scheme is proposed.

RTE_ARCH_ARM (all Arm platforms)
    |
    +----RTE_ARCH_32 (New. 32-bit platforms of all architectures)
    |        |
    |        +----RTE_ARCH_ARMv7 (ARMv7 platforms)
    |        |
    |        +----RTE_ARCH_ARMv8_AARCH32 (aarch32 state on aarch64 machine)
    |
    +----RTE_ARCH_64 (64-bit platforms of all architectures)
             |
             +----RTE_ARCH_ARM64 (64-bit Arm platforms)

RTE_ARCH_32 will be explicitly defined for 32-bit platforms.

To fit into the new naming scheme, current usage of RTE_ARCH_ARM in
project is mapped to (RTE_ARCH_ARM && RTE_ARCH_32).

Matching flags for other architectures are:
RTE_ARCH_X86
    |
    +----RTE_ARCH_32
    |        |
    |        +----RTE_ARCH_I686
    |        |
    |        +----RTE_ARCH_X86_X32
    |
    +----RTE_ARCH_64
             |
             +----RTE_ARCH_X86_64

RTE_ARCH_PPC_64 ---- RTE_ARCH_64

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
2020-10-13 16:35:48 +02:00
Min Hu (Connor)
b19da32e31 app/testpmd: add FEC command
This commit adds testpmd capability to query and config FEC
function of device. This includes:
- show FEC capabilities, example:
	testpmd> show port 0 fec capabilities
- show FEC mode, example:
	testpmd> show port 0 fec_mode
- config FEC mode, example:
	testpmd> set port <port_id> fec_mode auto|off|rs|baser

	where:

	auto|off|rs|baser are four kinds of FEC mode which dev
	support according to MAC link speed.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Chengchang Tang <tangchengchang@huawei.com>
2020-10-09 13:17:43 +02:00
Ferruh Yigit
62aa0e8c66 app/testpmd: fix build with gcc 11
Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

../app/test-pmd/config.c:1777:61:
	warning: argument 3 of type ‘const uint32_t[n]’
	{aka ‘const unsigned int[n]’} declared as a variable length
	array [-Wvla-parameter]
 1777 | port_flow_list(portid_t port_id, uint32_t n,
 			const uint32_t group[n])
      |                 ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../app/test-pmd/config.c:53:
../app/test-pmd/testpmd.h:764:67:
	note: previously declared as a pointer ‘const uint32_t *’
	{aka ‘const unsigned int *’}
  764 | void port_flow_list(portid_t port_id, uint32_t n,
  				const uint32_t *group);
      |                         ~~~~~~~~~~~~~~~~^~~~~

Fixes: 938a184a18 ("app/testpmd: implement basic support for flow API")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
2020-10-08 12:44:37 +02:00
Pavan Nikhilesh
ca32fa67a7 trace: add size_t as generic trace point
Add size_t as a generic trace point. Also, update
test_generic_trace_point() to validate size_t emitter.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Sunil Kumar Kori <skori@mavell.com>
2020-10-07 14:44:03 +02:00
Louise Kilheeney
bd78cf693e test/telemetry: add unit tests for data to JSON
This patch adds tests for verifying telemetry data structures are
converted to JSON as expected. Both flat and recursive data structures
are tested, for all possible value types.

The app connects to the telemetry socket as a client, and registers one
command with a corresponding callback function. Each time the callback
function is called, it copies a global data variable to the data pointer
passed in by telemetry.
When a test case is run, the test case function builds up the global
data variable with the relevant data types, and the expected json string
output which should be generated from that. The 'test_output()' function
is used to trigger the callback and ensure the actual output matches
that expected.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-10-06 22:55:13 +02:00
Ferruh Yigit
40d64b33f7 app/procinfo: close devices before exit
As well as this is correct thing to close devices before exit, it is
also useful to test the closing devices from secondary process.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-06 22:00:35 +02:00
Bruce Richardson
4b3f8119c7 test/raw: remove ioat-specific autotest
Since the rawdev autotest can now be used to test all rawdevs on the
system, there is no need for a dedicated ioat autotest command.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2020-10-06 09:26:28 +02:00
Bruce Richardson
39f7b298fe test/raw: run selftest on all devices
Rather than having each rawdev provide its own autotest command, we can
instead just use the generic rawdev_autotest to test any and all available
rawdevs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2020-10-06 09:26:20 +02:00
Louise Kilheeney
3f6f83626c support python 3 only
Changed scripts to explicitly use Python 3 only, to avoid
maintaining Python 2.
Removed deprecation notices.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-10-02 13:51:00 +02:00
Chenbo Xia
9b53966243 app: fix ethdev port id size
The ethdev port id should be 16 bits now. This patch changes the
variable size of port id in applications from 8 bits to 16 bits.

Fixes: e977e4199a ("app/testpmd: add commands to load/unload BPF filters")
Fixes: 46cf97e4bb ("eventdev: add test for eth Tx adapter")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:15 +02:00
Li Zhang
6e315cf798 app/testpmd: extend ICMP flow matching fields
Ability to distinguish ICMP identifier fields in packets.
Distinguish ICMP sequence number field too.
Already supports ICMP code and type fields in current version.
Existing fields in ICMP header contain the required information.
ICMP header already is supported and no code change in RTE FLOW.
Extend testpmd CLI to include the fields of ident and sequence number.
One example:
flow create 0 ingress pattern eth / ipv4 /
 icmp code is 1 ident is 5 seq is 6 /
 end actions count / queue index 0 / end
The ICMP packet with code 1, identifier 5 and
sequence number 6 will be matched.
It will implement action counter and forward to queue 0.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:15 +02:00
Thomas Monjalon
2a449871a1 app/testpmd: align behaviour of multi-port detach
A port can be closed in multiple situations:
	- close command calling close_port() -> rte_eth_dev_close()
	- exit calling close_port() -> rte_eth_dev_close()
	- hotplug calling close_port() -> rte_eth_dev_close()
	- hotplug calling detach_device() -> rte_dev_remove()
	- port detach command, detach_device() -> rte_dev_remove()
	- device detach command, detach_devargs() -> rte_eal_hotplug_remove()

The flow rules are flushed before each close.
It was already done in close_port(), detach_devargs() and
detach_port_device() which calls detach_device(),
but not in detach_device(). As a consequence, it was missing for siblings
of port detach command and unplugged device.
The check before calling port_flow_flush() is moved inside the function.

The state of the port to close is checked to be stopped.
As above, this check was missing in detach_device(),
impacting the cases of a multi-port device unplugged or detached
with the port detach command.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:14 +02:00
Thomas Monjalon
85c6571c91 app/testpmd: reset port status on close notification
Since rte_eth_dev_release_port() is called on all port close operations,
the event RTE_ETH_EVENT_DESTROY can be reliably used for resetting
the port status on the application side.

The intermediate state RTE_PORT_HANDLING is removed in close_port()
because a port can also be closed by a PMD in a device remove operation.

In case multiple ports are closed, calling remove_invalid_ports()
only once is enough.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:14 +02:00
Thomas Monjalon
b142387b07 ethdev: allow drivers to return error on close
The device operation .dev_close was returning void.
This driver interface is changed to return an int.

Note that the API rte_eth_dev_close() is still returning void,
although a deprecation notice is pending to change it as well.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:13 +02:00
Huisong Li
700ded7aa1 app/testpmd: fix displaying Rx/Tx queues information
Currently, the information of Rx/Tx queues from PMD driver is not
displayed exactly in the rxtx_config_display function. Because
"ports[pid].rx_conf" and "ports[pid].tx_conf" maintained in testpmd
application may be not the value actually used by PMD driver. For
instance, user does not set a field, but PMD driver has to use the
default value.

This patch fixes rxtx_config_display so that the information of Rx/Tx
queues can be really displayed for the PMD driver that implement
.rxq_info_get and .txq_info_get ops callback function.

Fixes: 75c530c1bd ("app/testpmd: fix port configuration print")
Fixes: d44f8a485f ("app/testpmd: enable per queue configure")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
Chengchang Tang
25340d5342 app/testpmd: fix descriptor id check
The number of desc is a per queue configuration. But in the check
function, nb_txd & nb_rxd are used to check whether the desc_id is
valid. nb_txd & nb_rxd are the global configuration of number of desc.
If the queue configuration is changed by cmdline liks: "port config xx
txq xx ring_size xxx", the real value will be changed.

This patch use the real value to check whether the desc_id is valid.
And if these are not configured by user. It will use the default value
to check it, since the rte_eth_rx_queue_setup & rte_eth_tx_queue_setup
will use a default value to configure the queue if nb_rx_desc or
nb_tx_desc is zero.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
Chengchang Tang
b253a6bbf1 app/testpmd: fix packet header in txonly mode
In txonly forward mode, the packet header is fixed by the initial
setting, including the packet length and checksum. So when the packets
varies, this may cause a packet header error. Currently, there are two
methods in txonly mode to randomly change the packets.
1. Set txsplit random and txpkts (x[,y]*), the number of segments
   each packets will be a random value between 1 and total number of
   segments determined by txpkts settings.
   The step as follows:
     a) ./testpmd -w xxx -l xx -n 4 -- -i --disable-device-start
     b) port config 0 tx_offload multi_segs on
     c) set fwd txonly
     d) set txsplit rand
     e) set txpkts 2048,2048,2048,2048
     f) start
The nb_segs of the packets sent by testpmd will be 1~4. The real packet
length will be 2048, 4096, 6144 and 8192. But in fact the packet length
in ip header and udp header will be fixed by 8178 and 8158.

2. Set txonly-multi-flow. the ip address will be varied to generate
   multiple flow.
   The step as follows:
     a) ./testpmd -w xxx -l xx -n 4 -- -i --txonly-multi-flow
     b) set fwd txonly
     c) start
The ip address of each pkts will change randomly, but since the header
is fixed, the checksum may be a error value.

Therefore, this patch adds a function to update the packet length and
check sum in the pkts header when the txsplit mode is set to rand or
multi-flow is set.

Fixes: 82010ef55e ("app/testpmd: make txonly mode generate multiple flows")
Fixes: 79bec05b32 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
Chengchang Tang
8dae835d88 app/testpmd: remove restriction on Tx segments set
Currently, if nb_txd is not set, the txpkts is not allowed to be set
because the nb_txd is used to avoid the number of segments exceed the Tx
ring size and the default value of nb_txd is 0. And there is a bug that
nb_txd is the global configuration for Tx ring size and the ring size
could be changed by some command per queue. So these valid check is
unreliable and introduced unnecessary constraints.

This patch adds a valid check function to use the real Tx ring size to
check the validity of txpkts.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
Chengchang Tang
57d4198a0b app/testpmd: fix VLAN configuration on failure
When failing to configure VLAN offloads after the port was started, there
is no need to update the port configuration. Currently, when user
configure an unsupported VLAN offloads and fails, and then restart the
port, it will fails since the configuration has been refreshed.

This patch makes the function return directly instead of refreshing the
configuration when execution fails.

Fixes: 384161e006 ("app/testpmd: adjust on the fly VLAN configuration")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
Chengchang Tang
b428e71775 app/testpmd: fix port id check in Tx VLAN command
To set Tx vlan offloads, it is required to stop port firstly. But before
checking whether the port is stopped, the port id entered by the user
is not checked for validity. When the port id is illegal, it would lead
to a segmentation fault since it attempts to access a member of
non-existent port.

This patch adds verification of port id in tx vlan offloads and remove
duplicated check.

Fixes: 597f9fafe1 ("app/testpmd: convert to new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:13 +02:00
David Liu
6b67721dee app/testpmd: add EEPROM command
Add module EEPROM/EEPROM dump command
   "show port <port_id> (module_eeprom|eeprom)"
Commands will dump the content of the EEPROM/module
EEPROM for the selected port.

Signed-off-by: David Liu <dliu@iol.unh.edu>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-30 19:19:10 +02:00
Ciara Power
c2c92c5d88 app: remove references to make-based config
Make is no longer supported, RTE_SDK, RTE_TARGET and CONFIG options
are no longer in use.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2020-10-01 16:41:20 +02:00
Steven Lariau
c51e67c2ee test/stack: remove thread synchronisation
Remove the part that checks if there is enough room in the stack, it's
always true as long as size of stack >= MAX_BULK*rte_lcore_count().
This check used an atomic cmpset, and read / write to a shared size
variable. These operations result in some form of synchronization
that might get in the way of the actual stack testing.

Signed-off-by: Steven Lariau <steven.lariau@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2020-09-30 21:08:39 +02:00
Steven Lariau
044421312c test/stack: check errors for multi-threads
Use rte_eal_wait_lcore to wait and get the return value for all cores.
This is used to propagate any error to the main core.

Signed-off-by: Steven Lariau <steven.lariau@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2020-09-30 21:08:39 +02:00
Steven Lariau
e67925af17 test/stack: remove unneeded memory allocations
Replace the arguments array by one argument.
All objects in the args array have the same values, so there is no need
to use an array, only one struct is enough.
The args object is a lot smaller, and the allocation can be replaced
with a global variable.
As a consequence of using a single argument, there is no need to use a
loop to launch the test on every core one by one. Replace it with
rte_eal_mp_remote_launch.

The allocation of obj_table isn't needed either, because MAX_BULK is
small. The allocation can instead be replaced with a static array.

Signed-off-by: Steven Lariau <steven.lariau@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2020-09-30 21:08:39 +02:00
Radu Nicolau
84fb33fec1 build: remove deprecated cpuflag macros
Replace use of RTE_MACHINE_CPUFLAG macros with regular compiler
macros, which are more complete than those provided by DPDK, and as such
it allows new instruction sets to be leveraged without having to do
extra work to set them up in DPDK.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-09-25 11:13:57 +02:00
Feifei Wang
46697431ad test/ring: enhance debug info in failure cases
Add more parameters into the macro TEST_RING_VERIFY and expand the scope
of application for it. Then replace all ring APIs check with
TEST_RING_VERIFY to facilitate debugging.

Furthermore, correct a spelling mistakes of the macro
TEST_RING_FULL_EMTPY_ITER.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 11:23:10 +02:00
Feifei Wang
6c583103a2 test/ring: factorize object checks
Do code clean up by moving repeated code inside 'test_ring_mem_cmp'
function to validate data and print information of enqueue/dequeue
elements if validation fails.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 11:23:10 +02:00
Feifei Wang
f68c206639 test/ring: validate single element enqueue/dequeue
Validate the return value of single element enqueue/dequeue operation in
the test.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 11:23:10 +02:00
Feifei Wang
c570da3671 test/ring: check dequeued object for single element
Add check in test_ring_basic_ex and test_ring_with_exact_size for single
element enqueue and dequeue operations to validate the dequeued objects.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 11:23:08 +02:00
Feifei Wang
d943c60565 test/ring: fix dequeued object checks
When using memcmp function to check data, the third param should be the
size of all elements, rather than the number of the elements.

Fixes: a9fe152363 ("test/ring: add custom element size functional tests")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 08:53:33 +02:00
Feifei Wang
f642148eea test/ring: fix number of single element enqueue/dequeue
The ring capacity is (RING_SIZE - 1), thus only (RING_SIZE - 1) number of
elements can be enqueued into the ring.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 08:53:33 +02:00
Feifei Wang
6450023ca2 test/ring: fix object reference for single element enqueue
When enqueue one element to ring in the performance test, a pointer
should be passed to rte_ring_[sp|mp]enqueue APIs, not the pointer
to a table of void *pointers.

Fixes: a9fe152363 ("test/ring: add custom element size functional tests")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-09-23 08:53:33 +02:00
Chengchang Tang
61efaf5b62 ethdev: support getting Rx buffer size in Rx queue info
Add a field named rx_buf_size in rte_eth_rxq_info to indicate the buffer
size used in receiving packets for HW.

In this way, upper-layer users can get this information by calling
rte_eth_rx_queue_info_get.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-21 18:05:38 +02:00
Ivan Dyukov
ba5509a6a8 app: use new link status print format
Add usage of rte_eth_link_to_str function to applications and docs.

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-21 18:05:37 +02:00
Ivan Dyukov
fbf931c9c3 ethdev: format link status text
There is new link_speed value introduced. It's INT_MAX value which
means that speed is unknown. To simplify processing of the value
in application, new function is added which convert link_speed to
string. Also dpdk examples have many duplicated code which format
entire link status structure to text.

This commit adds two functions:
  * rte_eth_link_speed_to_str - format link_speed to string
  * rte_eth_link_to_str - convert link status structure to string

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-21 18:05:37 +02:00
Kiran Kumar K
94198f40f2 app/testpmd: support RSS level configuration
Adding support to set RSS level from ethdev config.
level-default will requests the default behavior.
level-outer will requests RSS to be performed on the outermost packet
encapsulation level.
level-inner will request RSS to be performed on the specified inner
packet encapsulation level, from outermost to innermost.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-09-18 18:55:12 +02:00
Bruce Richardson
54f89e3df4 app/testpmd: fix name of bitrate library in meson build
The bitrate library in DPDK is actually in a "bitratestats" directory,
so that is used by meson for the macro and library name.
Therefore, we need to update references to RTE_LIBRTE_BITRATE to
RTE_LIBRTE_BITRATESTATS in testpmd to have it found. Rather than
supporting both defines, since make is being removed, we can just
replace all instances of the former define with the latter.

To ensure testpmd links ok when this is done, we also need to add
bitratestats to the list of library dependencies.

Fixes: 5b9656b157 ("lib: build with meson")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
9783092022 app/flow-perf: allow fixed values for actions
Sometime the user want to have fixed values of
encap/decap or header modify for all flows.

This will introduce the ability to choose from
fixed or dynamic values by setting the flag in
config.h

To use different value for each flow:
config.h: #define FIXED_VALUES 0

To use single value for all flows:
config.h: #define FIXED_VALUES 1

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
7bcd402d7e app/flow-perf: support ICMP matching
Start support matching on icmpv4 and icmpv6.

Usage:
--icmpv4: add icmp item to match on.
--icmpv6: add icmpv6 item to match on.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
325bd805e4 app/flow-perf: add port mask option
Sometimes you need to check flow performance for
certain port and not all ports. Thus a portmask
option is needed.

Usage:
--portmask=N

Where N represent the hexadecimal bitmask of ports
used.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
b60fceb5ef app/flow-perf: add random mark values
Instead of having single id value, use up to 256
values, thus we make sure that all flows will not
use same mark action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
cfa7554de1 app/flow-perf: fix IPv4 source matching
All value must be converted into intended endianness.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
0a0757a0db app/flow-perf: support VXLAN encap/decap actions
Introduce vxlan-encap and vxlan-decap actions.

vxlan-encap have fixed pattern and values for
encap data.

Usage example:
--vxlan-encap
--vxlan-decap

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
0c8f1f4ab9 app/flow-perf: support raw encap/decap actions
Introduce raw-encap and raw-decap actions.
The two actions are added in command line
options, and for the data to encap or decap
the user need to parse it within the command
line.

All values of raw-encap data is set to be fixed
values.

Usage example:

--raw-encap=ether,ipv4,udp,vxlan

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:11 +02:00
Wisam Jaddo
b777d9d046 app/flow-perf: fix memory leak from RSS action
Currently, each call for add_rss_action will allocate
extra memory for rss_data, which will reflect bad results
on memory consumption for all flows, and will leads into
memory leak.

In this fix, it will check if it's allocated before
reallocating it.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00
Wisam Jaddo
d71bc9e99c app/flow-perf: support flag action
Introduce flag action support to flow perf
application.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00
Wisam Jaddo
ef9ae0cf57 app/flow-perf: support header modify actions
Introduce headers modify actions in the app.
All header modify actions will add different value
for each flow, to make sure each flow will create
and use it's own actions.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00
Wisam Jaddo
9001a863f4 app/flow-perf: support user order
The old design was using the bit mask to identify
items, action and attributes.

So it was all based on the order of the code itself,
to place the order of the actions, items & attributes
inside the flows. Such design will lead into many failures
when some PMD support order different than other PMD,
in the end the rules will fail to create. Also sometimes
the user needs to have one action before other actions
and vice versa, so using new design of arrays that
take user order into consideration make more sense.

After this patch, we start supporting inner items
and more than one instance of same action.

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00
Wisam Jaddo
849543648e app/flow-perf: fix actions mask
Actions have it's own macro which is FLOW_ACTION_MASK

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2020-09-18 18:55:10 +02:00
Nithin Dabilpuram
bb52561e53 app/testpmd: add TM command for non-leaf and packet mode
Add TM command to enable packet mode for all SP children
in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

Also add support to shaper profile add command to take
packet mode parameter used to setup shaper in packet mode.
This adds an extra argument "packet_mode" to shaper profile add command
"add port tm node shaper profile" as last argument.

This patch also dumps new tm port/level/node capabilities
sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported,
shaper_private_packet_mode_supported, shaper_private_byte_mode_supported,
shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-09-18 18:55:10 +02:00
Dharmik Thakkar
4016f0bc45 app/testpmd: count empty polls in 5-tuple swap engine
Enable empty polls in burst stats within 5tswap.c

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:08 +02:00
Phil Yang
059a231080 app/testpmd: enable burst stats for noisy VNF mode
Add burst stats for noisy VNF mode.

Fixes: 3c156061b9 ("app/testpmd: add noisy neighbour forwarding mode")
Cc: stable@dpdk.org

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:08 +02:00
Dharmik Thakkar
0e4b196326 app/testpmd: add record-burst-stats runtime config
Convert CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS to a
runtime configuration.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:08 +02:00
Dharmik Thakkar
bc700b6767 app/testpmd: add record-core-cycles runtime config
Convert CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES to a
runtime configuration.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-18 18:55:08 +02:00
Ferruh Yigit
5723fbed4f ethdev: remove underscore prefix from internal API
'_rte_eth_dev_callback_process()' & '_rte_eth_dev_reset()' internal APIs
has unconventional underscore ('_') prefix.
Although this is not documented most probably this is to mark them as
internal. Since we have '__rte_internal' flag to mark this, removing '_'
from API names.

For '_rte_eth_dev_reset()', there is already a public API named
'rte_eth_dev_reset()', so renaming '_rte_eth_dev_reset()' to
'rte_eth_dev_internal_reset'.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
2020-09-18 18:55:08 +02:00
Harry van Haaren
8b6b2bf6b5 test/service: fix race condition on stopping lcore
This commit fixes a potential race condition in the tests
where the lcore running a service would increment a counter
that was already reset by the test-suite thread. The resulting
race-condition incremented value could cause CI failures, as
indicated by DPDK's CI.

This patch fixes the race-condition by making use of the
added rte_service_lcore_active() API, which indicates when
a service-core is no longer in the service-core polling loop.

The unit test makes use of the above function to detect when
all statistics increments are done in the service-core thread,
and then the unit test continues finalizing and checking state.

Fixes: f28f3594de ("service: add attribute API")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-09-21 16:37:59 +02:00
Bruce Richardson
10b71caecb rawdev: add private data size to info query
Currently with the rawdev API there is no way to check that the structure
passed in via the dev_private pointer in the dev_info structure is of the
correct type - it's just checked that it is non-NULL. Adding in the length
of the expected structure provides a measure of typechecking, and can also
be used for ABI compatibility in future, since ABI changes involving
structs almost always involve a change in size.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
2020-09-11 11:50:53 +02:00
Ciara Power
3cc6ecfdfe build: remove makefiles
A decision was made [1] to no longer support Make in DPDK, this patch
removes all Makefiles that do not make use of pkg-config, along with
the mk directory previously used by make.

[1] https://mails.dpdk.org/archives/dev/2020-April/162839.html

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-09-08 00:09:50 +02:00
Viacheslav Ovsiienko
5ce13f1acd app/testpmd: fix timestamp init in txonly mode
The testpmd application forwards data in multiple threads.
In the txonly mode the Tx timestamps must be initialized
on per thread basis to provide phase shift for the packet
burst being sent. This per thread initialization was performed
on zero value of the variable in thread local storage and
happened only once after testpmd forwarding start. Executing
"start" and "stop" commands did not cause thread local variables
zeroing and wrong timestamp values were used.

Fixes: 4940344dab ("app/testpmd: add Tx scheduling command")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
2020-07-30 00:41:24 +02:00
Yuval Avnery
de06137cb2 app/regex: add RegEx test application
Following the new RegEx class.
There is a need to create a dedicated test application in order to
validate this class and PMD.

Unlike net device this application loads data from a file.

This commit introduces the new RegEx test app.

The basic app flow:
1. Configure the RegEx device to use one queue, and set the rule
   database, using precompiled file.
2. Allocate mbufs based on the requested number of jobs, each job will
i  get one mbuf.
3. Enqueue as much as possible jobs.
4. Dequeue jobs.
5. if the number of dequeue jobs < requested number of jobs job to step

Signed-off-by: Ori Kam <orika@mellanox.com>
Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
2020-07-30 09:13:52 +02:00
David Coyle
25d5c40f25 app/crypto-perf: support security protocol in PMDCC mode
This patch adds support for DOCSIS and PDCP security protocols to the
pmd-cyclecount mode of the crypto performance tool. Adding this support
involves freeing the correct session type (i.e. security or cryptodev
session) when the test ends, depending on the op_type specified.

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-28 22:09:22 +02:00
David Coyle
f7d2c69653 app/crypto-perf: fix mbuf lengths for DOCSIS
Set the source mbuf data and packet lengths correctly for DOCSIS
performance tests.

Fixes: d4a131a949 ("test/crypto-perf: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-28 22:09:22 +02:00
Apeksha Gupta
179237727e app/eventdev: fix capability check in pipeline ATQ test
Add all type queue capability check before configuring event device
for pipeline atq test.

Fixes: 6bf570a991 ("app/eventdev: add pipeline atq test")
Cc: stable@dpdk.org

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-07-24 07:22:41 +02:00
Ruifeng Wang
ec0b862d5e test/cycles: restore default delay callback
test_delay_us_sleep registers sleep based delay for testing.
This changes the default delay function of testing environment.
It is not expected.

Restore default delay function after the test to fix the issue.

Fixes: a51639cc72 ("eal: add nanosleep based delay function")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
2020-07-27 16:42:19 +02:00
Louise Kilheeney
ea0dceba0f add python2 deprecation notice
Prepare for python2 removal in 20.11.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2020-07-21 22:58:18 +02:00
Louise Kilheeney
c3fabbe957 app/bbdev: support python3
Use of the print function required for python3 compatibility.

Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2020-07-21 22:33:16 +02:00
Kevin Traynor
12337cf206 test/eal: check invalid CPU value
When using --lcores option, there is a limit of CPU_SETSIZE.
Currently that allows 0..1023 on Linux.

Check it is caught when this limit is exceeded.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2020-07-21 20:48:57 +02:00
Akhil Goyal
cf43d9d04b test/crypto: skip unsupported cases
blockcipher cases are either returning TEST_SUCCESS
or TEST_FAILED as status, but the test may not be
supported by the PMD which is also a success case
for the PMD. Hence checking for status == TEST_FAILED
for setting the overall status as failed.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ankur Dwivedi <adwivedi@marvell.com>
2020-07-20 15:49:24 +05:30
Viacheslav Ovsiienko
aae799d7dd app/testpmd: fix typos
Fix minor typos.

Fixes: 4940344dab ("app/testpmd: add Tx scheduling command")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-17 18:21:21 +02:00
Chenxu Di
d1d5d3e4b3 app/testpmd: fix output format in flow query
This patch fix the error line break in the output format of flow query

Fixes: bdb1d61690 ("app/testpmd: support RSS config in flow query")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-17 18:21:21 +02:00
David Coyle
4ad736ce03 app/crypto-perf: enable feature flag for security
The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all crypto performance tests,
including security related tests. This patch updates the crypto
performance tool to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and
PDCP security tests.

Fixes: d4a131a949 ("test/crypto-perf: support DOCSIS protocol")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:14:08 +02:00
David Coyle
ff36e4c2a5 test/crypto: enable feature flag for security
The RTE_CRYPTODEV_FF_SECURITY feature was disabled through the
ff_disable device configuration option for all cryptodev tests,
including security related tests. This patch updates the cryptodev unit
tests to not disable RTE_CRYPTODEV_FF_SECURITY for DOCSIS and PDCP
security tests.

Fixes: ea31f2b4f5 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:11:14 +02:00
David Coyle
a441294212 test/crypto: fix AESNI-MB CPU tests
The AESNI-MB CPU test cases, which are executed via the
cryptodev_cpu_aesni_mb_autotest command, aborted when it tried to run
the DOCSIS security tests as these are not CPU type tests. The abort
happened at the following line in process_crypto_request():

RTE_VERIFY(gbl_action_type != RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO);

The tests have been updated not to run the DOCSIS (or PDCP) security
tests during cryptodev_cpu_aesni_mb_autotest, with the decision based on
improved PMD security capability checks.

Fixes: ea31f2b4f5 ("test/crypto: add DOCSIS security cases")

Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-07-18 23:10:27 +02:00
Ankur Dwivedi
27f30e288e test/crypto: change cipher offset for ESN vector
In the IPSEC ESN test vector the cipher offset for encryption
should be 8 bytes which is the size of esp header.
This patch also changes the ciphertext and the digest reference
data against which the operation result is validated.

Fixes: 699741912d ("test/crypto: add case for auth only trailer")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-18 23:09:00 +02:00
Wisam Jaddo
e7554ebd07 app/flow-perf: fix typo in usage help
From hairping-rss into hairpin-rss.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
2020-07-19 15:14:50 +02:00
Wisam Jaddo
c75f036723 app/flow-perf: fix hairpin queues setup
The hairpin queue is the one that start from normal rxq,
and will be less than nr_queues where nr_queues is the
sum of normal and hairpin.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Reviewed-by: Asaf Penso <asafp@mellanox.com>
2020-07-19 15:10:30 +02:00
Bing Zhao
17d103cc93 app/testpmd: add eCPRI in flow creation patterns
In order to verify offloading of eCPRI protocol via flow rules, the
command line of flow creation should support the parsing of the eCPRI
pattern.

Based on the specification, one eCPRI message will have the common
header and payload. Payload format is various based on the type field
of the common header. Fixed strings will be used instead of integer
to make the CLI easy for auto-completion.

The testpmd command line examples of flow to match eCPRI item are
listed below:
  1. flow create 0 ... pattern eth / ecpri / end actions ...
    This is to match all eCPRI messages.
  2. flow create 0 ... pattern eth / ecpri common type rtc_ctrl / end actions ...
    This is to match all eCPRI messages with the type #2 - "Real-Time
    Control Data".
  3. flow create 0 ... pattern eth / ecpri common type iq_data pc_id is [U16Int] / end actions ...
    This is to match eCPRI messages with the type #0 - "IQ Data", and
    the physical channel ID 'pc_id' of the messages is a specific
    value. Since the sequence ID is changeable, there is no need to
    match that field in the flow.
Currently, only type #0, #2 and #5 will be supported.

Since eCPRI could be over Ethernet layer (or after .1Q) and UDP
layer, it is the PMD driver's responsibility to check whether eCPRI
is supported and which protocol stack is supported. Network byte
order should be used for eCPRI header, the same as other headers.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-07-13 02:49:03 +02:00
Shiri Kuzin
2564abda35 app/testpmd: add 5-tuple swap forwarding engine
The new 5-tuple swap engine swaps:
source and destination mac address,
source and destination address in ipv4/ipv6,
source and destination port in UDP/TCP.

The forwarding engine will parse each layer
and swap it, and will stop when the next
layer doesn't match.

The mentioned headers of ICMP/ARP/Multicast
packets will be swapped as well according to
matching layers.

usage: --forward-mode=5tswap

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:54 +02:00
Ferruh Yigit
61ede39537 drivers/net: fix exposing internal headers
Using '__rte_internal' tag in 'rte_ethdev_driver.h' causing build error
for applications and examples. Because they don't define
'ALLOW_INTERNAL_API' flag and '__rte_internal' causes the error.
This patch is preparation for future '__rte_internal' usage.

At first place, applications/examples should not include
'rte_ethdev_driver.h', this is happening because of PMD public header
files include 'rte_ethdev_driver.h' by mistake.

Updated PMD public header files to not include internal header files.

But for unit test application, 'app/test', enable accessing internal
APIs, since some unit tests need them.

Fixes: ffc905f3b8 ("ethdev: separate driver APIs")
Fixes: ec0dec44ec ("net/atlantic: enable MACsec configuration")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-11 06:18:54 +02:00
Viacheslav Ovsiienko
4940344dab app/testpmd: add Tx scheduling command
This commit adds testpmd capability to provide timestamps on the packets
being sent in the txonly mode. This includes:

 - SEND_ON_TIMESTAMP support
   new device Tx offload capability support added, example:

     testpmd> port config 0 tx_offload send_on_timestamp on

 - set txtimes, registers field and flag, example:

     testpmd> set txtimes 1000000,0

   This command enables the packet send scheduling on timestamps if
   the first parameter is not zero, generic format:

     testpmd> set txtimes (inter),(intra)

   where:

     inter - is the delay between the bursts in the device clock units.
     If "intra" (next parameter) is zero, this is the time between the
     beginnings of the first packets in the neighbour bursts, if "intra"
     is not zero, "inter" specifies the time between the beginning of
     the first packet of the current burst and the beginning of the last
     packet of the previous burst. If "inter"parameter is zero the send
     scheduling on timestamps is disabled (default).

     intra - is the delay between the packets within the burst specified
     in the device clock units. The number of packets in the burst is
     defined by regular burst setting. If "intra" parameter is zero no
     timestamps provided in the packets excepting  the first one in the
     burst.

     As the result the bursts of packet will be transmitted with
     specific delay between the packets within the burst and specific
     delay between the bursts. The rte_eth_read_clock() is supposed to
     be engaged to get the current device clock value and provide the
     reference for the timestamps. If there is no supported
     rte_eth_read_clock() there will be no provided send scheduling on
     the device.

 - show txtimes, displays the timing settings
 - txonly burst time pattern

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:54 +02:00
Phil Yang
3a164e002a app/testpmd: fix CPU cycles per packet stats on Tx modes
In txonly and flowgen forwarding mode, calculating CPU per packets with
total received packets is not accurate. Use total transmitted packets
for these cases.

The error output under txonly mode:
testpmd> show fwd stats all

---------------------- Forward statistics for port 0  -------------------
RX-packets: 0              RX-dropped: 0             RX-total: 0
TX-packets: 3582891927     TX-dropped: 401965824     TX-total: 3984857751
TX-bursts : 86381636 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
-------------------------------------------------------------------------

---------------------- Forward statistics for port 1  -------------------
RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
TX-packets: 3582890632     TX-dropped: 401965568     TX-total: 3984856200
TX-bursts : 86381679 [0% of 0 pkts + 85% of 64 pkts + 15% of 32 pkts]
-------------------------------------------------------------------------

+++++++++++++++ Accumulated forward statistics for all ports+++++++++++++
RX-packets: 1              RX-dropped: 394351696     RX-total: 394351697
TX-packets: 7165782559     TX-dropped: 803931392     TX-total: 7969713951
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CPU cycles/packet=54984156291.00 \
(total cycles=54984156291 / total RX packets=1) at 200 MHz Clock

Fixes: 53324971a1 ("app/testpmd: display/clear forwarding stats on demand")
Cc: stable@dpdk.org

Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:53 +02:00
Jasvinder Singh
6c3c229695 app/testpmd: remove softnic forward mode
Softnic can be used like other virtual devices without
needing any special mode. Therefore, remove softnic mode
from testpmd app. Documentation is updated as well.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-07-11 06:18:53 +02:00
Junfeng Guo
b0505d0fe6 app/testpmd: support extended RSS offload types
This patch adds testpmd cmdline support for IPv6 prefix.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-11 06:18:53 +02:00
Chenxu Di
bdb1d61690 app/testpmd: support RSS config in flow query
This patch support RSS action in flow query.
It can display the RSS configuration of the specified rule.

For example:
we can create an RSS rule by command "flow create 0 ingress
pattern eth / ipv4 / tcp / end actions rss types ipv4-tcp
l3-src-only l4-dst-only end queues end func symmetric_toeplitz
 / end" and then query it "flow query 0 0 rss"
the log will be follow
RSS:
 queues: none
 function: symmetric_toeplitz
 types:
  ipv4-tcp
  l3-src-only
  l4-dst-only

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-07-11 06:18:52 +02:00
Chenxu Di
8f0460a79d app/testpmd: replace legacy filter usage
The legacy filter API will be superseded. This patch use
private api to change the implementation of commands
global_config <port_id> gre-key-len <key_len> and
show port fdir <port_id>

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-07-11 06:18:52 +02:00
Ruifeng Wang
0f392d91b9 lpm: hide defer queue handle
There is no need to return the defer queue handle in rte_lpm_rcu_qsbr_add,
since enough flexibility has been provided to configure the defer queue.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-07-11 14:35:04 +02:00
Honnappa Nagarahalli
eff30b59cc test/lpm: add RCU performance tests
Add performance tests for RCU integration. The performance
difference with and without RCU integration is very small
(~1% to ~2%) on both Arm and x86 platforms.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-07-10 13:42:46 +02:00
Ruifeng Wang
6823fad347 test/lpm: add RCU functional tests
Add positive and negative tests for API rte_lpm_rcu_qsbr_add.
Also test LPM library behavior when RCU QSBR is enabled.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-07-10 13:42:26 +02:00
Honnappa Nagarahalli
7569b8c19b app/testpmd: enable empty polls in burst stats
The number of empty polls provides information about available
CPU head room in the presence of continuous polling.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
2020-07-07 23:38:28 +02:00
Honnappa Nagarahalli
85de481a71 app/testpmd: fix burst percentage calculation
The burst % calculation can over flow due to multiplication.
Fix the multiplication and increase the size of variables to
64b.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
2020-07-07 23:38:28 +02:00
Honnappa Nagarahalli
aac2b6a78d app/testpmd: use clock time in throughput calculation
The throughput calculation requires a counter that measures
passing of time. However, the kernel saves and restores the PMU
state when a thread is unscheduled and scheduled. This ensures
that the PMU cycles are not counted towards a thread that is
not scheduled. Hence, when RTE_ARM_EAL_RDTSC_USE_PMU is enabled,
the PMU cycles do not represent the passing of time.
This results in incorrect calculation of throughput numbers.
Use clock_gettime system call to calculate the time passed since
last call.

Bugzilla ID: 450
Fixes: 0e10698030 ("app/testpmd: show throughput in port stats")
Cc: stable@dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
2020-07-07 23:38:28 +02:00
Jeff Guo
cd8b4be013 app/testpmd: add GTPU to RSS hash commands
Add testpmd cmdline support for GTPU, it could be used to configure
gtpu teid hash. The commands as below:

testpmd> flow create 0 ingress pattern eth / ipv4 / udp / gtpu / \
ipv4 / end actions rss types gtpu end  key_len 0 queues end / end

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-07-07 23:38:28 +02:00
Simei Su
5c4cf3f377 app/testpmd: support extended RSS offload types
This patch adds testpmd cmdline support for PPPoE.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-07-07 23:38:27 +02:00
Lukasz Wojciechowski
048db4b6dc service: fix core mapping reset
The rte_service_lcore_reset_all function stops execution of services
on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE.
However the thread loop for slave lcores (eal_thread_loop) distincts these
roles to set lcore state after processing delegated function.
It sets WAIT state for ROLE_SERVICE, but FINISHED for ROLE_RTE.
So changing the role to RTE before stopping work in slave lcores
causes lcores to end in FINISHED state. That is why the rte_eal_lcore_wait
must be run after rte_service_lcore_reset_all to bring back lcores to
launchable (WAIT) state.
This has been fixed in test app and clarified in API documentation.

Setting the state to WAIT in rte_service_runner_func is premature
as the rte_service_runner_func function is still a part of the lcore
function delegated to slave lcore. The state is overwritten anyway in
slave lcore thread loop. This premature setting state to WAIT might
however cause rte_eal_lcore_wait, that was called by the application,
to return before slave lcore thread set the FINISHED state. That's
why it is removed from librte_eal rte_service_runner_func function.

Bugzilla ID: 464
Fixes: 21698354c8 ("service: introduce service cores concept")
Fixes: f038a81e1c ("service: add unit tests")
Cc: stable@dpdk.org

Reported-by: Sarosh Arif <sarosh.arif@emumba.com>
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2020-07-08 18:52:49 +02:00
Arek Kusztal
a0e437cc65 test/crypto: add ChaCha20-Poly1305 cases
This patch adds Chacha20-Poly1305 implementation to
cryptodev tests.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
2020-07-08 18:16:41 +02:00
Akhil Goyal
5a61bdb944 test/crypto-perf: add option to enable session HFN
Add a new option for PDCP cases to enable use of session
based fixed HFN value instead of per packet HFN which was
enabled by hfn override feature.
By default HFN override is enabled and if session based
fixed HFN need to be tested, add "--pdcp-ses-hfn-en" in the
command line.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-08 18:16:17 +02:00
Akhil Goyal
d3be77833f test/crypto: update PDCP HFN scenarios
As per current framework of PDCP testing, app can only support
either HFN override or fixed session HFN values but not both.
Now to enable both, either we duplicate all PDCP cases(>100)
for both override and fixed HFN. It will look clumsy as the
number of cases will be very high without much value addition.

Now to overcome this, we can do HFN override for Downlink cases
and fixed HFN for uplink cases. This way we will not loose the
test coverage and there will not be duplicacy in the test cases.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-07-08 18:16:17 +02:00
Anoob Joseph
53313910bc test/crypto: use generic test suite for OCTEON TX/TX2
This patch enables the generic crypto tests for OCTEON TX and
OCTEON TX2 PMDs. Removes the PMD specific tests.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-08 18:16:16 +02:00
Anoob Joseph
9fb409df70 test/crypto: remove some PMD specific null tests
This patch removes the OCTEON TX and OCTEON TX2 PMDs specific
test cases related to null cipher.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-08 18:16:16 +02:00
David Coyle
d4a131a949 test/crypto-perf: support DOCSIS protocol
Update test-crypto-perf app to calculate DOCSIS throughput numbers.

1 new parameter is added for DOCSIS:
--docsis-hdr-sz <n>

./dpdk-test-crypto-perf -l 3,4 --socket-mem 2048,0
--vdev crypto_aesni_mb_pmd_1 -n 1 -- --devtype crypto_aesni_mb
--optype docsis --cipher-algo aes-docsisbpi --cipher-op encrypt
--cipher-key-sz 16 --cipher-iv-sz 16 --burst-sz 32 --total-ops 20000000
--buffer-sz 1024 --silent --docsis-hdr-sz 17

Signed-off-by: David Coyle <david.coyle@intel.com>
Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-07-08 18:16:16 +02:00
David Coyle
c6478fd591 test/security: add DOCSIS capability checks
Add unit tests for DOCSIS capabilitity checks.

Signed-off-by: David Coyle <david.coyle@intel.com>
Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-08 18:16:16 +02:00
David Coyle
ea31f2b4f5 test/crypto: add DOCSIS security cases
Add uplink and downlink DOCSIS unit test cases and vectors, to test
the combined DOCSIS Crypto-CRC support that has been added to the
rte_security library.

Signed-off-by: David Coyle <david.coyle@intel.com>
Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-07-08 18:16:16 +02:00
Adam Dybkowski
0ad83afdf3 test/crypto: fix asymmetric session mempool creation
This patch fixes the element size of the mempool used
for allocating asym crypto sessions and their private data.

Fixes: 2c6dab9cd9 ("test/crypto: add RSA and Mod tests")
Cc: stable@dpdk.org

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-08 00:15:35 +02:00
David Marchand
d2fd16c8b0 eal: add multiprocess disable API
The multiprocess feature has been implicitly enabled so far.
Applications might want to explicitly disable like when using the
non-EAL threads registration API.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-07-08 14:41:06 +02:00
David Marchand
b41befd3af eal: add lcore iterators
Add a helper to iterate all lcores.
The iterator callback is read-only wrt the lcores list.

Implement a dump function on top of this for debugging.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-07-08 14:41:06 +02:00
David Marchand
61bb531295 eal: add lcore init callbacks
DPDK components and applications can have their say when a new lcore is
initialized. For this, they can register a callback for initializing and
releasing their private data.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-07-08 14:41:06 +02:00
David Marchand
5c307ba2a5 eal: register non-EAL threads as lcores
DPDK allows calling some part of its API from a non-EAL thread but this
has some limitations.
OVS (and other applications) has its own thread management but still
want to avoid such limitations by hacking RTE_PER_LCORE(_lcore_id) and
faking EAL threads potentially unknown of some DPDK component.

Introduce a new API to register non-EAL thread and associate them to a
free lcore with a new NON_EAL role.
This role denotes lcores that do not run DPDK mainloop and as such
prevents use of rte_eal_wait_lcore() and consorts.

Multiprocess is not supported as the need for cohabitation with this new
feature is unclear at the moment.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-07-08 14:41:05 +02:00
Igor Romanov
fea5a82f56 test/service: check active state on two lcores
The test checks that the service may be active API works
when there are two cores: a non-service lcore and a service one.

The API notes to take care when checking the status of a running
service, but the test setup allows for a safe usage in that case.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-07-07 23:52:12 +02:00
Timothy Redaelli
f62093e739 test: fix rpath for drivers with meson
This commit fixes the setting of relative rpath on dpdk-test for
drivers ($libdir/dpdk/pmd-$abiver) to the correct absolute rpath
($prefix$libdir/dpdk/pmd-$abiver).

Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-07-07 14:06:49 +02:00
David Marchand
0fc601af3a trace: simplify trace point registration
RTE_TRACE_POINT_DEFINE and RTE_TRACE_POINT_REGISTER must come in pairs.
Merge them and let RTE_TRACE_POINT_REGISTER handle the constructor part.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-07-05 21:34:21 +02:00
Thomas Monjalon
de321d5918 build: remove special handling for node library
The node library had a need of being linked as a whole
to make some constructors effective.
Now that all libraries are linked with --whole-archive,
there is no need to have this library separate.

Fixes: e2db26f766 ("build: always link whole DPDK static libraries")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2020-07-05 10:52:11 +02:00
Jerin Jacob
9c99878aa1 log: introduce logtype register macro
Introduce the RTE_LOG_REGISTER macro to avoid the code duplication
in the logtype registration process.

It is a wrapper macro for declaring the logtype, registering it and
setting its level in the constructor context.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-07-03 15:52:51 +02:00
Konstantin Ananyev
6749637af9 test/ring: rename stress test for MT peek API
Rename test_ring_peek_stress to test_ring_mt_peek_stress to
keep same naming conventions for ST and MT test cases.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-07-03 12:36:04 +02:00
Konstantin Ananyev
fb5d9d5482 test/ring: add stress test for ST peek API
Introduce new test case to test ST peek API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-07-03 12:05:25 +02:00
Konstantin Ananyev
2d59e9c8e2 test/ring: reduce compilation time
Rework test code to reduce code complexity for the compiler and
bring down compilation time and memory consumption.
Current test_ring_enqueue/test_ring_dequeue functions contain
too many branches and it takes compiler a lot of effort to resolve all
of them at compile time.
So the patch replaces these branchy function invocations
with an  array of function pointers (test_enqdeq_impl[]).
That way compiler knows straightway which function to use
for each particular case.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-07-03 12:05:05 +02:00
Bruce Richardson
607164e25c build: remove unnecessary variable
Since all libraries are explicitly linked as part of a build, we no longer
need to track ones that should be always included for linking against apps.

Previously telemetry was special-cased for linking as it was not directly
needed by the linker when linking the apps, since they never called into it
directly. This meant that it could be forgotten when specifying the app
dependencies, and so the telemetry support would not work. This
special-casing was never needed for make as it always linked in all
libraries, as meson does now.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
2020-07-01 19:30:52 +02:00
Bruce Richardson
e2db26f766 build: always link whole DPDK static libraries
To ensure all constructors are included in static build, we need to pass
the --whole-archive flag when linking, which is used with the
"link_whole" meson option. Since we use link_whole for all libs, we no
longer need to track the lib as part of the static dependency, just the
path to the headers for compiling.

After this patch is applied, all DPDK .a files are inside
--whole-archive/--no-whole-archive flags, but external dependencies and
shared libs being linked against remain outside.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Bruce Richardson
949c97ae31 test: fix build with ring PMD but no bond PMD
If the bonding pmd is disabled, all autotest associated with it should be
disabled. However, some of those tests also depended upon the ring PMD so
were placed in a block depending on that driver - and unfortunately that
driver alone. This caused build failures if the ring PMD was enabled but
the bonding PMD disabled, due to missing header files and driver libs.

This error can be reproduced by configuring DPDK using e.g.

  meson configure -Ddisable_drivers=net/[!r]* build

(which will disable all drivers not starting with "r"), and then building
using ninja.

Fix this by moving all link bonding autotests to the one block and putting
a second conditional check within that block for those also requiring the
ring PMD.

Fixes: 7f6ef16640 ("test/bonding: allow disabling driver")
Fixes: 207b1c813f ("test: fix build without ring PMD")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-07-01 12:00:57 +02:00
Feifei Wang
50959a8993 test/ring: fix statistics in bulk enq/dequeue
In size 32 bulk ring enq/dequeue performance test, the "Total count"
statistics is incorrect. For example, running the test on lcore 25 and
lcore 26, the output is as follows:

The test command:
$sudo ./arm64-armv8a-linuxapp-gcc/app/test -l 25-26
RTE>>ring_perf_autotest

Bulk enq/dequeue count on size 32
Core [25] count = 288268
Core [26] count = 288281
Total count (size: 32): 1066323

Fixed it by reset the counter at the beginning of each loop. The
revised output is as follows:

Bulk enq/dequeue count on size 32
Core [25] count = 285643
Core [26] count = 285688
Total count (size: 32): 571331

Fixes: 759cf9b563 ("test/ring: enhance mp/mc coverage")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-07-01 10:41:19 +02:00