Commit Graph

25965 Commits

Author SHA1 Message Date
Ferruh Yigit
047d5c9c81 devtools: add acronyms in dictionary for commit checks
ICMP -> Internet Control Message Protocol
IPv4 -> Internet Protocol version 4
IPv6 -> Internet Protocol version 6

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-22 22:43:49 +01:00
Stephen Hemminger
6e1b58fa84 usertools: add huge page setup script
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>
2020-11-22 22:38:03 +01:00
Julien Massonneau
3515fa1e5e usertools: fix pmdinfo parsing
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>
2020-11-22 22:22:44 +01:00
Stephen Hemminger
0a3f92cd3e usertools: test multiple strings with operator in
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>
2020-11-22 22:22:44 +01:00
Stephen Hemminger
1bb98a9083 usertools: remove unused imports in devbind
Address python lint complaints about unused imports.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-11-22 22:22:44 +01:00
Stephen Hemminger
d58360c6d3 usertools: do not test empty with function len
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>
2020-11-22 22:22:36 +01:00
Stephen Hemminger
81255f27c6 usertools: replace optparse with argparse
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>
2020-11-22 22:16:04 +01:00
Stephen Hemminger
c358ba7a17 usertools: fix indentation
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>
2020-11-22 22:15:14 +01:00
Stephen Hemminger
55f58d7f7d usertools: replace explicit boolean checks
Code reads better if unnecessary comparison with False and True
is not used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-11-22 22:15:13 +01:00
Stephen Hemminger
b5685e3900 usertools: remove unnecessary parens and else
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>
2020-11-22 22:14:12 +01:00
Stephen Hemminger
5b8c137650 usertools: replace io.open
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>
2020-11-22 22:04:11 +01:00
Stephen Hemminger
ecdd471171 usertools: replace string.split
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>
2020-11-22 22:04:10 +01:00
Conor Walsh
4c3a535ede net/bnxt: fix format specifier for unsigned numbers
&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>
2020-11-22 21:29:27 +01:00
Conor Walsh
654e893436 build: fix gcc warning requiring Wformat
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>
2020-11-22 19:38:25 +01:00
Nick Connolly
141492be99 eal/windows: fix linkage with MinGW
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>
2020-11-22 18:55:01 +01:00
Yunjian Wang
a99d2521a3 malloc: fix style in free list index computation
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>
2020-11-22 18:52:07 +01:00
Gregory Etelson
5882bde88d net/mlx5: fix representor interrupts handler
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>
2020-11-22 18:27:08 +01:00
Gregory Etelson
6184a02223 examples/l3fwd-power: check packet types after start
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>
2020-11-22 18:27:08 +01:00
Andrey Vesnovaty
fa7ad49e96 net/mlx5: fix shared RSS action update
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>
2020-11-22 16:40:03 +01:00
Tonghao Zhang
5ea8356ec8 net/mlx5: check register available for metadata action
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>
2020-11-22 15:37:05 +01:00
Alexander Kozyrev
5fc2e5c27d net/mlx5: fix mbuf overflow in vectorized MPRQ
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>
2020-11-22 15:37:03 +01:00
Viacheslav Ovsiienko
b15af1573a net/mlx5: make Tx scheduling xstats names compliant
xstats names for Tx packet scheduling should be compliant with [1]

[1] http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html?highlight=xstats#extended-statistics-api

Bugzilla ID: 558

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-22 15:37:02 +01:00
Viacheslav Ovsiienko
1101809b43 net/mlx5: make ethernet xstats names compliant
xstats names for simple stats are mostly standardized in ethdev drivers
and should be compliant with [1]

[1] http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html?highlight=xstats#extended-statistics-api

Bugzilla ID: 558

Reported-by: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-22 15:37:00 +01:00
Benoît Ganne
1688c580e8 net/mlx5: allow unknown link speed
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>
2020-11-22 15:36:56 +01:00
Xiaoyu Min
8b91a7cd2c app/flow-perf: fix raw encapsulation size
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>
2020-11-22 17:07:34 +01:00
Dekel Peled
1ce051a4cc net/softnic: fix header size calculation
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>
2020-11-22 17:07:32 +01:00
Xiaoyu Min
388dd1c9a6 net/mlx5: fix encap/decap limit for hairpin flow split
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>
2020-11-22 17:07:27 +01:00
Xiaoyu Min
0d23f95d70 net/bnxt: fix VLAN/VXLAN encapsulation header size
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>
2020-11-22 17:07:25 +01:00
Michael Baum
a165ee1ec1 regex/mlx5: fix leak on queue setup failure
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>
2020-11-22 15:05:54 +01:00
Michael Baum
30d604bb15 regex/mlx5: fix type of setup constants
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>
2020-11-22 15:05:08 +01:00
Michael Baum
3fed64d0e4 regex/mlx5: improve error messages in RXP rules flush
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>
2020-11-22 14:53:24 +01:00
Michael Baum
acb93dbcd0 regex/mlx5: check DevX register write
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>
2020-11-22 14:50:50 +01:00
Michael Baum
97de3671de regex/mlx5: remove unnecessary initializations
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>
2020-11-22 14:48:51 +01:00
Michael Baum
a07079b1a6 regex/mlx5: fix RXP engines iterator size
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>
2020-11-22 13:19:06 +01:00
Michael Baum
3423d02b6d regex/mlx5: fix crash on probe failure
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>
2020-11-22 13:17:21 +01:00
Radha Mohan Chintakuntla
aaa7108d46 maintainers: update for OCTEON TX2 DMA and EP
Replace the maintainers for OcteonTx2 DMA and EP drivers.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
Acked-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Mahipal Challa <mchalla@marvell.com
2020-11-22 13:17:20 +01:00
Yunjian Wang
e816f5ede5 compress/isal: check allocation in queue setup
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>
2020-11-22 13:17:10 +01:00
Shijith Thotton
8e6663b8c1 event/octeontx2: unlink queues during port release
Unlinking queues from port should be done during port release. Doing it
during device re-configuration could result in segfault as ports array
is re-allocated based on new number of ports.

Fixes: f7ac8b66b2 ("event/octeontx2: support linking queues to ports")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-11-20 18:53:47 +01:00
Pavan Nikhilesh
52f2fcb3e2 event/octeontx2: fix unconditional Tx flush
Fix unconditional Tx flush, in case of Tx only we need to check if
work slot is non-empty before issuing flush.
Also, in packet retransmit cases added check for the reference
count and flush the work slot only for the last packet.

Fixes: cb7ee83b63 ("event/octeontx2: improve single flow performance")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-11-20 18:53:47 +01:00
Pavan Nikhilesh
a912cb5bdd event/octeontx: remove selftest option
Since selftest now depends on dynamic mbuf fields it is not
feasible to run selftest on device probe.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-11-20 18:53:47 +01:00
Pavan Nikhilesh
c116a2aad9 event/octeontx2: remove selftest option
Since selftest now depends on dynamic mbuf fields it is not
feasible to run selftest on device probe.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-11-20 18:53:47 +01:00
Timothy McDaniel
fd3607bb8a event/dlb: fix mempool query in self test
Add NULL check before using t->mbuf_pool.

Coverity issue: 363719
Fixes: d1112958f4 ("event/dlb: add self-tests")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2020-11-20 18:53:47 +01:00
Chengchang Tang
a1e7e04bac net/hns3: fix HW exception for unbalanced Rx/Tx queues
For kupeng 930, there are 3 registers to control the enable
status of a TQP(i.e. task queue pair, include a txq and a rxq).
One of them controls whether the TQP is enabled, and the other
two controls whether the rxq and txq are enabled. The registers
used to control the enabled status of the rxq and txq are enabled
by default. Therefore, after the TQP is enabled, the rxq and txq
are enabled by default.

Currently, when the number of rxq is not equal to the number of txq, the
unused rxqs or txqs are not disabled by driver, so these unused queues
will be enabled in this situation.  And the related HW rings have not
been initialized which could lead to a hardware exception.

This patch fix it by disable these unused queues during enable the TQPs.

Fixes: fa29fe45a7 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-20 21:10:05 +01:00
Huisong Li
1c359bae18 net/hns3: fix crash with multi-TC
The HW and SW DCB configurations need to be updated only
after the DCB configuration information changed. But the
change of tx/rx queue number is ignored. If user decreases
the number of tx queue after configuring multi-TC, the queue
mapping information in hns3_tc_queue_info can not be updated.
And then accessing the released queue resource in
"hns3_init_tx_ring_tc" will trigger a segment fault.

Fixes: 62e3ccc2b9 ("net/hns3: support flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-20 21:10:05 +01:00
Thomas Monjalon
dc328d1c55 ethdev: rename a flow shared action error code
In the experimental function rte_flow_shared_action_destroy()
introduced in DPDK 20.11, the errno ETOOMANYREFS was used.
This errno is not always available on Windows,
so it is preferred using EBUSY instead.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Tal Shnaiderman <talshn@nvidia.com>
Tested-by: Tal Shnaiderman <talshn@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-20 21:10:05 +01:00
Guoyang Zhou
511b7371d3 net/hinic: fix hugepage memory leaks
The 'nic_io' memory is set to NULL before it is freed, this is wrong,
and the freeing of some private port resources should be moved from the
".remove(device)" function to the ".dev_close(port)" function.

Fixes: f30e69b41f ("ethdev: add device flag to bypass auto-filled queue xstats")
Cc: stable@dpdk.org

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
2020-11-20 21:10:05 +01:00
Ferruh Yigit
56f0534311 app/testpmd: revert setting MTU explicitly after configure
Setting MTU after each 'rte_eth_dev_configure()' prevents using
"--max-pkt-len=N" parameter and "port config all max-pkt-len #" command

This is breaking DTS scatter test case which is using
"--max-pkt-len=9000" testpmd parameter.

Reverting workaround to recover the DTS testcase.

Fixes: 1c21ee95cf ("app/testpmd: fix MTU after device configure")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
2020-11-20 21:10:05 +01:00
Dekel Peled
a2999c7bfe common/mlx5: move to formal ASO action API
Existing code uses the previous API offered by rdma-core in order
to create ASO Flow Hit action.

A general API is now formally released, to create ASO action of any
type. This patch moves the MLX5 PMD code to use the formal API.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-20 21:10:05 +01:00
Dekel Peled
31ef2982fa net/mlx5: fix input register for ASO object
Existing code uses the hard-coded value REG_C_5 as input for function
mlx5dv_dr_action_create_flow_hit().

This patch updates function mlx5_flow_get_reg_id() to return the
selected REG_C value for ASO Flow Hit operation.
The returned value is used, after reducing offset REG_C_0, as input
for function mlx5dv_dr_action_create_flow_hit().

Fixes: f935ed4b64 ("net/mlx5: support flow hit action for aging")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-20 21:10:05 +01:00
Dekel Peled
7ad0b6d91f net/mlx5: fix memory leak on ASO age close
Recent patch introduced the use of ASO flow hit action for age action.
The relevant management struct uses dynamically allocated memory.
This memory was not freed on closing.

This patch adds memory freeing as needed.

Fixes: f935ed4b64 ("net/mlx5: support flow hit action for aging")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-20 21:10:05 +01:00