Thomas Monjalon [Sun, 25 Oct 2020 20:39:26 +0000 (21:39 +0100)]
mbuf: fix typo in dynamic field convention note
Replace "in a in PMD" with "in a PMD".
Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Thomas Monjalon [Sun, 25 Oct 2020 18:48:20 +0000 (19:48 +0100)]
kni: move header file from EAL
Since the kernel module is not part of EAL anymore,
there is no need to have the common KNI header file in EAL.
The file rte_kni_common.h is moved to librte_kni.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Mon, 26 Oct 2020 04:18:57 +0000 (05:18 +0100)]
examples: enclose DPDK includes with angle brackets
In examples, DPDK header files are external,
so they must be enclosed with angle brackets, not quotes.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Sat, 31 Oct 2020 14:27:03 +0000 (15:27 +0100)]
test/mbuf: skip field registration at busy offset
There is a test for dynamic field registration at a specific offset.
Depending on which driver is probed, some dynamic fields may be
already registered at this offset.
This failure is skipped with a warning.
Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags") Cc: stable@dpdk.org Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Marchand <david.marchand@redhat.com>
Bruce Richardson [Wed, 28 Oct 2020 12:45:34 +0000 (12:45 +0000)]
raw/ioat: fix work-queue config size
According to latest DSA spec[1], the work-queue config register size
should be based off a value read from the WQ capabilities register.
Update driver to read this value and base the start of each WQ config
off that value.
Bruce Richardson [Wed, 28 Oct 2020 16:27:01 +0000 (16:27 +0000)]
examples/multi_process: fix build on Ubuntu 20.04
Two warnings are reported by gcc 9.3.0 on Ubuntu 20.04.
When producing a printable mac address the buffer was appropriately sized
for holding the mac address exactly, but the actual snprintf included a
'\n' character at the end, which means that the snprintf technically is
getting truncated i.e. the \n would not be added due to lack of space.
This gets flagged as a problem by modern versions of gcc, e.g. on Ubuntu
20.04.
main.c:77:37: warning: ‘__builtin___snprintf_chk’ output truncated
before the last format character [-Wformat-truncation=]
77 | "%02x:%02x:%02x:%02x:%02x:%02x\n",
| ^
Since the \n is getting stripped anyway, we can fix the issue by just
removing it. In the process we can switch to using the standard ethernet
address formatting function from rte_ether.h.
The other warning is about possible string truncation when getting the
RX queue name:
In file included from init.c:36:
init.c: In function ‘init’:
../shared/common.h:38:28: warning: ‘%u’ directive output may be truncated
writing between 1 and 10 bytes into a region of size 8
[-Wformat-truncation=]
38 | #define MP_CLIENT_RXQ_NAME "MProc_Client_%u_RX"
| ^~~~~~~~~~~~~~~~~~~~
../shared/common.h:52:35: note: in expansion of macro ‘MP_CLIENT_RXQ_NAME’
52 | snprintf(buffer, sizeof(buffer), MP_CLIENT_RXQ_NAME, id);
| ^~~~~~~~~~~~~~~~~~
This is a false positive, as the value of the "id" is limited to 255,
being stored in the app as a uint8_t value, removing the possibility of
the %u being replaced by anything other then 3 characters max (rather than
up to 10 as thought by the compiler). Therefore, the warning can be easily
removed by changing the type of the "id" parameter to the local function
from "unsigned" to "uint8_t" also, ensuring the compiler is aware of the
range limit.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Bruce Richardson [Wed, 28 Oct 2020 16:27:00 +0000 (16:27 +0000)]
examples/vm_power: fix build on Ubuntu 20.04
When compiling on Ubuntu 20.04, a warning was issued about possible
truncation of the path string for the power management socket.
channel_manager.c: In function ‘add_all_channels’:
channel_manager.c:470:41: warning: ‘%s’ directive output may be
truncated writing up to 255 bytes into a region of size 90
[-Wformat-truncation=]
470 | sizeof(chan_info->channel_path), "%s%s",
| ^~
This can be fixed by adding in an explicit truncation check to the code
and handling it appropriately.
Fixes: e8ae9b662506 ("examples/vm_power: channel manager and monitor in host") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Bruce Richardson [Tue, 27 Oct 2020 17:19:53 +0000 (17:19 +0000)]
examples: fix linking against specific drivers
Some example apps rely on driver-specific functionality and link explicitly
against those drivers. These apps need their makefiles updated to take
account of the renaming of the driver libs.
Fixes: a20b2c01a7a1 ("build: standardize component names and defines") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Fix memory leak where variable oob_enable can go out of scope leaking
the storage it points to.
Coverity issue: 337674 Fixes: 95f648ff9ee ("examples/vm_power: make branch ratio threshold per core") Signed-off-by: Rory Sexton <rory.sexton@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
David Marchand [Wed, 28 Oct 2020 21:02:46 +0000 (22:02 +0100)]
trace: fixup CTF event description at registration
CTF event description is currently built by appending all fields in a
single string at trace point registration.
When dumping the metadata, this string is split again and inspected to
fixup reserved keywords and special tokens like "." or "->".
Move this fixup per field at trace point registration time so that there
is no need for inspecting / string parsing when dumping metadata.
Use dynamic allocations to remove an artificial size limit on the CTF
event description manipulations.
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Sunil Kumar Kori <skori@mavell.com>
Liang Ma [Tue, 27 Oct 2020 14:59:03 +0000 (14:59 +0000)]
eal: add intrinsics support check infrastructure
Currently, it is not possible to check support for intrinsics that
are platform-specific, cannot be abstracted in a generic way, or do not
have support on all architectures. The CPUID flags can be used to some
extent, but they are only defined for their platform, while intrinsics
will be available to all code as they are in generic headers.
This patch introduces infrastructure to check support for certain
platform-specific intrinsics, and adds support for checking support for
IA power management-related intrinsics for UMWAIT/UMONITOR and TPAUSE.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Signed-off-by: Liang Ma <liang.j.ma@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Ray Kinsella <mdr@ashroe.eu>
Liang Ma [Tue, 27 Oct 2020 14:59:02 +0000 (14:59 +0000)]
eal: add power management intrinsics
Add two new power management intrinsics, and provide an implementation
in eal/x86 based on UMONITOR/UMWAIT instructions. The instructions
are implemented as raw byte opcodes because there is not yet widespread
compiler support for these instructions.
The power management instructions provide an architecture-specific
function to either wait until a specified TSC timestamp is reached, or
optionally wait until either a TSC timestamp is reached or a memory
location is written to. The monitor function also provides an optional
comparison, to avoid sleeping when the expected write has already
happened, and no more writes are expected.
For more details, please refer to Intel(R) 64 and IA-32 Architectures
Software Developer's Manual, Volume 2.
Signed-off-by: Liang Ma <liang.j.ma@intel.com> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
Yunjian Wang [Thu, 15 Oct 2020 08:42:30 +0000 (16:42 +0800)]
eal: fix interrupt trace point
This patch fixes (dereference after null check) coverity issue.
For this reason, we should add null check at the beginning of the
function and return error directly if the 'intr_handle' is null.
Add zero-copy APIs. These APIs provide the capability to
copy the data to/from the ring memory directly, without
having a temporary copy (for ex: an array of mbufs on
the stack). Use cases that involve copying large amount
of data to/from the ring can benefit from these APIs.
Xiaoyun Li [Mon, 26 Oct 2020 08:11:43 +0000 (16:11 +0800)]
examples/tep_term: remove this application
This example sets up a scenario that VXLAN packets can be received
by different PF queues based on VNID and each queue is bound to a VM
with a VNID so that the VM can receive its inner packets.
Usually, OVS is used to do the software encap/decap for VXLAN packets.
And the VXLAN packets offloading can be replaced with flow rules in
testpmd like Chapter "Sample VXLAN flow rules" in Testpmd Application
User Guide.
And this example hasn't been used for a long time.
So deprecate this example.
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Move trie table layout and lookup definition into the
private header file. This is necessary for implementing a
vectorized lookup function in a separate .с file.
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Move dir24_8 table layout and lookup definition into the
private header file. This is necessary for implementing a
vectorized lookup function in a separate .с file.
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Add type argument to dir24_8_get_lookup_fn()
Now it supports 3 different lookup implementations:
RTE_FIB_LOOKUP_DIR24_8_SCALAR_MACRO
RTE_FIB_LOOKUP_DIR24_8_SCALAR_INLINE
RTE_FIB_LOOKUP_DIR24_8_SCALAR_UNI
Add new rte_fib_select_lookup() - user can change lookup
function type runtime.
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Ruifeng Wang [Fri, 23 Oct 2020 09:38:18 +0000 (11:38 +0200)]
lpm: hide internal data
Fields except tbl24 and tbl8 in rte_lpm structure have no
need to be exposed to the user.
Hide the unneeded exposure of structure fields for better
ABI maintainability.
Suggested-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Acked-by: Kevin Traynor <ktraynor@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
Ruifeng Wang [Fri, 23 Oct 2020 09:38:17 +0000 (11:38 +0200)]
lpm: fix free of data structure
The container structure should be freed instead of rte_lpm structure
after wrapping rte_lpm into internal structure __rte_lpm.
Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation") Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Phil Yang <phil.yang@arm.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> Acked-by: Kevin Traynor <ktraynor@redhat.com>
Thomas Monjalon [Sat, 24 Oct 2020 16:36:19 +0000 (18:36 +0200)]
maintainers: improve coverage of arch-specific files
The sub-directories of config/ are maintained by
different architecture maintainers.
Some wildcards are used to describe the lib, drivers and app files
which are specific to some architectures.
The EAL Arm files have split responsibilities depending on 32/64 suffix,
and the common files are shared between Armv7 and Armv8 sections.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: David Marchand <david.marchand@redhat.com>
Dharmik Thakkar [Wed, 21 Oct 2020 22:50:04 +0000 (17:50 -0500)]
hash: implement RCU resources reclamation
Currently, users have to use external RCU mechanisms to free resources
when using lock free hash algorithm.
Integrate RCU QSBR process to make it easier for the applications to use
lock free algorithm.
Refer to RCU documentation to understand various aspects of
integrating RCU library into other libraries.
Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Thomas Monjalon [Thu, 22 Oct 2020 19:22:45 +0000 (21:22 +0200)]
remove config prefix used with make
The config options CONFIG_RTE_* are simple RTE_* defines with meson.
Now that make support is dropped, update the names in logs and comments.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Acked-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Thu, 22 Oct 2020 17:37:34 +0000 (19:37 +0200)]
eal: remove comment about old partition option
The main initialization function (rte_eal_init) has documentation
about a feature from another era: memory partition.
Curiously, this lost treasure is found only now,
suggesting there may be other interesting things to discover in the doc.
To all aspiring Indiana Jones: the hunt is open!
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
Kevin Laatz [Wed, 21 Oct 2020 08:17:24 +0000 (09:17 +0100)]
doc: update patch cheatsheet to use meson
With 'make' being removed, the patch cheatsheet needs to be updated to
remove any references to 'make'. These references have been replaced with
meson alternatives in this patch.
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Ciara Power [Wed, 21 Oct 2020 08:17:21 +0000 (09:17 +0100)]
doc: remove reference to make from tools guide
Make is no longer supported for compiling DPDK, references are now
removed in the documentation.
Signed-off-by: Ciara Power <ciara.power@intel.com> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
Ciara Power [Wed, 21 Oct 2020 08:17:20 +0000 (09:17 +0100)]
doc: remove references to make from apps guide
While make has been deprecated for DPDK, it's still applicable for
some example apps to be built standalone, this patch adjusts the
guides to take that into consideration.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
David Marchand [Thu, 22 Oct 2020 07:59:59 +0000 (09:59 +0200)]
hash: use x86 common flag for jhash
jhash has been forgotten when factorising the x86 arch check.
Fixes: dbf17d44f375 ("hash: use common x86 flag") Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Thu, 22 Oct 2020 07:55:45 +0000 (09:55 +0200)]
drivers: add headers install helper
A lot of drivers export headers, reproduce the same facility than for
libraries.
Note: this change fixes an issue with the crypto scheduler headers which
were not installed properly. A separate backport will be sent to stable
branches.
Suggested-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
David Marchand [Thu, 22 Oct 2020 07:47:04 +0000 (09:47 +0200)]
build: fix version map file references in documentation
Fixes: 63b3907833d8 ("build: remove library name from version map file name") Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Yunjian Wang [Sat, 23 May 2020 10:52:21 +0000 (18:52 +0800)]
eal/linux: fix memory leak in uevent handling
When the memory for uevent.devname is allocated in dev_uev_parse(). It
is not freed when parse the subsystem layer fails in dev_uev_parse().
Before return, it is also not freed in dev_uev_handler(). These cause a
memory leak.
Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Thomas Monjalon [Wed, 14 Oct 2020 20:18:13 +0000 (22:18 +0200)]
bus/pci: remove unused scan by address
The function pci_update_device was used to scan a device
for probing by PCI address.
This private function (and implementations) are unused
since such probing is removed.
Fixes: f3bac43b60da ("bus/pci: remove unused function to probe by address") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: David Marchand <david.marchand@redhat.com>
Tal Shnaiderman [Tue, 20 Oct 2020 08:48:15 +0000 (11:48 +0300)]
eal/windows: add missing stdint include
Following the addition of the in_addr/in6_addr structs
to in.h the header file must have stdint.h included
for the definitions of the uint8_t/uint32_t types used
within the new structs.
Not having it could results in the following errors
in places where in.h is included:
in.h:30:2: error: unknown type name 'uint32_t'
uint32_t s_addr;
in.h:34:2: error: unknown type name 'uint8_t'
uint8_t s6_addr[16];
Bruce Richardson [Tue, 20 Oct 2020 09:17:43 +0000 (10:17 +0100)]
config: fix kni build
When building kernel modules such as kni, the "config" directory is not
passed as a standard path in the EXTRA_CFLAGS value, meaning that the
rte_compatibility_defines.h is not found from rte_config.h. However, since
both headers are in the same directory, we can just use quotes rather than
angle-brackets to ensure the second header is always found if the first is.
Fixes: b0b672aeadaa ("build: add defines for compatibility with make build") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: David Marchand <david.marchand@redhat.com>
Update the coding style document to include a policy against
introducing new master/slave usage. This is taken from the similar
place in the Linux kernel coding style.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
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>
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>
Ophir Munk [Sun, 18 Oct 2020 14:21:47 +0000 (14:21 +0000)]
app/regex: fix crash in options parsing
getopt_long() parses command-line arguments. One of its arguments
'longopts' is a pointer to the first element of an array of struct
option. The last element of the array has to be filled with zeros
to mark the end of options. For example:
This commit adds the last element. Prior to this commit getopt_long()
continued parsing beyond the longopts[] array which occasionally caused
segmentation faults.
Fixes: de06137cb295 ("app/regex: add RegEx test application") Cc: stable@dpdk.org Signed-off-by: Ophir Munk <ophirmu@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>