Commit 49b536fc30 ("eal: load only shared libs from driver plugin directories")
introduced a check that any shared library must ends with .so, but it can't
work, at least, on Fedora/CentOS/RHEL since .so symlinks are not installed
when you install dpdk package, but only when you install dpdk-devel package.
This commit adds also a check for .so.ABI_VERSION to check for shared lib.
See Fedora Packaging Guidelines for more information:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages
Fixes: 49b536fc30 ("eal: load only shared libs from driver plugin directories")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Commit 06c7871dde ("eal: restrict default plugin path to shared lib mode")
introduced a check that enabled shared lib mode when librte_eal.so can
be loaded, but it can't work, at least, on Fedora/CentOS/RHEL since .so
symlinks are not installed when you install dpdk package, but only when
you install dpdk-devel package.
This commit uses librte_eal.so.ABI_VERSION to check for shared lib,
since it exists on any linux distributions.
See Fedora Packaging Guidelines for more information:
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_devel_packages
Fixes: 06c7871dde ("eal: restrict default plugin path to shared lib mode")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Remove the operation of optical modules in the link function, because
when device binds from dpdk to kernel, it will be linked failed. This
function does not take effect in cable mode, therefore, optimization
is required.
Fixes: 54ac338699 ("net/hinic: set link down and up")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
The maximum number of queues on the chip can be any value greater
than 0, it does not have to be the power of two, if it does not be
fixed, dpdk initialization may be failed with OVS mode firmware.
Fixes: 828d3e15a9 ("net/hinic/base: support context and work queue")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
The initialization me->locked=1 in lock() must happen before
next->locked=0 in unlock(), otherwise a thread may hang forever,
waiting me->locked become 0. On weak memory systems (such as ARMv8),
the current implementation allows me->locked=1 to be reordered with
announcing the node (pred->next=me) and, consequently, to be
reordered with next->locked=0 in unlock().
This fix adds a release barrier to pred->next=me, forcing
me->locked=1 to happen before this operation.
Fixes: 2173f3333b ("mcslock: add MCS queued lock implementation")
Cc: stable@dpdk.org
Signed-off-by: Diogo Behrens <diogo.behrens@huawei.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
The "misc" and "regex" device classes were missing from the list used to
check arguments, preventing them from being used with "--status-dev"
flag to list only devices of those types.
When adding them to the list, the list is also sorted alphabetically for
consistency.
Bugzilla ID: 582
Fixes: 81255f27c6 ("usertools: replace optparse with argparse")
Reported-by: Wei Ling <weix.ling@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Yu Jiang <yux.jiang@intel.com>
In the function rte_flow_shared_action_destroy(),
the errno ETOOMANYREFS has been replaced with EBUSY in the
commit dc328d1c55 ("ethdev: rename a flow shared action error code").
Another occurrence of ETOOMANYREFS, added later by mistake,
is replaced with EBUSY errno.
Fixes: fa7ad49e96 ("net/mlx5: fix shared RSS action update")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Tal Shnaiderman <talshn@nvidia.com>
Tested-by: Tal Shnaiderman <talshn@nvidia.com>
PMD did not remove tunnel offload object from tunnels database before
it released the object memory. As the result, the tunnels database
become corrupted and subsequent search operations triggered PMD crash.
The patch removes tunnel offload object from the tunnels database when
the object is not in-use by PMD any more.
Fixes: bc1d90a3cf ("net/mlx5: fix build with Direct Verbs disabled")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
In mlx5 internal hash list tool, there is a log print when an entry
allocation is failed: Can't allocate hash list entry.
Some initialization checks triggers hash list registration in order to
check some capabilities. Here, the failure in registration doesn't
lead to failure in the initialization flow, that is why the log level
can be lower.
Move the entry allocation failure log to debug level.
Signed-off-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Invalid memory release order of DevX resources caused PMD crash.
1. SQ and CQ memory must be unregistered with DevX before it is freed.
2. SQ objects reference to a CQ ones. Hence, SQ should be destroyed in
advance of CQ it references to.
Fixes: 6deb19e1b2 ("net/mlx5: separate Rx queue object creations")
Fixes: 88f2e3f18c ("net/mlx5: rearrange SQ and CQ creation in DevX module")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
The rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore so should only copy real header instead of the whole struct.
Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.
Fixes: 09315fc838 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
ICMP -> Internet Control Message Protocol
IPv4 -> Internet Protocol version 4
IPv6 -> Internet Protocol version 6
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
This is an improved version of the setup of huge pages
bases on earlier DPDK setup.
Differences are:
* autodetects NUMA vs non NUMA
* allows setting different page sizes
recent kernels support multiple sizes.
* accepts a parameter in bytes (not pages).
* can display current hugepage settings.
Most users will just use --setup argument but if necessary
the steps of clearing old settings and mounting/umounting
can be done individually.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
In the display_pmd_info_strings function, the script parses the section
until to find a byte between 32 and 127, and get all data
until a byte equals to 0.
After, it searches "PMD_INFO_STRING" in the data and passes the whole
string in the parse_pmd_info_string function, which split the string
with "=" and convert it in python dict with json.loads().
But the string may contain a "=" before "PMD_INFO_STRING",
so it is not correctly split and will lead to an error
(json.decoder.JSONDecodeError).
Example of a string encountered that leads to an error:
"Ag%=C£°ÐÊ+Ë®{0´wË-£0òjB·;¾¬úPMD_INFO_STRING= {"name" :
"net_octeontx", "params" : "nr_port=<int> ", "pci_ids" : []}"
Fixes: c67c9a5c64 ("tools: query binaries for HW and other support information")
Cc: stable@dpdk.org
Signed-off-by: Julien Massonneau <julien.massonneau@6wind.com>
Python lint suggests using in instead of multiple comparisons.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Address python lint complaints about unused imports.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint warns about using len(SEQUENCE) to determine if sequence is empty.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The optparse module is deprecated and replaced with new argparse.
Using the python standard argument parser instead of C library
style getopt gives a number of advantages such as checking
for conflicting arguments, restricting choices, and automatically
generating help messages.
Some of the help messages are now less wordy.
The code now enforces the rule that only one of the pmdinfo formats
can be specified: raw or json.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint complains about indentation and missing spaces around commas.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Python lint complains:
Unnecessary parens after 'if' keyword
Unnecessary parens after 'not' keyword
Unnecessary "else" after "return"
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The builtin open() is the recommended approach in python3.
io.open was for compatibility with older versions.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
In python3 the standard way to split strings is to use the
split() on the string object itself. The old way is broken
and would cause a traceback.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
&device requires the %u format specifer not the %d specifier, as
&device is unsigned.
Fixes: a46bbb5760 ("net/bnxt: update multi device design")
Cc: stable@dpdk.org
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
On some CentOS/RHEL systems using gcc 8.3.1 to compile dpdk, gcc shows a
warning on every build step saying that -Wformat-nonliteral and
-Wformat-security warnings will be ignored unless -Wformat is
also specified as a compiler flag. When the build is run with -werror
the build will fail due to these warnings.
Exact warning returned:
cc1: error: -Wformat-nonliteral ignored without -Wformat
[-Werror=format-nonliteral]
cc1: error: -Wformat-security ignored without -Wformat
[-Werror=format-security]
cc1: all warnings being treated as errors
This patch adds the -Wformat flag to config/meson.build. The warning id
181 has also been suppressed in icc as icc was showing false positives
with -Wformat enabled.
Fixes: 524a0d5d66 ("build: enable extra warnings with meson")
Cc: stable@dpdk.org
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Tested-by: Lingli Chen <linglix.chen@intel.com>
Linking with the 'pci' driver when building with MinGW on
Windows fails with undefined symbol 'GUID_DEVCLASS_NET'.
This occurs because devguid.h is included in rte_windows.h
before INITGUID is defined.
Move the include of devguid.h after the definition of INITGUID.
Fixes: b762221ac2 ("bus/pci: support Windows with bifurcated drivers")
Cc: stable@dpdk.org
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Reviewed-by: Tal Shnaiderman <talshn@nvidia.com>
Cleanup code style issue reported by kernel checkpatch. As follows:
* ERROR:CODE_INDENT: code indent should use tabs where possible
* ERROR:SPACING: spaces required around that '?' (ctx:VxE)
* WARNING:INDENTED_LABEL: labels should not be indented
Fixes: b0489e7bca ("malloc: fix linear complexity")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Representor is a port in DPDK that is connected to a VF in such a way
that assuming there are no offload flows, each packet that is sent
from the VF will be received by the corresponding representor. While
each packet that is sent to a representor will be received by the VF.
This is very useful in case of SRIOV mode, where the first packet that
is sent by the VF will be received by the DPDK application which will
decide if this flow should be offloaded to the E-Switch.
Representor shares interrupts handler with host PF over the PCI
address. Therefore, after PF completes its interrupts handler
initialization, no additional actions required for representor.
Fixes: 26c08b979d ("net/mlx5: add port representor awareness")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
l3fwd-power uses `--parse-ptype' parameter to query egress packets
type. Before that feature is enabled l3fwd-power verifies PMD ability
to advertise supported packet types with
rte_eth_dev_get_supported_ptypes().
The above ethdev function API contains this note:
"
Better to invoke this API after the device is already started or rx burst
function is decided, to obtain correct supported ptypes.
"
The patch updates code for PMDs that register supported types after
dev_start.
Fixes: 82bea46616 ("examples/l3fwd-power: add --parse-ptype option")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
The shared RSS action update was not operational due to lack
of kernel driver support of TIR object modification.
This commit introduces the workaround to support shared RSS
action modify using an indirect queue table update instead of
touching TIR object directly.
Limitations: the only supported RSS property to update is queues, the
rest of the properties ignored.
Fixes: d2046c09aa ("net/mlx5: support shared action for RSS")
Signed-off-by: Andrey Vesnovaty <andreyv@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
If user don't set the dv_xmeta_en to 1 or 2,
in the flow_dv_convert_action_set_meta function:
- flow_dv_get_metadata_reg may return the REG_NONE,
when MLX5_METADATA_FDB enabled for metadata set action.
- reg_to_field(REG_NONE) returns MLX5_MODI_OUT_NONE,
that is invalid and rdma-core fails.
The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field
Fixes: fcc8d2f716 ("net/mlx5: extend flow metadata support")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Changing the allocation scheme to improve mbufs locality caused mbufs
overrun in some cases. Revert the previous replenish logic back.
Calculate a number of unused mbufs and replenish max this number of mbufs.
Mark the last 4 mbufs as fake mbufs to prevent overflowing into consumed
mbufs in the future. Keep the consumed index and the produced index 4 mbufs
apart for this purpose.
Replenish some mbufs only in case the consumed index is within the
replenish threshold of the produced index in order to retain the cache
locality for the vectorized MPRQ routine.
Fixes: 5c68764377 ("net/mlx5: improve vectorized MPRQ descriptors locality")
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
mlx5 PMD refuses to update link state if link speed is defined but
status is down or if link speed is undefined but status is up, even if
the ioctl() succeeded.
This prevents application to detect link up/down event, especially when
the link speed is not correctly detected.
Commit [1] allowed returning unknown link speed, so now PMD allows
the return of unknown link speed in the above case.
Due to some old kernel driver bug, link speed wasn't detected properly.
[1] http://git.dpdk.org/dpdk/commit/?id=810b17d116f03
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore so add_*_header functions should use real header instead of
the using rte_flow_item_* struct.
Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.
Fixes: 09315fc838 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
The rte_flow_item_eth and rte_flow_item_vlan items were updated in [1].
The rte_flow_item_ipv6 item was updated in [2].
The structs now contain additional metadata following the header data.
The size to use for match should be the header data size only, and
not the size of the whole struct.
This patch replaces the rte_flow_item_* with the corresponding rte_*_hdr.
Fixes: 09315fc838 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Fixes: ad976bd40d ("ethdev: add extensions attributes to IPv6 item")
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore.
Should use real header instead of the whole struct.
Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.
Fixes: 09315fc838 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Fixes: f9210259ca ("net/mlx5: fix raw encap/decap limit")
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
The rte_flow_item_eth and rte_flow_item_vlan items are refined.
The structs do not exactly represent the packet bits captured on the
wire anymore so should only copy real header instead of the whole struct.
Replace the rte_flow_item_* with the existing corresponding rte_*_hdr.
Fixes: 09315fc838 ("ethdev: add VLAN attributes to ethernet and VLAN items")
Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
In regex QP setup, the PMD creates some SQ objects.
When SQ object creation is failed, the previous SQ objects memory were
not freed what caused a memory leak.
Free them.
Fixes: 54fa1f6a67 ("regex/mlx5: add teardown for fastpath buffers")
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The constant representing the size of the metadata is defined as a
regular number (32-bit signed), even though all of its uses request an
unsigned int variable.
Similarly the constant representing the maximal output is also defined
as a regular number, even though all of its uses request an unsigned int
variable.
Change the type of the above constants to unsigned.
Fixes: 5f41b66d12 ("regex/mlx5: setup fast path")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
During the rules flush, the rxp_poll_csr_for_value function is called
twice. The rxp_poll_csr_for_value function can fail for two reasons:
1. It could not read the value from register, in which case the
function returns -1.
2. It read a value, but not the value it expected to receive. In this
case it returns -EBUSY.
When the function fails it prints an error message that is relevant only
for a second type of failure. Moreover, for failure of the first type it
prints a value of an uninitialized variable.
In case of success, the function prints a debug message about the number
of cycles it took. This line was probably copied by mistake, since the
variable it reads from, is always equal to 0 and is not an indicator of
the number of cycles.
Remove the incorrect line about the cycles, and reduce the error print
only for the relevant error.
Fixes: b34d816363 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The rxp_flush_rules function tries to read and write to the register
several times using DevX API, and when it fails the function returns an
error.
Similarly the rxp_init_eng function also tries to write to the register
several times, and if writing is failed, it returns an error too.
Both functions have one write that the function does not check if it
succeeded, overriding the return value from the write function without
using it.
Add a check for this writing, and return an error in case of failure.
Fixes: b34d816363 ("regex/mlx5: support rules import")
Fixes: e3dbbf718e ("regex/mlx5: support configuration")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The rxp_poll_csr_for_value function defines a variable named ret. It is
the return value of the function, and it is updated to 0 by default
later in the function.
Similarly the rxp_init_rtru function also defines a variable named ret.
The function assigns into it return values from functions during the
function.
In both functions they initialize the ret variable when defining it.
however, in both cases they do not use any ret variable before assigning
into them different values, so the initializations are unnecessary.
Clean the aforementioned unnecessary initializations.
Fixes: e3dbbf718e ("regex/mlx5: support configuration")
Fixes: b34d816363 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The mlx5_regex_rules_db_import function goes over all engines in the
loop and program rxp rules.
The iterator of the loop is called id and the variable representing the
number of engines is called priv->nb_engines.
The id variable is of uint8_t type while the priv->nb_engines variable
is of uint32_t type. The size of the priv->nb_engines variable is much
larger than the number of iterations allowed by the id type.
Theoretically there may be a situation where the value of the
priv->nb_engines will be greater than can be represented by 8 bits and
the loop will never end.
Change the type of id to uint32_t.
Fixes: b34d816363 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The mlx5_regex_pci_probe function allocates a mlx5_regex_priv structure
using rte_zmalloc.
If the allocation fails, the function jumps to the dev_error label in
order to release previously allocated resources in the function.
However, in the dev_error label it attempts to refer to the internal
fields of the priv structure and if its allocation fails (as in this
case) it is actually dereferencing to NULL.
Replace the jump with an error label.
Fixes: 1db6ebd4ef ("regex/mlx5: fix crash on initialization failure")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
The function rte_zmalloc() could return NULL, the return value
need to be checked.
Fixes: dc49e6aa48 ("compress/isal: add ISA-L compression functionality")
Fixes: 7bf4f0630a ("compress/isal: add ISA-L decomp functionality")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Lee Daly <lee.daly@intel.com>