Kevin Laatz [Thu, 8 Oct 2020 09:51:20 +0000 (10:51 +0100)]
raw/ioat: introduce vdev probe for DSA/idxd device
The Intel DSA devices can be exposed to userspace via kernel driver, so can
be used without having to bind them to vfio/uio. Therefore we add support
for using those kernel-configured devices as vdevs, taking as parameter the
individual HW work queue to be used by the vdev.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
raw/ioat: add skeleton for VFIO/UIO based DSA device
Add in the basic probe/remove skeleton code for DSA devices which are bound
directly to vfio or uio driver. The kernel module for supporting these uses
the "idxd" name, so that name is used as function and file prefix to avoid
conflict with existing "ioat" prefixed functions.
Since we are adding new files to the driver and there will be common
definitions shared between the various files, we create a new internal
header file ioat_private.h to hold common macros and function prototypes.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Kevin Laatz [Thu, 8 Oct 2020 09:51:18 +0000 (10:51 +0100)]
usertools: support binding Intel DSA device
Intel Data Streaming Accelerator (Intel DSA) is a high-performance data
copy and transformation accelerator which will be integrated in future
Intel processors [1].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Only a few definitions from the hardware spec are actually used in the
driver runtime, so we can copy over those few and make the rest of the spec
a private header in the driver.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Rather than having the fence signalled via a flag on a descriptor - which
requires reading the docs to find out whether the flag needs to go on the
last descriptor before, or the first descriptor after the fence - we can
instead add a separate fence API call. This becomes unambiguous to use,
since the fence call explicitly comes between two other enqueue calls. It
also allows more freedom of implementation in the driver code.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
raw/ioat: rename functions to be operation-agnostic
Since the hardware supported by the ioat driver is capable of operations
other than just copies, we can rename the doorbell and completion-return
functions to not have "copies" in their names. These functions are not
copy-specific, and so would apply for other operations which may be added
later to the driver.
Also add a suitable warning using deprecation attribute for any code using
the old functions names.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Rather than having a single long complicated header file for general use we
can split things so that there is one header with all the publicly needed
information - data structs and function prototypes - while the rest of the
internal details are put separately. This makes it easier to read,
understand and use the APIs.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Cheng Jiang [Thu, 8 Oct 2020 09:51:13 +0000 (10:51 +0100)]
raw/ioat: add flag to control copying handle parameters
Add a flag which controls whether rte_ioat_enqueue_copy and
rte_ioat_completed_copies function should process handle parameters. Not
doing so can improve the performance when handle parameters are not
necessary.
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
In case of any failures, include the function name and the line number of
the error message in the message, to make tracking down the failure easier.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
To allow the header file to be used from C++ code we need to ensure all
typecasts are explicit, and include an 'extern "C"' guard.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Kevin Laatz [Thu, 8 Oct 2020 09:51:10 +0000 (10:51 +0100)]
raw/ioat: fix missing close function
When rte_rawdev_pmd_release() is called, rte_rawdev_close() looks for a
dev_close function for the device causing a segmentation fault when no
close() function is implemented for a driver.
This patch resolves the issue by adding a stub function ioat_dev_close().
Fixes: f687e842e328 ("raw/ioat: introduce IOAT driver") Cc: stable@dpdk.org Reported-by: Sunil Pai G <sunil.pai.g@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Sunil Pai G <sunil.pai.g@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)
build error:
In file included from ../buildtools/pmdinfogen/pmdinfogen.c:17:
../buildtools/pmdinfogen/pmdinfogen.c: In function ‘parse_elf’:
../buildtools/pmdinfogen/pmdinfogen.h:78:1:
warning: this ‘else’ clause does not guard...
[-Wmisleading-indentation]
78 | else \
| ^~~~
../buildtools/pmdinfogen/pmdinfogen.h:83:35:
note: in expansion of macro ‘CONVERT_NATIVE’
83 | #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)
| ^~~~~~~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.c:152:28:
note: in expansion of macro ‘TO_NATIVE’
152 | hdr->e_type = TO_NATIVE(endian, 16, hdr->e_type);
| ^~~~~~~~~
../buildtools/pmdinfogen/pmdinfogen.h:80:9:
note: ...this statement, but the latter is misleadingly indented
as if it were guarded by the ‘else’
80 | ___x; \
| ^~~~
Fixes: 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
timer: add limitation note for sync stop and reset
If a timer's callback function calls rte_timer_reset_sync() or
rte_timer_stop_sync() on another timer that is in the RUNNING state and
owned by the current lcore, the *_sync() calls will loop indefinitely.
Relatedly, if a timer's callback function calls *_sync() on another
timer that is in the RUNNING state and is owned by a different lcore,
but a timer callback function runs on that different lcore and calls
*_sync() on a timer that is in the RUNNING state and owned by the
current lcore, the two lcores will loop indefinitely.
Add a note in the rte_timer_stop_sync and rte_timer_reset_sync
documentation that indicates that these APIs should not be used inside
timer callback functions in order to avoid the hangs described above,
and suggests an alternative.
Bugzilla ID: 491 Cc: stable@dpdk.org Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
The current buffer size is not big enough to register trace points for
new additions in the eventdev subsystem.
Increase TRACE_CTF_FIELD_SIZE by 64 bytes for now.
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com> Acked-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
During power initialization the pstate cpufreq api is
not setting the initial curr_idx of pstate_power_info
to corresponding current frequency index.
Without this the idx is always 0, which is causing the
below check to pass and returns without setting the initial
min/max frequency to system max frequency and this leads to
incorrect frequency settings when power_pstate_cpufreq_set_freq()
is called in the apps.
/* Check if it is the same as current */
if (idx == pi->curr_idx)
return 0;
...
}
scenario 1:
If system has starting scaling min/max: 1000/1000, and want to
set this to 2200/2200, the max frequency gets updated but not min.
scenario 2:
If system has starting scaling min/max: 2200/1000, and want to set
to 2200/2200, the max, min frequency was not updated. Since no change
in max that should be ok, but min was also ignored, which will be fixed
now with the new changes.
This patch return OK code (0) from skeleton_rawdev_close function
if firmware is in SKELETON_FW_READY state. Formerly it returned
-EINVAL error code.
Returning an error here is troublesome as it disallows proper release
of the rawdev. The rte_rawdev_pmd_release function from librte_rawdev
library calls drivers' rawdev_close handler and continues execution
only in case of errorless call.
(see lib/librte_rawdev/rte_rawdev.c:540)
The SKELETON_FW_READY state is reached after creation, reset, unload
or close of the device. The device should be ok to be released in
such situations.
To reproduce issue fixed by this patch, call rawdev_autotest
from dpdk-test app for few times. As the device is not properly
released, the next calls will fail.
Statistics: passed, failed, unsupported and total are kept
in global static variables. As global variables they are initiated
with zeroes. However running test multiple times cumulates results
from previous calls.
This patch resets statistics with zeroes in testsuite_setup().
To reproduce issue fixed by this patch, run rawdev_autotest command
in dpdk-test app multiple times.
Louise Kilheeney [Wed, 23 Sep 2020 11:12:27 +0000 (12:12 +0100)]
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>
Ciara Power [Wed, 23 Sep 2020 11:12:26 +0000 (12:12 +0100)]
telemetry: support array values in data object
Arrays of type uint64_t/int/string can now be included within an array
or dict. One level of embedded containers is supported. This is
necessary to allow for instances such as the ethdev queue stats to be
reported as a list of uint64_t values, rather than having multiple dict
entries with one uint64_t value for each queue stat.
The memory management APIs provided by telemetry simplify the memory
allocation/free aspect of the embedded container. The rte_tel_data_alloc
function is called in the library/app callback to return a pointer to a
container that has been allocated memory. When adding this container
to an array/dict, a parameter is passed to indicate if the memory
should be freed by telemetry after use. This will allow reuse of the
allocated memory if the library/app wishes to do so.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Ciara Power [Thu, 27 Aug 2020 08:39:22 +0000 (09:39 +0100)]
telemetry: fix passing full params string to command
Telemetry only passed the first param to the command handler if multiple
were entered by the user, separated by commas. Telemetry is required to
pass the full params string to the command, by splitting by a comma
delimiter only once to remove the command part of the string. This will
enable future commands to take multiple param values.
Fixes: b1ad0e124536 ("rawdev: add telemetry callbacks") Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks") Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality") Cc: stable@dpdk.org Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Yi Yang [Thu, 24 Sep 2020 08:57:39 +0000 (16:57 +0800)]
gro: support VXLAN UDP/IPv4
VXLAN UDP/IPv4 GRO can help improve VM-to-VM UDP
performance when UFO or GSO is enabled in VM, GRO
must be supported if UFO or GSO is enabled,
otherwise, performance can't get big improvement
if only GSO is there.
With this enabled in DPDK, OVS DPDK can leverage it
to improve VM-to-VM UDP performance, it will reassemble
VXLAN UDP/IPv4 fragments immediate after they are
received from a physical NIC. It is very helpful in
OVS DPDK VXLAN use case.
Signed-off-by: Yi Yang <yangyi01@inspur.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com>
Yi Yang [Thu, 24 Sep 2020 08:57:38 +0000 (16:57 +0800)]
gro: support UDP/IPv4
UDP/IPv4 GRO can help improve VM-to-VM UDP performance
when UFO or GSO is enabled in VM, GRO must be supported
if UFO or GSO is enabled, otherwise, performance can't
get big improvement if only GSO is there.
With this enabled in DPDK, OVS DPDK can leverage it
to improve VM-to-VM UDP performance, it will reassemble
UDP fragments immediate after they are received from
a physical NIC. It is very helpful in OVS DPDK VLAN use
case.
Signed-off-by: Yi Yang <yangyi01@inspur.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com>
net: calculate checksum of packet with IPv4 options
Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
checksums are calculated wrong.
This patch fixes the issue by using the actual IPv4 header length from
the packet's IHL field.
Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon [Mon, 7 Sep 2020 22:39:03 +0000 (00:39 +0200)]
kernel/linux: remove igb_uio
As decided in the Technical Board in November 2019,
the kernel module igb_uio is moved to the dpdk-kmods repository
in the /linux/igb_uio/ directory.
Minutes of Technical Board meeting:
https://mails.dpdk.org/archives/dev/2019-November/151763.html
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This patch adds support to get/set link speed, duplex and
autoneg mode status from/to PHY. Enhance device capabilities
to advertise all supported link speeds according to mac type.
Also enables fallback support for get link status API where
kernel support is missing.
Send error packets to main queue (rx) to make application
enable to receive error packets.
Earlier all packets with L3/L4 checksum errors were getting
dropped by the hardware.
Enables a debugging queue to fetch error (Rx/Tx) packets
to user space. Earlier all packets with L3/L4 checksum
errors were getting dropped by the hardware.
Setting CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=y is required
which enables following enhancements.
1) Enable TX/RX error queues to check the errors packet.
2) Display error frame information(payload, status, paresr result).
3) Send error packets to application
Signed-off-by: Jun Yang <jun.yang@nxp.com> Signed-off-by: Rohit Raj <rohit.raj@nxp.com> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
DPAA2 has support for raw flow classification, which can
be used for any protocol rules. This change fixes flow key
pattern length match boundary condition with spec length.
Fixes: 3f881f8d6eb0 ("net/dpaa2: support raw flow classification") Cc: stable@dpdk.org Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com> Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
bus/fslmc: run secondary debug app without restriction
dpaa2 hw impose limits on some HW access devices like DPMCP(Management
control Port) and DPIO (HW portal). This causes issue in their shared
usages in case of multi-process applications. It can overcome by using
whitelist/blacklist in primary and secondary applications.
However it imposes restrictions on standard debugging apps like
dpdk-procinfo, which can be used to debug any existing application.
This patch introduces reserving extra DPMCP and DPIO to be used by
secondary process if devices are not blocked previously in primary
application.
This leaves the last DPMCP and DPIO for the secondary process usages.
Traffic was stalling after few packet while running l2fwd-event
in atomic mode on LX2 platform. It was due to wrong dca setting
while enqueuing packets to EQCR.
This patch fixes the issue by writing correct dca setting.
Fixes: 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index") Cc: stable@dpdk.org Signed-off-by: Youri Querry <youri.querry_1@nxp.com> Signed-off-by: Rohit Raj <rohit.raj@nxp.com> Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Joyce Kong [Fri, 11 Sep 2020 05:45:33 +0000 (13:45 +0800)]
rcu: promote library as stable
RCU library supporting quiescent state was introduced
in 19.05 release and has been around 4 releases, it
should be mature enough to remove the experimental tag.
Signed-off-by: Joyce Kong <joyce.kong@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Joyce Kong [Fri, 11 Sep 2020 05:45:32 +0000 (13:45 +0800)]
mcslock: promote as stable
Since rte_mcslock APIs were introduced in 19.08 release,
it is now possible to remove the experimental tag from:
rte_mcslock_lock()
rte_mcslock_unlock()
rte_mcslock_trylock()
rte_mcslock_is_locked()
Signed-off-by: Joyce Kong <joyce.kong@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Phil Yang <phil.yang@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Joyce Kong [Fri, 11 Sep 2020 05:45:31 +0000 (13:45 +0800)]
ticketlock: promote as stable
As rte_ticketlock was introduced in 19.05 release
and there were no changes in its public API since
19.11 release, it should be mature enough to remove
the experimental tag.
Signed-off-by: Joyce Kong <joyce.kong@arm.com> Reviewed-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Joyce Kong [Fri, 11 Sep 2020 05:45:34 +0000 (13:45 +0800)]
eal: promote wait until equal API as stable
rte_wait_until_equal_xx APIs were introduced in 19.11 release
and there were no changes in the public APIs since then, it
should be mature enough to remove the experimental tag.
Signed-off-by: Joyce Kong <joyce.kong@arm.com> Reviewed-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Build error:
../examples/vm_power_manager/guest_cli/vm_power_cli_guest.c:346:23:
warning: format ‘%ld’ expects argument of type ‘long int’, but
argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’}
[-Wformat=]
346 | cmdline_printf(cl, "Capabilities of [%d] vcore are:"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
349 | pkt_caps_list.turbo[i],
| ~~~~~~~~~~~~~~~~~~~~~~
| |
| uint64_t {aka long long unsigned int}
Fixes: 07525d1a047a ("examples/vm_power: send capabilities request from guest") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Tested-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Bruce Richardson [Thu, 10 Sep 2020 16:47:15 +0000 (17:47 +0100)]
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>
Bruce Richardson [Thu, 10 Sep 2020 16:47:14 +0000 (17:47 +0100)]
raw/ioat: support multiple devices being tested
The current selftest function uses a single global variable to track state
which implies that only a single instance can have the selftest function
called on it. Change this to an array to allow multiple instances to be
tested.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
David Marchand [Thu, 1 Oct 2020 07:55:17 +0000 (09:55 +0200)]
drivers/common: mark all symbols as internal
Now that we have the internal tag, let's avoid confusion with exported
symbols in common drivers that were using the experimental tag as a
workaround.
There is also no need to put internal API symbols in the public stable
ABI.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Ray Kinsella <mdr@ashroe.eu>
Yuval Avnery [Mon, 5 Oct 2020 10:51:20 +0000 (10:51 +0000)]
regex/mlx5: add dynamic memory registration to datapath
Currently job data is being copied to pre-registered buffer.
To avoid memcpy on the datapath, use dynamic memory registration.
This change will reduce latency when sending regex jobs. The first few
jobs may have high latency due to registration, but assuming all
following mbufs will arrive from the same mempool/hugepage, there will
be no further memory registration.
Signed-off-by: Yuval Avnery <yuvalav@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
David Marchand [Thu, 10 Sep 2020 16:24:07 +0000 (18:24 +0200)]
mem: fix allocation in container with SELinux
This is something we encountered while working in an OpenShift
environment with SELinux enabled.
In this environment, a DPDK application could create/write to hugepage
files but removing them was refused.
This resulted in dirty files being reused when starting a new DPDK
application and triggered random crashes / erratic behavior.
Getting a SELinux setup can be a challenge, and even more if you add
containers to the picture :-).
So here is a reproducer for the interested testers:
# # First run is fine
# LD_PRELOAD=libwrap.so dpdk-testpmd -w 0000:01:00.0 -- -i
[...]
Configuring Port 0 (socket 0)
Port 0: 24:6E:96:3C:52:D8
Checking link statuses...
Done
testpmd>
# # Second run we have dirty memory
# LD_PRELOAD=libwrap.so dpdk-testpmd -w 0000:01:00.0 -- -i
[...]
### refused unlinkat for rtemap_0
[...]
Port 0 is now not stopped
Please stop the ports first
Done
testpmd>
Removing hugepage files is done in multiple places and the memory
allocation code is complex.
This fix tries to do the minimum and avoids touching other paths.
If trying to remove the hugepage file before allocating a page fails,
the error is reported to the caller and the user will see a memory
allocation error log.
Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") Cc: stable@dpdk.org Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Sequences like "value = %"PRIu64 (no space before PRIu64) are parsed as
a single preprocessor token, user-defined-string-literal, in C++11
onwards. While modern compilers are smart enough to parse this properly,
GCC 9.3.0 generates warnings like:
rte_rcu_qsbr.h:555:26: warning: invalid suffix on literal; C++11
requires a space between literal and string macro [-Wliteral-suffix]
Add spaces around format specifier macros to make public headers
compatible with C++ without causing warnings. Make similar changes in C
source for style consistency within the library.
The doxygen index file is not printed as a processed file by doxygen so it
does not appear in the output .d (dependency file) list automatically
generated. Therefore, for correct rebuild tracking, we need to explicitly
include it as a dependency of the doxygen job.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The "note" callouts in the chapter describing the meson build were
incorrectly formatted, so adjust to use the correct markdown syntax.
Fixes: 9c3adc289c5e ("doc: add instructions on build using meson") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
When the --werror meson build option is set, we can pass the "-W",
warning-as-errors, flag to sphinx to get the same behaviour for doc
building as for building the rest of DPDK. This can help catch
documentation errors sooner in the development process.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The stack library was first released in 19.05, and its interfaces have been
stable since their initial introduction. This commit promotes the full
interface to stable, starting with the 20.11 major version.
Signed-off-by: Gage Eads <gage.eads@intel.com> Acked-by: David Marchand <david.marchand@redhat.com>
timer: promote some experimental functions as stable
Some new APIs were added to the timer library in the 19.05 release, and
there have been no changes to their interfaces since then. These
functions can be considered stable enough to remove their 'experimental'
tag.
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com> Acked-by: Ray Kinsella <mdr@ashroe.eu>
Robin Jarry [Fri, 2 Oct 2020 15:47:53 +0000 (17:47 +0200)]
doc: remove references to python 2
Python 2 support has now been dropped. Remove references to it in the
documentation.
Since all python scripts now have a proper shebang that calls python3,
execute the scripts directly without specifying the interpreter.
Sphinx version from most Linux distros is OK in 2020, do not encourage
people to break their system by installing with pip. Use the distros
official packages.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Yunjian Wang [Fri, 11 Sep 2020 11:08:04 +0000 (19:08 +0800)]
bus/pci: fix leak on VFIO mapping error
Currently, only the 'vfio_dev_fd' is closed in failure path, so
some resources are not released(such as 'vfio_group_fd'). The
rte_vfio_release_device() should be used to avoid this problem.
Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Yunjian Wang [Tue, 19 May 2020 03:42:12 +0000 (11:42 +0800)]
bus/fslmc: fix VFIO group descriptor check
The issue is that a file descriptor at 0 is a valid one. Currently
the file not found, the return value will be set to 0. As a result,
it is impossible to distinguish between a correct descriptor and a
failed return value. Fix it to return -ENOENT instead of 0.
Fixes: a69f79300262 ("bus/fslmc: support multi VFIO group") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Yunjian Wang [Tue, 19 May 2020 03:42:00 +0000 (11:42 +0800)]
vfio: fix group descriptor check
The issue is that a file descriptor at 0 is a valid one. Currently
the file not found, the return value will be set to 0. As a result,
it is impossible to distinguish between a correct descriptor and a
failed return value. Fix it to return -ENOENT instead of 0.
Clang builds use getopt.c in librte_eal while MinGW provides
implementation as part of the toolchain. Statically linking librte_eal
to an application that depends on getopt results in undefined reference
errors with MinGW. There are no such errors with Clang, because with
Clang librte_eal actually defines getopt functions.
Use getopt.c in EAL with Clang and MinGW to get identical behavior.
Adjust code for MinGW. Incidentally, this removes a bug when free() is
called on uninitialized memory.
Fixes: 5e373e456e6 ("eal/windows: add getopt implementation") Cc: stable@dpdk.org Reported-by: Khoa To <khot@microsoft.com> Reported-by: Tal Shnaiderman <talshn@nvidia.com> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Khoa To <khot@microsoft.com> Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
Louise Kilheeney [Wed, 30 Sep 2020 11:40:14 +0000 (12:40 +0100)]
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>
David Marchand [Fri, 2 Oct 2020 08:28:31 +0000 (10:28 +0200)]
pipeline: fix build with glibc < 2.26
reallocarray has been introduced in glibc 2.26 but we still support
glibc >= 2.7.
Simply replace with realloc, as the considered sizes are unlikely to
overflow.
"""
The reallocarray() function changes the size of the memory block
pointed to by ptr to be large enough for an array of nmemb elements,
each of which is size bytes. It is equivalent to the call
realloc(ptr, nmemb * size);
However, unlike that realloc() call, reallocarray() fails safely in
the case where the multiplication would overflow. If such an over‐
flow occurs, reallocarray() returns NULL, sets errno to ENOMEM, and
leaves the original block of memory unchanged.
"""
Maxime Coquelin [Tue, 29 Sep 2020 16:14:04 +0000 (18:14 +0200)]
net/virtio: introduce vhost-vDPA backend
vhost-vDPA is a new virtio backend type introduced by vDPA kernel
framework, which provides abstraction to the vDPA devices and
exposes an unified control interface through a char dev.
This patch adds support to the vhost-vDPA backend. As similar to
the existing vhost kernel backend, a set of virtio_user ops were
introduced for vhost-vDPA backend to handle device specific operations
such as:
- device setup
- ioctl message handling
- queue pair enabling
- dma map/unmap
vDPA relevant ioctl codes and data structures are also defined in
this patch.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Tue, 29 Sep 2020 16:14:02 +0000 (18:14 +0200)]
net/virtio: adapt virtio-user status size
Set proper payload size for set/get status message. The payload
size varies according to backend types.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Patrick Fu <patrick.fu@intel.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Adrian Moreno [Tue, 29 Sep 2020 16:13:59 +0000 (18:13 +0200)]
net/virtio: move backend type selection to ethdev
This is a preparation patch with no functional change.
Use an enum instead of a boolean for the backend type.
Move the detection logic to the ethdev layer (where it is needed for the
first time).
The virtio_user_dev stores the backend type in the virtio_user_dev
struct so the type is only determined once
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Mon, 28 Sep 2020 09:17:12 +0000 (11:17 +0200)]
vhost: remove dequeue zero-copy support
Dequeue zero-copy removal was announced in DPDK v20.08.
This feature brings constraints which makes the maintenance
of the Vhost library difficult. Its limitations makes it also
difficult to use by the applications (Tx vring starvation).
Removing it makes it easier to add new features, and also remove
some code in the hot path, which should bring a performance
improvement for the standard path.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin [Mon, 28 Sep 2020 09:17:10 +0000 (11:17 +0200)]
examples/vhost_crypto: use vhost async-copy flag
The crypto backend uses RTE_VHOST_USER_DEQUEUE_ZERO_COPY only
for the shared areas to be populated at mmap time. It does
not use the other mechanisms the feature provides.
Now that RTE_VHOST_USER_DEQUEUE_ZERO_COPY is being removed,
let's use RTE_VHOST_USER_ASYNC_COPY instead which does the
same thing.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Marvin Liu [Mon, 28 Sep 2020 08:20:52 +0000 (16:20 +0800)]
net/virtio: fix indirect descriptors in packed datapaths
Like split ring, packed ring will utilize indirect ring
elements when queuing mbufs need multiple descriptors.
Thus each packet will take only one slot when having
multiple segments.
Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues") Cc: stable@dpdk.org Signed-off-by: Marvin Liu <yong.liu@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Marvin Liu [Mon, 28 Sep 2020 08:20:51 +0000 (16:20 +0800)]
net/virtio: fix packed ring indirect descricptors setup
Add packed indirect descriptors format into virtio Tx
region. When initializing vring, packed indirect
descriptors will be initialized if ring type is packed.
Fixes: bc80357cd677 ("net/virtio: drop unused field in Tx region structure") Cc: stable@dpdk.org Signed-off-by: Marvin Liu <yong.liu@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Ivan Dyukov [Tue, 22 Sep 2020 21:18:01 +0000 (00:18 +0300)]
net/virtio: set default speed unknown
rte_ethdev states new rule for NICs: they should return UNKNOWN
speed if speed is unknown and interface is up, in case of down
interface, NONE speed should be returned.
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Dumitru Ceara [Mon, 28 Sep 2020 18:47:29 +0000 (20:47 +0200)]
net/ring: advertise multi segment Tx and scatter Rx
Even though ring interfaces don't support any other TX/RX offloads they
do support sending multi segment packets and this should be advertised
in order to not break applications that use ring interfaces.
Also advertise scatter RX support.
Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>