Commit Graph

7662 Commits

Author SHA1 Message Date
Gaetan Rivet
7d89b26103 app/testpmd: use ethdev iterator to list devices
This commit replaces redundant code with public ethdev layer calls.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Gaetan Rivet
5588909af2 ethdev: add device iterator
This iterator helps applications iterate over the device list and skip
holes caused by invalid or detached devices.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Gaetan Rivet
d52268a8b2 ethdev: expose device states
The hotplug API introduced multiple states for a device with possible
values defined internally, while the related field in struct rte_eth_dev
was made public.

Exposing those states improves consistency because applications have to
deal with the device list directly.

"DEV_DETACHED" is renamed "RTE_ETH_DEV_UNUSED" to better reflect that
the emptiness of a slot is not necessarily the result of detaching a
device.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2017-04-05 22:47:57 +02:00
Ferruh Yigit
fa865c012b event/sw: fix build with icc
build error:
.../drivers/event/sw/sw_evdev_scheduler.c(379):
error #300: const variable "dummy_rob" requires an initializer
        static const struct reorder_buffer_entry dummy_rob;
                                                          ^

Variable "dummy_rob" defined as const but already cast to another
pointer and its content updated. Remove const qualifier from variable.

Fixes: 617995dfc5 ("event/sw: add scheduling logic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Ferruh Yigit
a175e38f2e event/octeontx: fix build with icc
build error:
.../drivers/event/octeontx/ssovf_worker.c(212):
error #592: variable "get_work0" is used before its value is set
        RTE_SET_USED(get_work0);
        ^

.../drivers/event/octeontx/ssovf_worker.c(213):
error #592: variable "get_work1" is used before its value is set
        RTE_SET_USED(get_work1);
        ^
For x86 these variables set but not used, move macros below
where values assigned.

Fixes: f61808eaa9 ("event/octeontx: add start function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-04-05 18:20:42 +02:00
Ferruh Yigit
3061d0d961 ring: fix build with icc
build error:
In file included from .../lib/librte_ring/rte_ring.c(90):
.../lib/librte_ring/rte_ring.h(162):
error #1366: a reduction in alignment without the "packed" attribute
is ignored
  } __rte_cache_aligned;
      ^

Alignment attribute moved to first element of the struct

Fixes: a6619414e0 ("ring: make struct and macros type agnostic")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-05 18:20:42 +02:00
Reshma Pattan
62d3216d61 app/testpmd: add latency statistics calculation
This patch adds latency stats commandline argument to testpmd,
allowing to specify the lcore to use for latencystats updates.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2017-04-05 18:00:44 +02:00
Reshma Pattan
5cd3cac9ed latency: added new library for latency stats
Add a library designed to calculate latency statistics and report them
to the application when queried. The library measures minimum, average and
maximum latencies, and jitter in nano seconds. The current implementation
supports global latency stats, i.e. per application stats.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-05 18:00:42 +02:00
Remy Horton
7e4441c8ef app/testpmd: add bitrate statistics calculation
Calculate bitrate statistics using the bitrate stats library. The
resulting statistics can be viewed via proc_info.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2017-04-05 17:59:52 +02:00
Remy Horton
2ad7ba9a65 bitrate: add bitrate statistics library
This patch adds a library that calculates peak and average data-rate
statistics. For ethernet devices. These statistics are reported using
the metrics library.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2017-04-05 17:59:43 +02:00
Reshma Pattan
077c546704 app/proc_info: add metrics displaying
Modify the dpdk-procinfo process to display the newly added metrics.
Added new command line option "--metrics" to display metrics.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2017-04-05 17:58:54 +02:00
Remy Horton
349950ddb9 metrics: add information metrics library
This patch adds a new information metrics library. This Metrics
library implements a mechanism by which producers can publish
numeric information for later querying by consumers. Metrics
themselves are statistics that are not generated by PMDs, and
hence are not reported via ethdev extended statistics.

Metric information is populated using a push model, where
producers update the values contained within the metric
library by calling an update function on the relevant metrics.
Consumers receive metric information by querying the central
metric data, which is held in shared memory.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2017-04-05 17:58:51 +02:00
Jens Freimann
10def6a107 doc: add missing step in PVP reference benchmark howto
After we configure QEMU we also need to call 'make' to build the binary.
This step is currently missing in the description and this patch fixes
it.

Signed-off-by: Jens Freimann <jfreiman@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-04-05 15:25:14 +02:00
Thomas Monjalon
3ecbbf9ce8 doc: remove old deprecation notices
The ring and distributor reworks are done.

Fixes: a6619414e0 ("ring: make struct and macros type agnostic")
Fixes: 775003ad2f ("distributor: add new burst-capable library")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-05 15:21:38 +02:00
Qi Zhang
8c32c192b9 app/testpmd: add command to show/clear VF stats
Add two commands to show/clear VF stats
show vf stats <port_id> <vf_id>
clear vf stats <port_id> <vf_id>

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2017-04-04 19:03:03 +02:00
Olivier Matz
c143e5a3d9 net/i40e: use dynamic log type for control logs
This is an example of how a dynamic log type can be used in a
PMD.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:48:45 +02:00
Olivier Matz
caf05a1b86 app/testpmd: new command to dump log types
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:48:45 +02:00
Olivier Matz
c6bed5f1ea app/test: new command to dump log types
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:48:45 +02:00
Olivier Matz
4f0981e6ec eal: deprecate log functions
Deprecate the following functions:
- rte_set_log_level(), replaced by rte_log_set_global_level()
- rte_get_log_level(), replaced by rte_log_get_global_level()
- rte_set_log_type(), replaced by rte_log_set_level()
- rte_get_log_type(), replaced by rte_log_get_level()

The new functions provide a better control of the per-type log level,
and have a better name prefix (rte_log_).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:48:40 +02:00
Olivier Matz
845afe51e4 eal: change specific log levels at startup
Example of use:
  ./app/test-pmd --log-level='pmd\.i40e.*,8'

  This enables debug logs for all dynamic logs whose type starts with
  'pmd.i40e'.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:37:17 +02:00
Olivier Matz
a5279180f5 eal: change several log levels matching a regexp
Introduce a function to set the log level of several log types that
match a regular expression.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:37:17 +02:00
Olivier Matz
432050bfd0 eal: dump registered log types
Introduce a function to dump the global level and the registered log
types.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:37:17 +02:00
Olivier Matz
c1b5fa94a4 eal: support dynamic log types
Introduce 2 new functions to support dynamic log types:

- rte_log_register(): register a log name, and return a log type id
- rte_log_set_level(): set the log level of a given log type

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:37:17 +02:00
Olivier Matz
12e58e707c mbuf: bump library version
The reorganization of the mbuf structure induces an ABI breakage.
Bump the library version, and update the documentation accordingly.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 13:37:17 +02:00
Olivier Matz
918ae9dc77 mbuf: add a timestamp field
The field itself is not fully described yet, but this commit reserves
the room in the mbuf.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
a22659550c mbuf: move sequence number in second cache line
Move this field in the second cache line, since no driver use it
in Rx path. The freed space will be used by a timestamp in next
commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
97cb466d65 mbuf: use 2 bytes for port and nb segments
Change the size of m->port and m->nb_segs to 16 bits. It is now possible
to reference a port identifier larger than 256 and have a mbuf chain
larger than 256 segments.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Jerin Jacob
dc448dc460 mbuf: make rearm data address naturally aligned
To avoid multiple stores on fast path, Ethernet drivers
aggregate the writes to data_off, refcnt, nb_segs and port
to an uint64_t data and write the data in one shot
with uint64_t* at &mbuf->rearm_data address.

Some of the non-IA platforms have store operation overhead
if the store address is not naturally aligned.This patch
fixes the performance issue on those targets.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
ebb7bcabb8 drivers/net: do not touch mbuf next or nb segs on Rx
Now that the m->next pointer and m->nb_segs is expected to be set (to
NULL and 1 respectively) after a mempool_get(), we can avoid to write them
in the Rx functions of drivers.

Only some drivers are patched, it's not an exhaustive patch. It gives
the idea to do the same in other drivers.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
8f094a9ac5 mbuf: set mbuf fields while in pool
Set the value of m->refcnt to 1, m->nb_segs to 1 and m->next
to NULL when the mbuf is stored inside the mempool (unused).
This is done in rte_pktmbuf_prefree_seg(), before freeing or
recycling a mbuf.

Before this patch, the value of m->refcnt was expected to be 0
while in pool.

The objectives are:

- to avoid drivers to set m->next to NULL in the early Rx path, since
  this field is in the second 64B of the mbuf and its access could
  trigger a cache miss

- rationalize the behavior of raw_alloc/raw_free: one is now the
  symmetric of the other, and refcnt is never changed in these functions.

To optimize the freeing of the segments, we try try to only update
m->refcnt, m->next, and m->nb_segs when it's required (idea from
Konstantin Ananyev <konstantin.ananyev@intel.com>).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
1f88c0a22b mbuf: make raw free function public
Rename __rte_mbuf_raw_free() as rte_mbuf_raw_free() and make
it public. The old function is kept for compat but is marked as
deprecated.

The next commit changes the behavior of rte_mbuf_raw_free() to
make it more consistent with rte_mbuf_raw_alloc().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Olivier Matz
54e9290269 mbuf: make segment prefree function public
Document the function and make it public, since it is used at several
places in the drivers. The old one is marked as deprecated.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2017-04-05 11:30:29 +02:00
Jerin Jacob
27c270bc40 doc: add Cavium OCTEONTX eventdev PMD to release notes
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-04-04 19:19:54 +02:00
Jerin Jacob
8616e6e256 doc: add OCTEONTX ssovf details
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-04-04 19:19:54 +02:00
Jerin Jacob
c023a28d48 test/eventdev: add remaining tests based on existing helpers
Add the following tests based existing helper functions
- Queue based producer-consumer ingress order test
- Run existing queue and flow based ordering test in dequeue timeout
  mode

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:54 +02:00
Jerin Jacob
d50e28d1f8 test/eventdev: add octeontx producer-consumer based order
Add flow based producer-consumer based ingress order test

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
9a1cdd54cd test/eventdev: add octeontx queue and flow based max stage
Add queue and flow based pipeline test with maximum number of
stages available in the device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
ccbbbba4a4 test/eventdev: add octeontx queue based max stage
Add queue based pipeline test with maximum number of stages available
in the device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
723a4d1bea test/eventdev: add octeontx flow based max stage
Add flow based pipeline test with maximum number of stages available
in the device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
19e2646879 test/eventdev: add octeontx queue based two stage sched
Add queue based two stage pipeline test with all combination
of schedule types.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
e31f866486 test/eventdev: add octeontx flow based two stage sched
Add flow based two stage pipeline test with all combination
of schedule types.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
ee17e11d1b test/eventdev: add octeontx multi link establishment
Add unit test case to verify queue to port multi link
establishment operation.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
8ef7012381 test/eventdev: add octeontx single link establishment
Add test case to verify queue to port single link establishment operation.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
9ef576176d test/eventdev: add octeontx multi queue and multi port
Add unit test case to verify multi queue enqueue and multi core/port
dequeue operation.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
ff7482e2f5 test/eventdev: add octeontx priority test
Added unit test case to verify the priority associated with
each event queue available in the device.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
d2c5c2893a test/eventdev: add octeontx multi queue enq/deq tests
Added unit test case to verify enqueue and dequeue operations
with multiple queues and a single port.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
b8e0f42aef test/eventdev: add octeontx simple enq/deq tests
Added unit test case to verify simple event enqueue and dequeue
operation with different schedule types

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
c86db2943e test/eventdev: add octeontx unit test infrastructure
add test setup and teardown routines.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
619d54c634 event/octeontx: add stop and close functions
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00
Jerin Jacob
f61808eaa9 event/octeontx: add start function
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2017-04-04 19:19:53 +02:00