Commit Graph

26594 Commits

Author SHA1 Message Date
Bruce Richardson
7be7dc6dea build: force pkg-config for dependency detection
Meson can use cmake as a fallback for detecting packages, and this can
lead to picking up 64-libs for 32-bit builds. To work around this, force
the use of pkg-config only for detecting libcrypto, zlib, jansson and
other package dependencies.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Liron Himi <lironh@marvell.com>
Tested-by: Lee Daly <lee.daly@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Martin Spinler <spinler@cesnet.cz>
2021-01-26 00:43:59 +01:00
Dmitry Kozlyuk
3feefc80ac buildtools: use build directory for temporary files
Use current build directory as base for temporary directories,
so that all build files are isolated there.

Fixes: e6e9730c70 ("buildtools: support object file extraction for Windows")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-26 00:41:08 +01:00
Dmitry Kozlyuk
a38eae8efa buildtools: fix archive extraction for Python 3.5
Python 3.5 subprocess.run() has no capture_output parameter.
Use subprocess.PIPE available in all versions.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-26 00:40:35 +01:00
Dmitry Kozlyuk
65ef14c576 buildtools: fix pmdinfogen with pyelftools < 0.24
pyelftools had some breaking changes [1] and API enhancements [2]
between 0.23 (used in Ubuntu 16.04) and 0.24. Ensure compatibility with
both legacy and modern versions.

[1]: https://github.com/eliben/pyelftools/pull/76
[2]: https://github.com/eliben/pyelftools/pull/56

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-26 00:39:34 +01:00
Dmitry Kozlyuk
6b19edcb66 build: enable pmdinfogen for Windows
Remove platform restriction when building drivers.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
2021-01-25 23:24:38 +01:00
Dmitry Kozlyuk
e6e9730c70 buildtools: support object file extraction for Windows
clang archiver tool is llvm-ar on Windows and ar on other platforms.
MinGW always uses ar. Replace shell script (Unix-only) that calls ar
with a Python script (OS-independent) that calls an appropriate archiver
tool selected at configuration time. Move the logic not to generate
empty sources into pmdinfogen.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-25 23:23:50 +01:00
Dmitry Kozlyuk
0fe5c4e5ad buildtools: allow multiple input files in pmdinfogen
Process any number of input object files and write a unified output.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-25 23:23:49 +01:00
Dmitry Kozlyuk
5031436f45 buildtools: support COFF in pmdinfogen
Common Object File Format (COFF) is used on Windows in place of ELF.

Add COFF parser to pmdinfogen. Also add an argument to specify input
file format, which is selected at configure time based on the target.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-01-25 23:23:48 +01:00
Dmitry Kozlyuk
dd2ea14772 buildtools: remove C implementation of pmdinfogen
Delete the files no longer used in build process.
Add myself as maintainer of new implementation.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2021-01-25 23:23:46 +01:00
Dmitry Kozlyuk
f0f93a7adf buildtools: use Python pmdinfogen
Use the same interpreter to run pmdinfogen as for other build scripts.
Adjust wrapper script accordingly and also don't suppress stderr from ar
and pmdinfogen. Add configure-time check for elftools Python module for
Unix hosts.

Add pyelftools to CI configuration and build requirements for Linux and
FreeBSD. Windows targets are not currently using pmdinfogen.

Suppress ABI warnings about generated PMD information strings.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
2021-01-25 23:23:41 +01:00
Dmitry Kozlyuk
6c4bf8f424 buildtools: add Python pmdinfogen
Using a high-level, interpreted language simplifies maintenance and
build process. Furthermore, ELF handling is delegated to pyelftools
package. Original logic is kept, the copyright recognizes that.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
2021-01-25 23:23:30 +01:00
David Marchand
6c51ba3c42 examples/pipeline: fix VXLAN script permission
This python script provides a shebang that only makes sense if the
script has the executable bit set.

Fixes: fde7a77270 ("examples/pipeline: add VXLAN encapsulation example")
Cc: stable@dpdk.org

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2021-01-25 10:15:34 +01:00
Thomas Monjalon
04ed01f1f6 doc: simplify OS support in features matrix
The networking drivers features matrix had rows to show
OS and kernel modules support:
	- BSD nic_uio
	- Linux UIO
	- Linux VFIO
	- Other kdrv
	- Windows

The kernel modules details are removed to keep only OS support:
	- FreeBSD
	- Linux
	- Windows

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-21 14:53:16 +01:00
Bruce Richardson
64fd212430 app: fix build with extra include paths
The "includes" variable in the app/meson.build file was ignored when
building the executable, meaning that apps couldn't pass additional
include paths directly back. Fix this to align with drivers and libs.

Fixes: fa036e70d7 ("app: generalize meson build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
b9a396b0fd node: fix missing header include
The rte_compat header file is needed for the '__rte_experimental' macro.

Fixes: f00708c2aa ("node: add IPv4 rewrite and lookup control")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
7012833094 metrics: fix variable declaration in header
The global variable "tel_met_data" was declared in a header file, rather
than in a C file, leading to duplicate definitions if more than one C
file included the header.

Fixes: c5b7197f66 ("telemetry: move some functions to metrics library")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
cd93ec8961 pipeline: fix missing header includes
The stdio.h header needs to be included to get the definition of the
FILE type.

Fixes: b32c0a2c5e ("pipeline: add SWX table update high level API")
Fixes: 3ca60ceed7 ("pipeline: add SWX pipeline specification file")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
3b4d434e53 table: fix missing header include
The rte_lru_x86.h header, included from the main rte_lru.h header, uses
the RTE_CC_IS_GNU macro from rte_common.h but fails to include that
header file.

Fixes: 0c9a5735a9 ("eal: fix compiler detection in public headers")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
f5bf8249d5 fib: fix missing header includes
Add stdint.h to get definitions of standard integer types

Fixes: 39e9272484 ("fib: add FIB library")
Fixes: 40d41a8a7b ("fib: support IPv6")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
071b9b78c4 ipsec: fix missing header include
The rte_ipsec_sad.h header used the standard uintXX_t types, but did not
include stdint.h header for them.

Fixes: 401633d9c1 ("ipsec: add inbound SAD API")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
820778fad6 vhost: fix missing header includes
The vhost header files were missing definitions from headers to allow
them to be compiled up individually.

Fixes: d7280c9fff ("vhost: support selective datapath")
Fixes: a49f758d11 ("vhost: split vDPA header file")
Fixes: 939066d965 ("vhost/crypto: add public function implementation")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
585617c320 rib: fix missing header includes
The standard integer types, and the size_t types are missing their
required header includes in the rib header file.

Fixes: 5a5793a5ff ("rib: add RIB library")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Bruce Richardson
29a3ec7f0e bitrate: fix missing header include
The rte_compat.h header file must be included to get the definition of
__rte_experimental.

Fixes: f030bff72f ("bitrate: add free function")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:44 +01:00
Bruce Richardson
b7c0591fd6 mbuf: fix missing header include
The rte_mbuf_dyn.h header file uses a number of types and macros without
including the required header files to get the definitions of those
macros/types.  Similarly, the rte_mbuf_core.h file was missing an
include for rte_byteorder.h header.

Fixes: 4958ca3a44 ("mbuf: support dynamic fields and flags")
Fixes: 3eb860b08e ("mbuf: move definitions into a separate file")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Bruce Richardson
a6bf1fd817 net: fix missing header include
The Geneve protocol header file is missing the rte_byteorder.h header.

Fixes: ea0e711b8a ("app/testpmd: add GENEVE parsing")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ophir Munk <ophirmu@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Bruce Richardson
ebbd4d33d7 ethdev: fix missing header include
The define for RTE_ETH_FLOW_MAX is defined in rte_ethdev.h, so that
header should be included in rte_eth_ctrl.h to allow it to be compiled
independently.

Fixes: 7fa96d696f ("ethdev: unification of flow types")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Bruce Richardson
354e43b1aa telemetry: fix missing header include
The telemetry header file uses the rte_cpuset_t type, but does not
include any header providing that type. Include rte_os.h to provide the
necessary type.

Fixes: febbebf7f2 ("telemetry: keep threads separate from data plane")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Bruce Richardson
8fc617099e eal: fix reciprocal header include
The rte_reciprocal header file used standard __rte_always_inline from
rte_common.h but does not include that header file, leading to compiler
errors when the reciprocal header is included alone.

Fixes: 6d45659eac ("eal: add u64-bit variant for reciprocal divide")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Bruce Richardson
2b403e027b eal: fix thread header include
rte_thread.h was missing the compat header to get the __rte_experimental
macro definition.

Fixes: b1fd151267 ("eal: add generic thread-local-storage functions")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:21:40 +01:00
Thomas Monjalon
4080917cbc version: 21.02-rc1
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-20 02:58:16 +01:00
Bruce Richardson
08895f10e7 build: provide suitable error for "both" libraries option
Rather than having the DPDK configuration error out when linking apps
and examples when "both" is select for "default_library" option, we can
detect that setting earlier in the build config and provide a suitable
error message to the user.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-20 02:03:08 +01:00
Bruce Richardson
762bfccc8a config: remove compatibility build defines
As announced in the deprecation note, remove all compatibility build
defines from previous make/meson versions and use only the standardized
ones - RTE_LIB_<name> for libraries, and RTE_<CLASS>_<NAME> for drivers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-20 01:43:25 +01:00
Jeff Guo
d559d2048e net/ice: fix flow rule checking
Add empty item into the pattern mapping list when checking the ptype is
supported or not, since we do support the NUll pattern for rte flow in
ice pmd.

Fixes: 68b6240ee9 ("net/ice: refactor packet type parsing")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-01-19 18:30:00 +01:00
Beilei Xing
9baf3ecf52 doc: add known issue with RSS in ixgbe guide
Currently, IXGBE doesn't support RSS when double VLAN
is enabled due to FW limitation.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2021-01-19 18:30:00 +01:00
Alvin Zhang
15cfb0bfc4 net/ixgbe: fix configuration of max frame size
For some types of NIC, jumbo frame is not supported in IOV mode,
so if a VF requests to configure the frame size to not bigger
than IXGBE_ETH_MAX_LEN, the kernel driver returns 0, but the DPDK
ixgbe PMD returns -1, this will cause the VF to fail to start
when the PF driven by DPDK ixgbe PMD.

This patch keeps ixgbe PMD's handling mode consistent with kernel
driver in above situation.

In addition, the value set by the command IXGBE_VF_SET_LPE
represents the max frame size, not the mtu.

Fixes: 1b9ea09c06 ("ixgbe: support X550")
Fixes: 95a27b3ba5 ("net/ixgbe: enable jumbo frame for VF")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
2021-01-19 13:49:41 +01:00
Haiyue Wang
c7e1a1a3bf net/ice: refactor DCF VLAN handling
Since DCF always configure the outer VLAN offloads for the target AVF,
so rename the related variables to align with this design.

Also, the DCF needs to trace the AVF reset status to re-apply the VLAN
offload setting, refactor the reset event handling to support this.

Change the VF representor API 'ethdev' parameter to 'vf_rep_eth_dev' to
avoid introducing confusion with VF representor eth_dev ops name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-01-19 13:49:41 +01:00
Alvin Zhang
52a6478257 net/i40e: fix out of scope variable
Using "key", which points to an out-of-scope variable "rss_key_default".

Coverity issue: 365293
Fixes: ef4c16fd91 ("net/i40e: refactor RSS flow")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-01-19 13:49:41 +01:00
Xuan Ding
a8f630fa06 net/iavf: workaround RSS cleanup failure handling
Allow to ignore error returned from virtual channel command
 VIRTCHNL_OP_SET_RSS_HENA with hena = 0 due to some legacy
kernel driver does not support this. Add warning message when
this happen.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-01-19 13:49:41 +01:00
Junfeng Guo
bb3386f348 net/ice: enable QinQ filter for switch
Enable the double VLAN support for switch QinQ filtering.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-01-19 13:49:41 +01:00
Jiawei Wang
bd49d1d343 net/mlx5: handle RSS action in sample
PMD validates the rss action in the sample sub-actions list,
then translates into rdma-core action and it will be used for sample
path destination.

If the RSS action is in both sample sub-actions list and original flow,
the rss level and rss type in the sample sub-actions list should be
consistent with the original flow list, since the expanding items
for RSS should be the same for both actions.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-01-19 13:49:41 +01:00
Jiawei Wang
6c2a3a9049 net/mlx5: fix unnecessary checking for RSS action
RSS action is valid only in NIC-RX domain, this fix bypass
the function that getting RSS action from the flow action list
under no NIC-RX domain.

Fixes: e745f90007 ("net/mlx5: optimize flow RSS struct")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-01-19 03:30:32 +01:00
Jiawei Wang
11b1b0edda app/testpmd: support RSS in sample action
Support rss action in the sample sub-actions list.

The examples for the sample flow use case and result as below:
set sample_actions 0 mark id  0x12 / rss queues  0 1 2 3 end  / end
flow create 0 ingress group 1 pattern eth / end actions
sample ratio 1 index 0 / jump group 2 / end

This flow will result in all the matched ingress packets will be
jumped to next table, and the each packet will be marked with 0x12
and duplicated to rss queues of the control application.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-01-19 03:30:32 +01:00
Ivan Malov
f80487b9c7 common/sfc_efx/base: apply mask to value on match field set
An application may submit all-zeros masks for a given field
to be used in two given specifications and, in the meantime,
use different unmasked values. Later on, when compared, the
two specifications will prove unequal, and, if the rules in
question are outer, the client driver will have to allocate
a separate rule for the second specification. Provided that
all other match criteria are the same, the HW will deem the
two outer rules being duplicates, which is in fact the case.

Apply masks to values in efx_mae_match_spec_field_set() API
to fix the issue and avoid duplicate outer rule allocations.

Fixes: 370ed675a9 ("common/sfc_efx/base: support setting PPORT in match spec")
Cc: stable@dpdk.org

Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-01-19 03:30:32 +01:00
Alexander Kozyrev
24e1a5e39d app/testpmd: support modify field flow action
Add support for the RTE_FLOW_ACTION_MODIFY_FIELD to the testpmd.
Implement CLI to create the modify_field action and supply all the
needed parameters to modify an arbitrary packet field (as well as
mark, tag or metadata) with data from another field or immediate
value.

Example of the flow is the following:
flow create 0 egress group 1 pattern eth / ipv4 / udp / end
  actions modify_field op set dst_type tag dst_level 2 dst_offset 8
          src_type gtp_teid src_level 0 src_offset 0 width 16 / end

This flow copies 16 bits from the second Tag in the Tags array
into the outermost GTP TEID packet header field. 8 bits of the
Tag are skipped as indicated by the dst_offset action parameter.

op, dst_type, src_type and width are the mandatory parameters to
specify. Levels and offset are 0 by default if they are not
overridden by a user. The operation can be set, add or sub.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-01-19 03:30:32 +01:00
Alexander Kozyrev
73b68f4c54 ethdev: introduce generic modify flow action
Implement the generic modify flow API to allow manipulations on
an arbitrary header field (as well as mark, metadata or tag) using
data from another field or a user-specified value.
This generic modify mechanism removes the necessity to implement
a separate RTE Flow action every time we need to modify a new packet
field in the future.

Supported operation are:
- set: copy data from source to destination.
- add: integer addition, stores the result in destination.
- sub: integer subtraction, stores the result in destination.

The field ID is used to specify the desired source/destination packet
field in order to simplify the API for various encapsulation models.
Specifying the packet field ID with the needed encapsulation level
is able to quickly get a packet field for any inner packet header.

Alternatively, the special ID (ITEM_START) can be used to point to
the very beginning of a packet. This ID in conjunction with the
offset parameter provides great flexibility to copy/modify any part of
a packet as needed.

The number of bits to use from a source as well as the offset can be
be specified to allow a partial copy or dividing a big packet field
into multiple small fields (e.g. copying 128 bits of IPv6 to 4 tags).

An immediate value (or a pointer to it) can be specified instead of the
level and the offset for the special FIELD_VALUE ID (or FIELD_POINTER).
Can be used as a source only.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-01-19 03:30:32 +01:00
Lijun Ou
230ca39295 net/hns3: remove unused assignment for RSS key
The default RSS key does not need to be configured repeatedly
when call hns3_dev_configure function with the NULL RSS key
because the default RSS key has been configured when the PMD
driver run hns3_do_start function with starting device.

Besides, it will not overwrite the initialized key if
rte_eth_dev_configure API will be called directly and RSS key is NULL
after init PMD driver.

Therefore, the assignment for RSS key in hns3_dev_configure
function is unnecessary.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-01-19 03:30:32 +01:00
Chengchang Tang
acb3260fac net/hns3: fix dump register out of range
Currently, when dump the queue interrupt registers, the number of
registers that should be dumped is calculated from num_msi. But the
value of num_msi includes the number of misc interrupts. So, for some
hardware version, like kupeng930, it will lead to an illegal access.

This patch replace num_msi with intr_tqps_num which indicate the
number of interrupts used by the tqps.

Fixes: 936eda25e8 ("net/hns3: support dump register")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-01-19 03:30:32 +01:00
Chengchang Tang
6da903befa net/hns3: fix data overwriting during register dump
The data pointer has not moved after BAR register dumped. This causes
the later register to overwrite the previous data.

This patch fix the overwriting by move the pointer after every dump
function. And the missing separator between 32-bit register and the
64-bit register is also added to avoid a parsing error.

Fixes: 936eda25e8 ("net/hns3: support dump register")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-01-19 03:30:32 +01:00
Chengchang Tang
2d0467532b net/hns3: fix register length when dumping registers
Currently, the reg length return by HNS3 is the total length of all the
registers. But for upper layer user, the total register length is the
length multiplied by width. This can lead to a waste of memory and print
some invalid information.

This patch corrects the length and width of the register.

Fixes: 936eda25e8 ("net/hns3: support dump register")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-01-19 03:30:32 +01:00
Hongbo Zheng
e5d179078b net/hns3: use new opcode for clearing hardware resource
The original command opcode '0x700A' may cause firmware error,
so '0x700A' is deserted, now use '0x700B' to replace it.

Fixes: 223d9eceae ("net/hns3: clear residual hardware configurations on init")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2021-01-19 03:30:32 +01:00