Commit Graph

201 Commits

Author SHA1 Message Date
Ferruh Yigit
b563c14212 ethdev: remove jumbo offload flag
Removing 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.

Instead of drivers announce this capability, application can deduct the
capability by checking reported 'dev_info.max_mtu' or
'dev_info.max_rx_pktlen'.

And instead of application setting this flag explicitly to enable jumbo
frames, this can be deduced by driver by comparing requested 'mtu' to
'RTE_ETHER_MTU'.

Removing this additional configuration for simplification.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2021-10-18 19:20:21 +02:00
Ferruh Yigit
1bb4a528c4 ethdev: fix max Rx packet length
There is a confusion on setting max Rx packet length, this patch aims to
clarify it.

'rte_eth_dev_configure()' API accepts max Rx packet size via
'uint32_t max_rx_pkt_len' field of the config struct 'struct
rte_eth_conf'.

Also 'rte_eth_dev_set_mtu()' API can be used to set the MTU, and result
stored into '(struct rte_eth_dev)->data->mtu'.

These two APIs are related but they work in a disconnected way, they
store the set values in different variables which makes hard to figure
out which one to use, also having two different method for a related
functionality is confusing for the users.

Other issues causing confusion is:
* maximum transmission unit (MTU) is payload of the Ethernet frame. And
  'max_rx_pkt_len' is the size of the Ethernet frame. Difference is
  Ethernet frame overhead, and this overhead may be different from
  device to device based on what device supports, like VLAN and QinQ.
* 'max_rx_pkt_len' is only valid when application requested jumbo frame,
  which adds additional confusion and some APIs and PMDs already
  discards this documented behavior.
* For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory
  field, this adds configuration complexity for application.

As solution, both APIs gets MTU as parameter, and both saves the result
in same variable '(struct rte_eth_dev)->data->mtu'. For this
'max_rx_pkt_len' updated as 'mtu', and it is always valid independent
from jumbo frame.

For 'rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user
request and it should be used only within configure function and result
should be stored to '(struct rte_eth_dev)->data->mtu'. After that point
both application and PMD uses MTU from this variable.

When application doesn't provide an MTU during 'rte_eth_dev_configure()'
default 'RTE_ETHER_MTU' value is used.

Additional clarification done on scattered Rx configuration, in
relation to MTU and Rx buffer size.
MTU is used to configure the device for physical Rx/Tx size limitation,
Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer
size as Rx buffer size.
PMDs compare MTU against Rx buffer size to decide enabling scattered Rx
or not. If scattered Rx is not supported by device, MTU bigger than Rx
buffer size should fail.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2021-10-18 19:20:20 +02:00
Dmitry Kozlyuk
04d43857ea net: rename Ethernet header fields
Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr` as a macro. Rename `s_addr` to `src_addr` and `d_addr`
to `dst_addr` to avoid the conflict and remove the workaround.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-10-08 14:58:11 +02:00
Jiayu Hu
abeb865255 vhost: remove copy threshold for async path
Copy threshold has been introduced in async vhost data
path to select the appropriate copy engine to do copies
for higher efficiency.

However, it may cause packets ordering issues and also
introduces performance unpredictability.

Therefore, this patch removes copy threshold support in
async vhost data path.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-09-14 13:21:55 +02:00
Aman Deep Singh
a7db3afce7 net: add macro to extract MAC address bytes
Added macros to simplify print of MAC address.
The six bytes of a MAC address are extracted in
a macro here, to improve code readablity.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-07 19:08:05 +02:00
Aman Deep Singh
c2c4f87b12 net: add macro for MAC address print
Added macro to print six bytes of MAC address.
The MAC addresses will be printed in upper case
hexadecimal format.
In case there is a specific check for lower case
MAC address, the user may need to make a change in
such test case after this patch.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-07 19:07:46 +02:00
Cheng Jiang
b9f23beee0 examples/vhost: handle memory hotplug for async vhost
When the guest memory is hotplugged, the vhost application which
enables DMA acceleration must stop DMA transfers before the vhost
re-maps the guest memory.

To accomplish that, we need to do these changes in the vhost sample:
1. add inflight packets count.
2. add vring_state_changed() callback.
3. add inflight packets clear process in destroy_device() and
vring_state_changed().

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Cheng Jiang
3f63c19b2b vhost: fix async callbacks return type
The async vhost callback ops should return negative value when there
are something wrong in the callback, so the return type should be
changed into int32_t. The issue in vhost example is also fixed.

Fixes: cd6760da10 ("vhost: introduce async enqueue for split ring")
Fixes: 819a716858 ("vhost: fix async callback return type")
Fixes: 6b3c81db8b ("vhost: simplify async copy completion")
Fixes: abec60e711 ("examples/vhost: support vhost async data path")
Fixes: 6e9a9d2a02 ("examples/vhost: fix ioat dependency")
Fixes: 873e8dad6f ("vhost: support packed ring in async datapath")
Cc: stable@dpdk.org

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-23 10:58:53 +02:00
Jiayu Hu
acbc38887b vhost: rework async configuration structure
This patch reworks the async configuration structure to improve code
readability. In addition, add preserved padding fields on the structure
for future usage.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-07-21 07:56:13 +02:00
Jerin Jacob
11e027022d examples: fix pkg-config override
Move pkg-config override to beginning in the Makefile to allow
use PKGCONF variable to detect the libdpdk availability.

Fixes: fda34680eb ("examples: remove legacy sections of makefiles")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-05-05 22:20:24 +02:00
David Marchand
ca7036b4af vhost: fix offload flags in Rx path
The vhost library currently configures Tx offloading (PKT_TX_*) on any
packet received from a guest virtio device which asks for some offloading.

This is problematic, as Tx offloading is something that the application
must ask for: the application needs to configure devices
to support every used offloads (ip, tcp checksumming, tso..), and the
various l2/l3/l4 lengths must be set following any processing that
happened in the application itself.

On the other hand, the received packets are not marked wrt current
packet l3/l4 checksumming info.

Copy virtio rx processing to fix those offload flags with some
differences:
- accept VIRTIO_NET_HDR_GSO_ECN and VIRTIO_NET_HDR_GSO_UDP,
- ignore anything but the VIRTIO_NET_HDR_F_NEEDS_CSUM flag (to comply with
  the virtio spec),

Some applications might rely on the current behavior, so it is left
untouched by default.
A new RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS flag is added to enable the
new behavior.

The vhost example has been updated for the new behavior: TSO is applied to
any packet marked LRO.

Fixes: 859b480d5a ("vhost: add guest offload setting")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-05-04 10:22:17 +02:00
Cheng Jiang
47afdbbe56 examples/vhost: fix overflow in argument parsing
Change the way passing args to fix potential overflow in args process.

Coverity issue: 363741
Fixes: 965b06f035 ("examples/vhost: enhance getopt_long usage")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-05-04 10:21:33 +02:00
Cheng Jiang
895f409c4a examples/vhost: fix ioat ring space in callbacks
We use ioat ring space for determining if ioat callbacks can enqueue a
packet to ioat device. But there is one slot can't be used in ioat
ring due to the ioat driver design, so we need to reduce one slot in
ioat ring to prevent ring size mismatch in ioat callbacks.

Fixes: 2aa47e94bf ("examples/vhost: add ioat ring space count and check")
Cc: stable@dpdk.org

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-04-28 03:58:50 +02:00
Bruce Richardson
245efe544d raw/ioat: report status of completed jobs
Add improved error handling to rte_ioat_completed_ops(). This patch adds
new parameters to the function to enable the user to track the completion
status of each individual operation in a batch. With this addition, the
function can help the user to determine firstly, how many operations may
have failed or been skipped and then secondly, which specific operations
did not complete successfully.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-05-04 17:43:50 +02:00
Chengchang Tang
10aa375704 examples: add eal cleanup to examples
According to the programming guide, the rte_eal_init should be used pairs
with rte_eal_cleanup.

This patch add rte_eal_cleanup to examples to encourage new users of
DPDK to use it.

Fixes: aec9c13c52 ("eal: add function to release internal resources")
Fixes: 3d0fad56b7 ("examples/fips_validation: add crypto FIPS application")
Fixes: c8e6ceeceb ("examples/ioat: add new sample app for ioat driver")
Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Fixes: 08bd1a1744 ("examples/l3fwd-graph: add graph-based l3fwd skeleton")
Fixes: c5eebf85ba ("examples/ntb: add example for NTB")
Fixes: b77f660028 ("examples/pipeline: add new example application")
Fixes: edbed86d1c ("examples/vdpa: introduce a new sample for vDPA")
Fixes: c19beb3f38 ("examples/vhost_blk: introduce vhost storage sample")
Fixes: f5188211c7 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
2021-04-21 20:21:25 +02:00
Bruce Richardson
cf59165dcb examples: reduce indentation in build files
As with the lib and drivers directories, we can use "continue" keyword to
reduce the indentation level of the majority of the foreach block. At the
same time, we can also replace tab indentation with spaces.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-21 14:04:09 +02:00
Chenbo Xia
1739f81425 examples/vhost: check memory table query
This patch fixes unchecked return value for rte_vhost_get_mem_table(),
which is reported by coverity.

Coverity issue: 364233
Fixes: ca059fa5e2 ("examples/vhost: demonstrate the new generic APIs")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-03-31 08:46:32 +02:00
Ibtisam Tariq
965b06f035 examples/vhost: enhance getopt_long usage
Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-03-23 13:00:29 +01:00
Cheng Jiang
fa545ed3da examples/vhost: add error propagation in ioat ops
This patch adds add error propagation for rte_ioat_completed_ops call,
and also changes dev_id type from int to uint16_t.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-02-04 18:19:36 +01:00
Cheng Jiang
ee6e451f14 examples/vhost: fix potentially overflowing expression
Change the type of buff_idx from uint64_t to uint32_t to fix coverity
issue.

Coverity issue: 366264
Fixes: a68ba8e0a6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-02-04 18:19:36 +01:00
Cheng Jiang
d4d4c6fed6 examples/vhost: remove async inflight packet counter
Remove async inflight packet counter since there is no need to keep
tracking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number
tracking ring from being exhausted.

Fixes: a68ba8e0a6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-02-04 18:19:36 +01:00
Bruce Richardson
5a19633079 examples: warn about broken pkg-config
Since the examples are designed to be built by end-users using Make, we
can detect and warn about broken pkg-config on the user's system as part
of the build process.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-01-30 01:27:28 +01:00
Cheng Jiang
a68ba8e0a6 examples/vhost: refactor vhost data path
Change the vm2vm data path to batch enqueue for better performance.
Support latest async vhost API, refactor vhost async data path,
replace rte_atomicNN_xxx to __atomic_XXX and clean some codes.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-29 18:16:09 +01:00
Cheng Jiang
2aa47e94bf examples/vhost: add ioat ring space count and check
Add ioat ring space count and check, if ioat ring space is not enough
for the next async vhost packet enqueue, then just return to prevent
enqueue failure. Add rte_ioat_completed_ops() fail handler.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-29 18:16:09 +01:00
Jiayu Hu
1b7b24389c vhost: enhance async enqueue for small packets
Async enqueue offloads large copies to DMA devices, and small copies
are still performed by the CPU. However, it requires users to get
enqueue completed packets by rte_vhost_poll_enqueue_completed(), even
if they are completed by the CPU when rte_vhost_submit_enqueue_burst()
returns. This design incurs extra overheads of tracking completed
pktmbufs and function calls, thus degrading performance on small packets.

This patch enhances async enqueue for small packets by enabling
rte_vhost_submit_enqueue_burst() to return completed packets.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-13 18:51:58 +01:00
Joyce Kong
111cf3f497 examples/vhost: relax memory ordering when enqueue/dequeue
Use C11 atomic APIs with one-way barriers to replace two-way
barriers when operating enqueue/dequeue. Used->idx and avail->idx
are the synchronization points for split vring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-01-08 18:07:55 +01:00
Cheng Jiang
6e9a9d2a02 examples/vhost: fix ioat dependency
Fix vhost-switch compiling issue when ioat dependency is missing.
Change 'RTE_x86' check into 'RTE_RAW_IOAT' check in meson build file.
Use 'RTE_RAW_IOAT' to control conditional compiling in source file.
Clean some codes.

Fixes: abec60e711 ("examples/vhost: support vhost async data path")
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2020-11-13 19:43:26 +01:00
Cheng Jiang
653b5994e8 examples/vhost: fix string split error handling
Add checking return value of string split function to fix the
coverity issue.

Coverity issue: 363739
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:26 +01:00
Cheng Jiang
2b7126f5fc examples/vhost: check argument length
Add args length check before copying to fix the coverity issue.

Coverity issue: 363741
Fixes: 3a04ecb214 ("examples/vhost: add async vhost args parsing")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:26 +01:00
Bruce Richardson
3495a68f2a examples: stop processing meson file if build impossible
Once it has been determined that an example cannot be built, there is
little point in continuing to process the meson.build file for that
example, so we can use subdir_done() to return to the calling file.
This can potentially prevent problems where later statement in the file
may cause an error on systems where the app cannot be built, e.g. on
Windows or FreeBSD.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-12 19:33:36 +01:00
Cheng Jiang
abec60e711 examples/vhost: support vhost async data path
This patch is to implement vhost DMA operation callbacks for CBDMA
PMD and add vhost async data-path in vhost sample. With providing
callback implementation for CBDMA, vswitch can leverage IOAT to
accelerate vhost async data-path.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-03 23:24:26 +01:00
Cheng Jiang
3a04ecb214 examples/vhost: add async vhost args parsing
This patch is to add async vhost driver arguments parsing function
for CBDMA channel, DMA initiation function and args description.
The meson build file is changed to fix dependency problem. With
these arguments vhost device can be set to use CBDMA or CPU for
enqueue operation and bind vhost device with specific CBDMA channel
to accelerate data copy.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-03 23:24:26 +01: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
Maxime Coquelin
9ea8d28986 examples/vhost: remove dequeue zero-copy support
Dequeue zero-copy feature is being removed from the
Vhost library. This preliminary patch removes its uses
in the Vhost example application.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2020-09-30 23:16:56 +02:00
Ciara Power
fda34680eb examples: remove legacy sections of makefiles
The example app makefiles contained sections using the legacy method of
compiling with make. These are no longer needed, and are removed,
leaving only the section that uses pkg-config for the make build.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2020-09-07 16:53:41 +02:00
Sarosh Arif
ce6b8c3154 examples: fix port mask parsing failure handling
Giving invalid or zero portmask as command line option to
these applications will have an unexpected response.
The reason behind this is that the return value of function
that parses portmask is stored in a variable whose datatype is
unsigned int, hence returning -1 in case of zero or
invalid portmask causes an unexpected behaviour.
If we return 0 instead of -1 this issue can be resolved.
The program already contains the functionality to print
"invalid portmask" and program usage if zero is returned.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-07-30 23:24:40 +02:00
Bruce Richardson
8549295db0 build/pkg-config: improve static linking flags
Rather than setting -Bstatic in the linker flags when doing a static link,
and then having to explicitly set -Bdynamic again afterwards, we can update
the pkg-config file to use -l:libfoo.a syntax to explicitly refer to the
static library in question. Since this syntax is not supported by meson's
pkg-config module directly, we can post-process the .pc files instead to
adjust them.

Once done, we can simplify the examples' makefiles and the docs by removing
the explicit static flag.

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>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Georgiy Levashov
3ee6f70651 examples: add flush after stats printing
When printf()'s stdout is line-buffered for terminal, it is fully
buffered for pipes. So, stdout listener can only get the output
when it is flushed (on program termination, when buffer is filled or
manual flush).

stdout buffer might fill slowly since every stats report could be small.

Also when it is fully filled it might contain a part of the last stats
report which makes it very inconvenient for any automation which reads
and parses the output.

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

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-06-25 00:20:01 +02:00
Bruce Richardson
69b1bb49ed examples: hide error for missing pkg-config path flag
Some versions of pkg-config don't support the --path flag, which is not a
fatal error when building the apps. Without the flag, the makefile just
cannot track the .pc file of DPDK as a dependency of the build. Therefore,
we can ignore the error and suppress it by redirecting to /dev/null the
stderr from that call to pkg-config.

Fixes: 22119c4591 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 22:48:32 +01:00
Bruce Richardson
12a652a02b examples: fix build with old pkg-config
Not all versions of pkg-config in distros have support for the
--define-prefix flag [1], causing errors when building examples manually or
with test-meson-builds.sh script [2].

For the former case, we need to remove the hard-coded use of the flag in
the Makefiles.

For the latter case, the flag is necessary for builds to succeed, so we
skip the tests when it's not present, passing it as part of the pkg-config
command if it is supported.

[1]
CentOS Linux release 7.7.1908 (Core)
pkg-config version 0.27.1

[2]
 ## Building cmdline
Unknown option --define-prefix
gmake: Entering directory
`...ild-x86-default/install-root/usr/local/share/dpdk/examples/cmdline'
rm -f build/cmdline build/cmdline-static build/cmdline-shared
test -d build && rmdir -p build || true
Unknown option --define-prefix
Unknown option --define-prefix
gcc -O3  main.c commands.c parse_obj_list.c -o build/cmdline-shared
main.c:14:28: fatal error: cmdline_rdline.h: No such file or directory

Fixes: ca9268529d ("examples: support relocated DPDK install")
Fixes: 7f80a2102b ("devtools: test pkg-config file")
Cc: stable@dpdk.org

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 22:47:15 +01:00
Igor Romanov
70febdcfd6 examples: check status of getting MAC address
The return value of rte_eth_macaddr_get() 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:55 +02:00
Ivan Ilchenko
f430bbcecf examples: take promiscuous mode switch result into account
rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
37fb306c16 examples/vhost: 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
examples/vhost 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: Tiwei Bie <tiwei.bie@intel.com>
2019-10-07 14:45:35 +02:00
Bruce Richardson
4131ad5db7 examples: fix pkg-config detection with older make
Make versions before 4.2 did not have support for the .SHELLSTATUS
variable, so use another method to detect shell success.

Fixes: 22119c4591 ("examples: use pkg-config in makefiles")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-03 23:10:23 +02:00
Bruce Richardson
ca9268529d examples: support relocated DPDK install
For testing of DPDK, we want to override the prefix given by the
pkg-config file, so that we can get correct paths for DPDK installed
in an unusual location.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-02 18:07:46 +02:00
David Marchand
0c9da7555d net: replace IPv4/v6 constants with uppercase name
Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.

old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-06-03 16:54:54 +02:00
Olivier Matz
f41b5156fe net: add rte prefix to TCP structure
Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:45 +02:00