Allow users and packagers to override the default RTE_MAX_ETHPORTS.
This adds a new meson option, max_ethports which defaults to the
current value.
Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Rather than relying on the target machine architecture, use the
size of a pointer from the compiler to determine if we are 64-bits
or not. This allows correct behaviour when you pass -m32 as a compile
option. It also allows us to use this value repeatedly throughout the
repo rather than continually testing for the sizeof(void*).
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Acked-by: Luca Boccassi <bluca@debian.org>
readlink option "-m" is not supported on FreeBSD (checked on BSD 11),
so change to the largely-equivalent "-f" flag.
Fixes: a55277a788 ("devtools: add test script for meson builds")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The vhost_crypto example app can't be used without the DPDK vhost
library, so disable the build of the example if the lib hasn't been
built.
Fixes: f5188211c7 ("examples/vhost_crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
The ip_pipeline example requires the epoll.h header from linux, so
disable building the example if the header cannot be found.
Fixes: 4bbf8e30aa ("examples/ip_pipeline: add CLI interface")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
usleep() is defined in unistd.h, which is missing from include list
in test_compressdev.c, causing compiler errors on FreeBSD.
Fixes: b06aa643ca ("test/compress: add initial unit tests")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Since all other apps have been moved to the "app" folder, the autotest app
remains alone in the test folder. Rather than having an entire top-level
folder for this, we can move it back to where it all started in early
versions of DPDK - the "app/" folder.
This move has a couple of advantages:
* This reduces clutter at the top level of the project, due to one less
folder.
* It eliminates the separate build task necessary for building the
autotests using make "make test-build" which means that developers are
less likely to miss something in their own compilation tests
* It re-aligns the final location of the test binary in the app folder when
building with make with it's location in the source tree.
For meson builds, the autotest app is different from the other apps in that
it needs a series of different test cases defined for it for use by "meson
test". Therefore, it does not get built as part of the main loop in the
app folder, but gets built separately at the end.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The bpf folder didn't actual contain a test application, but instead
basic examples of BPF code for use with testpmd. Therefore we can
move it to the `examples` folder. Being different, it also needs
a README with it, explaining what it is and how to use it. References
to the code from the testpmd docs are suitably updated.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Move to "app" directory and enable with meson build.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Move app to "app" directory and enable with meson build. For consistency of
naming, the subdirectory is also renamed from cmdline_test to test-cmdline.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Since compat library is only a single header, we can easily move it into
the EAL common headers instead of tracking it separately. The downside of
this is that it becomes a little more difficult to have any libs that are
built before EAL depend on it. Thankfully, this is not a major problem as
the only library which uses rte_compat.h and is built before EAL (kvargs)
already has the path to the compat.h header file explicitly called out as
an include path.
However, to ensure that we don't hit problems later with this, we can add
EAL common headers folder to the global include list in the meson build
which means that all common headers can be safely used by all libraries, no
matter what their build order.
As a side-effect, this patch also fixes an issue with building on BSD using
meson, due to compat lib no longer needing to be listed as a dependency.
Fixes: a8499f65a1 ("log: add missing experimental tag")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Natalie and Dmitri are no longer involved in PMDs maintenance hence
update the list.
Also append new active maintainers to the list.
Signed-off-by: Liron Himi <lironh@marvell.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
CONFIG_RTE_LIBRTE_PMD_ISAL was not tested because of a typo.
CONFIG_RTE_LIBRTE_PMD_QAT_SYM was not tested since it has been
introduced and made CONFIG_RTE_LIBRTE_PMD_QAT enabled by default.
While at it, DPDK_DEP_JSON is now checked for "y",
as other DPDK_DEP_* variables, instead of non-empty.
Fixes: 3c32e89f68 ("compress/isal: add skeleton ISA-L compression PMD")
Fixes: 7a34c21557 ("compress/qat: add empty driver")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
The PMD zlib was not enabled in devtools/test-build.sh.
It is fixed by using the environment variable DPDK_DEP_ZLIB.
Fixes: 0c4e4c16b0 ("compress/zlib: introduce zlib PMD")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
The option CONFIG_RTE_LIBRTE_BPF_ELF was never enabled
with test-build.sh.
It is fixed with the environment variable DPDK_DEP_ELF.
Fixes: 5dba93ae5f ("bpf: add ability to load eBPF program from ELF object file")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
When building DPDK with "make" and options
CONFIG_RTE_USE_LIBBSD=y
and
CONFIG_RTE_BUILD_SHARED_LIB=y
libbsd was not linked, resulting in compilation errors:
undefined reference to `strlcpy'
The link option -lbsd is added in a common place for both
Linux apps and libs.
It is used in app linkage via EXECENV_LDLIBS,
and in lib linkage via the added variable EXECENV_LDLIBS-y.
Fixes: 5364de644a ("eal: support strlcpy function")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.
Fixes: d7280c9fff ("vhost: support selective datapath")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
In rte_vhost_driver_unregister(), the connection fd is
removed from the fdset using fdset_try_del(). Call to
this function may fail if the corresponding fd is in
busy state, indicating that event dispatcher is
executing the read or write callback on this fd.
When it happens, rte_vhost_driver_unregister() keeps
trying to remove the fd from the set until it is no
more busy.
This situation is causing a deadlock, because
rte_vhost_driver_unregister() keeps trying to remove
the fd from the set with vhost_user.mutex held, while
the callback executed by the dispatcher,
vhost_user_read_cb(), also takes this mutex at
numerous places.
The fix consists in releasing vhost_user.mutex between
each retry in vhost_driver_unregister().
Fixes: 8b4b949144 ("vhost: fix dead lock on closing in server mode")
Cc: stable@dpdk.org
Signed-off-by: Wenjie Sun <findtheonlyway@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This patch introduces an optimized enqueue function in packed
ring for the case that virtio net header can be prepended to
the unchained mbuf.
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This patch introduces a helper for clearing the virtio net header
to avoid the code duplication. Macro is used as it shows slightly
better performance.
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
When IN_ORDER feature is negotiated, device may just write out a
single used descriptor for a batch of buffers:
"""
Some devices always use descriptors in the same order in which they
have been made available. These devices can offer the VIRTIO_F_IN_ORDER
feature. If negotiated, this knowledge allows devices to notify the
use of a batch of buffers to the driver by only writing out a single
used descriptor with the Buffer ID corresponding to the last descriptor
in the batch.
The device then skips forward in the ring according to the size of the
batch. The driver needs to look up the used Buffer ID and calculate the
batch size to be able to advance to where the next used descriptor will
be written by the device.
"""
But the Tx path of packed ring can't handle this. With this patch,
when IN_ORDER is negotiated, driver will manage the IDs linearly,
look up the used buffer ID and advance to the next used descriptor
that will be written by the device.
Fixes: 892dc798fa ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
When IN_ORDER feature is negotiated, device may just write out a
single used ring entry for a batch of buffers:
"""
Some devices always use descriptors in the same order in which they
have been made available. These devices can offer the VIRTIO_F_IN_ORDER
feature. If negotiated, this knowledge allows devices to notify the
use of a batch of buffers to the driver by only writing out a single
used ring entry with the id corresponding to the head entry of the
descriptor chain describing the last buffer in the batch.
The device then skips forward in the ring according to the size of
the batch. Accordingly, it increments the used idx by the size of
the batch.
The driver needs to look up the used id and calculate the batch size
to be able to advance to where the next used ring entry will be written
by the device.
"""
Currently, the in-order Tx path in split ring can't handle this.
With this patch, driver will allocate desc_extra[] based on the
index in avail/used ring instead of the index in descriptor table.
And driver can just relay on the used->idx written by device to
reclaim the descriptors and Tx buffers.
Fixes: e5f456a98d ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
We should try to cleanup at least the 'need' number of descs.
Fixes: 892dc798fa ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
If the port has received less than ``pkt_per_port`` packets (for
example, the port has missed some packets), the test is in an infinite
loop.
Instead of expecting a number of packet to receive, let the port to be
drained by itself. If no more packets are received, the test can
continue.
Fixes: 002ade70e9 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
test_alb_reply_from_client test fails due to incorrect active slave
array's index. This was due to invalid active slave count.
Count of internals->active_slave is not updated even when active slave
is deactivated.
Hence active slave count always keeps incrementing beyond the actual
active slaves.
Fix is to set the internals->active_slave to starting index 0 whenever
it exceeds the number of slaves in active slave list and also update
the active slave count during slave de-activation.
Fixes: e1110e9776 ("net/bonding: fix Rx slave fairness")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
For active-backup, tlb, and alb mode,
bond_ethdev_promiscuous_{enable,disable} tries to set promisc mode on
the primary port, even when there are no slaves. It is harmless, as
rte_eth_promiscuous_{enable,disable} does nothing if the port number
is invalid. But, it does print a warning message. Here is an example
from testpmd.
testpmd> create bonded device 5 0
Created new bonded device net_bonding_testpmd_0 on (port 4).
Invalid port_id=33
testpmd> set promisc 4 off
Invalid port_id=33
33 in this case is RTE_MAX_ETHPORTS + 1, the invalid primary port
number used within the bonding driver. This warning message is
harmless but can be confusing to the user. So do not try to set
promisc on a primary port when we know it does not exist (i.e. no
slaves).
Fixes: 2efb58cbab ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Chas Williams <chas3@att.com>
This patch fixes a regression introduced by
commit 49d3978d57 ("net/qede: fix Tx tunnel offload support mask")
in which qede_xmit_prep_pkts() breaks the loop for successful
check of Tunneling offload flags instead of continuing, resulting
in tx_pkt_prepare return a failure.
Fixes: 49d3978d57 ("net/qede: fix Tx tunnel offload support mask")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
When removing the old attach function, the racy variable for getting
the last port id became unused.
Fixes: c9cce42876 ("ethdev: remove deprecated attach/detach functions")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Whenever the app is calling rte_eth_dev_info_get(), it shouldn't use the
admin command. It was causing problems, if it was called from the
secondary process - the main process was crashing, and the secondary app
wasn't getting any result, as the admin request couldn't be processed by
the process which was requesting the data.
To fix that, the data is being written to the adapter structure during
device initialization routine.
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Copying the link properties of the first slave added may copy an
invalid link status. The speed and duplex of the slave may not
be known at this time. Delay setting the properties until the
first slave reports as link up. Note that we are still ignoring
an error from link_properties_valid. For some bonding modes,
802.3ad, we should not activate the slave if it does not have
matching link properties.
Fixes: a45b288ef2 ("bond: support link status polling")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
The Tx burst routine always needs to check for pending LACPDUs
and send them if available. Do this first to prioritize the
control traffic. We can still early exit, before calculating
the distribution slaves, if there isn't any data packets.
Fixes: 09150784a7 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Reported-by: Hui Zhao <zhaohui8@huawei.com>
Signed-off-by: Chas Williams <chas3@att.com>
VLAN filter is required to be configured during dev_start according to
dev_conf.rxmod.offloads setting, so ice_vlan_offload_set is called to
handle this.
Fixes: 690175ee51 ("net/ice: support getting device information")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Enable CLEARPBA bit is required by ice NIC of A0/A1 version to
enable admin queue interrupt.
Also enable CLEARPBA bit does no impact on AVF behaviour when be
hosted by other devices, so we can make it as default.
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags: this allows initializing bnxt
PMD as non-root also on Linux v4.x, where /proc/self/pagemap can't be
accessed without CAP_SYS_ADMIN privileges.
Cc: stable@dpdk.org
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
We can transmit if there is at least one distributing slave.
Fixes: 09150784a7 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <chas3@att.com>
Fix segment fault when detach a device due to some redundant function
call in ice_dev_uninit.
Fixes: f9cf4f8641 ("net/ice: support device initialization")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
The API function rte_eth_dev_fw_version_get() is querying drivers
via the operation callback fw_version_get().
The implementation of this operation is added for mlx4 and mlx5.
Both functions are copying the same ibverbs field fw_ver
which is retrieved when calling ibv_query_device[_ex]()
during the port probing.
It is tested with command "drvinfo" of examples/ethtool/.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Original patch implemented the use of match_metadata offload in the
different burst functions.
The concurrent use of match_metadata and multi_segs offloads was
not handled.
This patch updates function txq_scatter_v(), to pass metadata value
from mbuf to wqe, when indicated by offload flags.
Fixes: 6bd7fbd03c ("net/mlx5: support metadata as flow rule criteria")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This patch fixes a broken build; when running
make test
we get the following error:
...
Traceback (most recent call last):
File "test/test/autotest.py", line 49, in <module>
num_fails = runner.run_all_tests()
File "test/test/autotest_runner.py", line 345, in run_all_tests
self.parallel_tests)
File "test/test/autotest_runner.py", line 264, in __filter_test
test_cmd = test["Command"]
KeyError: 'Command'
...
The reason is that the pdump autotest entry uses "Comamnd"
instead of "Command"; this patch fixes it.
Bugzilla ID: 205
Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Add the strlcat function to DPDK to exist alongside the strlcpy one.
While strncat is generally safe for use for concatenation, the API for the
strlcat function is perhaps a little nicer to use, and supports truncation
detection.
See commit 5364de644a ("eal: support strlcpy function") for more
details on the function selection logic, since we only should be using the
DPDK-provided version when no system-provided version is present.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
External message callbacks are used e.g. by vhost crypto
to parse crypto-specific vhost-user messages.
We are now publishing the API to register those callbacks,
so that other backends outside of DPDK can use them as well.
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This minor cleanup patch removes an unnecessary forward
declaration of virtio_intr_enable() in net/virtio PMD.
Fixes: fe19d49cb5 ("net/virtio: fix Rx interrupt with VFIO")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
We don't need to relay available ring and check the desc, vdpa device
can access the available ring in the guest directly. With this patch,
we can achieve better throughput and lower CPU usage.
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Port configuration fails because offload flags don't match the expected
value when max-pkt-len is set to a value that should enable receive port
offloading but doesn't.
The .dev_infos_get callback can be called before the configure callback.
At that time we don't know the maximum packet size yet because it is
only set up when ports are started. So in virtio_dev_info_get() just
always set the jumbo packet offload flag.
Check the maximum packet length at device configure time, because then we
have access to the max-pkt-len value provided by the user. If the
max-pkt-len exceeds the maximum MTU supported by the device we remove
the VIRTIO_NET_F_MTU flag from requested features.
Fixes: a4996bd89c ("ethdev: new Rx/Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Read barrier is required between reading the flags (desc_is_used)
and the content of descriptor to ensure the ordering.
Otherwise, speculative read of desc.id could be reordered with
reading of the desc.flags.
Fixes: a76290c8f1 ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
There should be read barrier between checking VIRTQUEUE_NUSED (reading
the used->idx) and reading these descriptors. It's done for the first
checks at the beginning of these functions but missed while checking
for extra required descriptors.
Fixes: e5f456a98d ("net/virtio: support in-order Rx and Tx")
Fixes: 13ce5e7eb9 ("virtio: mergeable buffers")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>