Commit Graph

40 Commits

Author SHA1 Message Date
Jie Zhou
634b731044 app/testpmd: build on Windows
- Disable unsupported apps on Windows
- Enable building of testpmd on Windows

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Hemant Agrawal
026a546a22 app/procinfo: fix security context info
We need to differentiate between crypto and ethernet security
context as they belong to different devices.

Fixes: d82d6ac643 ("app/procinfo: add crypto security context info")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-26 14:07:24 +01:00
Ferruh Yigit
ff1047ba5b app/procinfo: remove useless assignment
'flag' is initialized to '0' but it is overwritten later, moving the
declaration where it is used and initialize with actual value.

Fixes: 0101a0ec62 ("app/procinfo: add --show-mempool")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-11 10:45:34 +01:00
Ferruh Yigit
c923be82e0 app/procinfo: remove useless memset
The intention with the "sizeof(0)" usage is not clear, but the 'stats'
already 'memset' by 'rte_cryptodev_stats_get()' API, removing 'memset'
in application.

Fixes: fe773600fe ("app/procinfo: add --show-crypto")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-11 10:45:34 +01:00
Ferruh Yigit
59b981c6f6 app/procinfo: fix check on xstats-ids
'parse_xstats_ids()' return 'int'. The return value is assigned to
'nb_xstats_ids' unsigned value, later negative check on this variable is
wrong.

Adding interim 'int' variable for negative check.

Fixes: 7ac16a3660 ("app/proc-info: support xstats by ID and by name")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-11 10:45:34 +01:00
Ferruh Yigit
f7605e24ba app/procinfo: fix _filters stats reporting
'_filters' is compared twice, second one will be always false, removing
it using the message more relevant to the '_filters'.

Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-11 10:45:31 +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
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
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
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
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
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
Ciara Power
7edbf7ddfd app/procinfo: use strlcpy for copying string
Replaced strncpy and strcpy with strlcpy.
Also replaced snprintf with strlcpy where applicable.
Using strlcpy is safe practice when copying strings, as it will include
a null terminator.

Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Fixes: 8a37f37fc2 ("app/procinfo: add --show-port")
Cc: stable@dpdk.org

Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 11:33:24 +01:00
Hemant Agrawal
b0b9116f72 app/procinfo: fix build without rte_security
This patch fixes the compilation issues when
RTE_LIBRTE_SECURITY is disabled.

Fixes: 8a37f37fc2 ("app/procinfo: add --show-port")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Igor Romanov
844949eceb app: check status of getting link info
The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Igor Romanov
da328f7f11 ethdev: change xstats reset function to return int
Change rte_eth_xstats_reset() return value from void to int and
return negative errno values in case of error conditions.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
773392553b app: check status of getting ethdev info
rte_eth_dev_info_get() return value was changed from void to int, so
this patch modify rte_eth_dev_info_get() usage across apps
according to its new return type.

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>
2019-10-07 14:45:35 +02:00
Thomas Monjalon
d711bea6fe eal: promote some experimental functions as stable
The function rte_eal_cleanup() was introduced more than one year ago,
in DPDK 18.02. It is no longer experimental, allowing
pdump, proc-info and hotplug_mp apps to not need any experimental API.

The function rte_ctrl_thread_create() was introduced one year ago
in DPDK 18.05. It is no longer experimental, allowing
KNI PMD and TEP example to not need any experimental API.

The functions rte_socket_count() and rte_socket_id_by_idx() were
introduced one year ago in DPDK 18.05. They are no longer experimental.

The function rte_dev_is_probed() was introduced half a year ago
in DPDK 18.11. It is no longer experimental.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2019-04-21 19:11:37 +02:00
Jasvinder Singh
c1656328db meter: replace color definitions
This patch implements the changes proposed in the deprecation
note[1]. Replace multiple color definitions in various places such as
rte_meter.h, rte_tm.h and rte_mtr.h with single rte_color defined
in rte_meter.h.

This is simple search and replace exercise without any implementation
change.

[1] https://mails.dpdk.org/archives/dev/2019-January/123861.html

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2019-04-11 14:27:32 +02:00
Bruce Richardson
f9acaf84e9 replace snprintf with strlcpy without adding extra include
For files that already have rte_string_fns.h included in them, we can
do a straight replacement of snprintf(..."%s",...) with strlcpy. The
changes in this patch were auto-generated via command:

spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-04-04 22:45:54 +02:00
Vipin Varghese
3056d22a5c app/procinfo: add --iter-mempool
Function iter_mempool is used for iterating slected mempool elements
and display the contents of elements for a max of 256 bytes. In case
of invalid or no name for mempool, no information is displayed.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:45:30 +01:00
Vipin Varghese
0101a0ec62 app/procinfo: add --show-mempool
Function show_mempool is used for displaying valid MEMPOOL.
In case of invalid or no name, whole list is dump.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:45:19 +01:00
Vipin Varghese
c13e898440 app/procinfo: add --show-ring
Function show_ring is used for displaying information of RING instance
of the primary process.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:45:05 +01:00
Vipin Varghese
fe773600fe app/procinfo: add --show-crypto
Function show_crypto is used for displaying the crypto PMD under primary
process.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:44:30 +01:00
Vipin Varghese
dbc72300bc app/procinfo: add --show-tm
Function show_tm is used for displaying the tm PMD under the primary
process. This covers basic and per node|level details with statistics.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:44:00 +01:00
Vipin Varghese
8a37f37fc2 app/procinfo: add --show-port
Function show_port is used for displaying the port PMD information under
primary process. The information shows basic, per queue and security.
Also helper MACRO 'MAX_STRING_LEN, STATS_BDR_FMT and STATS_BDR_STR' and
meson build file is updated for new functionality.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2019-01-11 15:42:57 +01:00
Kevin Laatz
57ae0ec626 build: add dependency on telemetry to apps with meson
This patch adds telemetry as a dependecy to all applications. Without these
changes, the --telemetry flag will not be recognised and applications will
fail to run if they want to enable telemetry.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-10-27 15:21:33 +02:00
Andy Green
3cef37eb98 app/procinfo: fix sprintf overrun
app/proc-info/main.c: In function ‘nic_xstats_display’:
app/proc-info/main.c:495:45: error:
‘%s’ directive writing up to 255 bytes into a regioni of size between 165 and 232
[-Werror=format-overflow=]
    sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
                                             ^~
     PRIu64"\n", host_id, port_id, counter_type,
                                   ~~~~~~~~~~~~
app/proc-info/main.c:495:4: note:
‘sprintf’ output between 31 and 435 bytes into a destination of size 256
    sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PRIu64"\n", host_id, port_id, counter_type,
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     xstats_names[i].name, values[i]);

Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-05-14 23:32:23 +02:00
Thomas Monjalon
d9a42a69fe ethdev: deprecate port count function
Some DPDK applications wrongly assume these requirements:
    - no hotplug, i.e. ports are never detached
    - all allocated ports are available to the application

Such application iterates over ports by its own mean.
The most common pattern is to request the port count and
assume ports with index in the range [0..count[ can be used.

In order to fix this common mistake in all external applications,
the function rte_eth_dev_count is deprecated, while introducing
the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-18 00:48:41 +02:00
Thomas Monjalon
8728ccf376 fix ethdev ports enumeration
Some DPDK applications wrongly assume these requirements:
    - no hotplug, i.e. ports are never detached
    - all allocated ports are available to the application

Such application iterates over ports by its own mean.
The most common pattern is to request the port count and
assume ports with index in the range [0..count[ can be used.

There are three consequences when using such wrong design:
    - new ports having an index higher than the port count won't be seen
    - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts
    - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application

Such mistake will be less common with growing hotplug awareness.
All applications and examples inside this repository - except testpmd -
must be fixed to use the iterator RTE_ETH_FOREACH_DEV.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-18 00:25:27 +02:00
Radu Nicolau
f0b9479497 app/procinfo: fix strncpy usage in args parsing
Replace strncpy with snprintf to avoid overwriting the last
NULL character.

Coverity issue: 143252
Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-03-28 00:35:37 +02:00
Bruce Richardson
996ef11761 app: add all remaining apps to meson build
Add remaining subdirectories in the app folder to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-03-12 16:29:27 +01:00
Bruce Richardson
1a0accaddb app/procinfo: rename folder to remove underscore
All other apps in the app folder use "-" rather than "_" to separate words
in the app name, so rename proc_info to be consistent.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-03-12 16:29:27 +01:00