Commit Graph

11185 Commits

Author SHA1 Message Date
Stephen Hemminger
db27370b57 eal: replace blacklist/whitelist options
Replace -w / --pci-whitelist with -a / --allow options
and --pci-blacklist with --block.
The -b short option remains unchanged.

Allow the old options for now, but print a nag
warning since old options are deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-11-16 00:11:22 +01:00
Stephen Hemminger
a65a34a85e eal: replace usage of blacklist/whitelist in enums
Rename the enum values in the EAL include files.
As a backward compatible temporary migration tool, define
a replacement mapping for old values.

The old names relating to blacklist and whitelist are replaced
by block list and allow list, but applications may be using the
older compatibility macros, marked as deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-11-16 00:11:22 +01:00
Michael Baum
2a87415cc9 net/mlx5/linux: fix probing adjustment depending on DevX
Bonding adjustment is done only when DEVX_PORT is supported in the
rdma-core.

Some bonding condition was done even when DEVX_PORT is not supported.

Remove it.

Fixes: 2eb4d0107a ("net/mlx5: refactor PCI probing on Linux")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-14 01:36:19 +01:00
Michael Baum
436973b0d1 net/mlx5: fix leak on ASO age pools resize failure
In ASO age pools resize, the PMD starts ASO data-path.

When starting ASO data-path is failed, the pools memory was not freed
what caused a memory leak.

Free it.

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

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-14 01:36:19 +01:00
Michael Baum
41217cec2f net/mlx5: fix leak on Rx queue creation failure
In Rx queue creation, there is a validation for the Rx configuration.

When scatter offload validation for buffer split is failed, the Rx queue
object memory was not freed what caused a memory leak.

Free it.

Fixes: a0a45e8af7 ("net/mlx5: configure Rx queue for buffer split")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-14 01:36:19 +01:00
Michael Baum
8b3799531b net/mlx5: remove unused calculation in RSS expansion
The RSS flow expansion get a memory buffer to fill the new patterns of
the expanded flows.
This memory management saves the next address to write into the buffer
in a dedicated variable.

The calculation for the next address was wrongly also done when all the
patterns were ready.

Remove it.

Fixes: 4ed05fcd44 ("ethdev: add flow API to expand RSS flows")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-14 01:36:19 +01:00
Xueming Li
0064bf4318 net/mlx5: fix nested flow creation
If xmedata mode 1 enabled and create a flow with RSS and mark action,
there was an error that rdma-core failed to create RQT due to wrong
queue definition. This was due to mixed flow creation in thread specific
flow workspace.

This patch introduces nested flow workspace(context data), each flow
uses dedicate flow workspace, pop and restore workspace when nested flow
creation done, the original flow with continue with original flow
workspace. The total number of thread specific flow workspace should be
2 due to only one nested flow creation scenario so far.

Fixes: 8bb81f2649 ("net/mlx5: use thread specific flow workspace")
Fixes: 3ac3d8234b ("net/mlx5: fix index when creating flow")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 23:36:14 +01:00
Xueming Li
733bbf518f net/mlx5: fix Unix socket path
mlx_steering_dump_parser.py tool failed to dump flow due to socket file
name changed.

Change socket file name back to make it consistent.

Fixes: e4b7b8d082 ("common/mlx5: fix PCI driver name")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 23:36:14 +01:00
Suanming Mou
0080b100dd net/mlx5: fix detection of counter offset support
Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and jump action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.

However, jump action may not be supported in some rdma-core version.
In this case, the discover code will not work properly.

This commits changes the jump action to generic drop action. That
makes the discover code to be more compatible.

Fixes: 994829e695 ("net/mlx5: remove single counter container")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 23:36:14 +01:00
Bing Zhao
0746dcabfd net/mlx5: fix hairpin unbind
In the implementation of mlx5_hairpin_unbind, a copy-paste error was
inside. If a single peer Rx port needed to be unbound, it would be
bound again by mistake.

All the hardware resources were released when stopping the device and
no mess of the configuration was introduced. But when trying to unbind
the ports again, the issue would appear.

The typo of the function call is fixed. If there is no hairpin queue
bound between two ports, the unbinding process should be considered
successful.

Fixes: 37cd4501e8 ("net/mlx5: support two ports hairpin mode")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 23:36:14 +01:00
Xiaoyu Min
6f921f61d4 net/mlx5: validate MPLSoGRE with GRE key
Currently PMD only accept flow which item_mpls directly follow item_gre,
means to match the GRE header without GRE optional field key in MPLSoGRE
encapsulation.

However, for the MPLSoGRE, the GRE header could have the optional field
(i.e, key) according to the RFC. So PMD need to accept this.

Add MLX5_FLOW_LAYER_GRE_KEY into allowed prev_layer to fix

Fixes: a7a0365565 ("net/mlx5: match GRE key and present bits")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 23:36:14 +01:00
Bing Zhao
1d1f909cf5 net/mlx5: fix check of eCPRI previous layer
Based on the specification, eCPRI can only follow ETH (VLAN) layer
or UDP layer. When creating a flow with eCPRI item, this should be
checked and invalid layout of the layers should be rejected.

Fixes: c7eca23657 ("net/mlx5: add flow validation of eCPRI header")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 23:36:14 +01:00
Alexander Kozyrev
70a3ee6bb7 net/mlx5: fix Rx descriptors info for MPRQ
The number of descriptors configured is returned to a user
via the rxq_info_get API. This number is incorrect for MPRQ.
For SPRQ this number matches the number of mbufs allocated.
For MPRQ we have fewer external MPRQ buffers that can hold
multiple packets in strides of this big buffer. Take that
into account and return the number of MPRQ buffers multiplied
by the number of strides in this case.

Fixes: 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 23:36:14 +01:00
Alexander Kozyrev
5c68764377 net/mlx5: improve vectorized MPRQ descriptors locality
There is a performance penalty for the replenish scheme
used in vectorized Rx burst for both MPRQ and SPRQ.
Mbuf elements are being filled at the end of the mbufs
array and being replenished at the beginning. That leads
to an increase in cache misses and the performance drop.
The more Rx descriptors are used the worse the situation.

Change the allocation scheme for vectorized MPRQ Rx burst:
allocate new mbufs only when consumed mbufs are almost
depleted (always have one burst gap between allocated and
consumed indices). Keeping a small number of mbufs allocated
improves cache locality and improves performance a lot.

Unfortunately, this approach cannot be applied to SPRQ Rx
burst routine. In MPRQ Rx burst we simply copy packets from
external MPRQ buffers or attach these buffers to mbufs.
In SPRQ Rx burst we allow the NIC to fill mbufs for us.
Hence keeping a small number of allocated mbufs will limit
NIC ability to fill as many buffers as possible. This fact
offsets the advantage of better cache locality.

Fixes: 0f20acbf5e ("net/mlx5: implement vectorized MPRQ burst")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 23:36:14 +01:00
Lance Richardson
d1816ceae5 net/bnxt: fix doorbell barrier location
Simplify some doorbell functions now that rte_cio_wmb() has been
eliminated and rte_io_wmb() is equivalent for Arm.

Fix a performance degradation on x86 platforms caused by a
previous Arm performance fix by moving the compiler barrier
closer to the I/O write.

Fixes: f0f5d844d1 ("eal: remove deprecated coherent IO memory barriers")
Fixes: bfc1d45875 ("net/bnxt: fix performance for Arm")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-11-13 19:43:27 +01:00
Olivier Matz
28b987c442 net/pcap: fix registration of timestamp dynamic field
In pcap pmd, the timestamp mbuf dynamic field is mandatory. When the
pcap pmd is created in a secondary process (this is the case for pdump),
it cannot be registered because this is not allowed from a secondary
process.

To ensure that the field is properly registered, do it from probe()
instead of configure(). Indeed, probe() is first invoked on the primary
process when a device is created in a secondary, this enables
registering dynfield from secondary process.

Bugzilla ID: 571
Fixes: d23d73d088 ("net/pcap: switch Rx timestamp to dynamic mbuf field")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 19:43:27 +01:00
Michael Pfeiffer
8aab74c0b9 net/tap: allow all-zero checksum for UDP over IPv4
Unlike TCP, UDP checksums are optional and may be zero to indicate "not
set" [RFC 768] (except for IPv6, where this prohibited [RFC 8200]). Add
this special case to the checksum offload emulation in net/tap.

Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 19:43:27 +01:00
Steve Yang
7dd0d9f29f net/iavf: fix RSS when VF port closed
Check the VF RSS offload flag and ignore relative operation when
iavf hash uninit to avoid reset/close error.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Alvin Zhang
84f5a69bba net/ice: support flow mark ID in AVX512
Support flow director mark ID parsing from flexible Rx descriptor
in avx512 path.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Qin Sun <qinx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Haiyue Wang
5db5d3b72e net/ixgbe: remove redundant MAC flag check
The flag of RTE_ETHTYPE_FLAGS_MAC has been checked twice, so remove the
first error message "Not supported by ethertype filter" which is not so
specific, and keep the error message "mac compare is unsupported" which
aligns to the definition of RTE_ETHTYPE_FLAGS_MAC.

Fixes: eb3539fc85 ("net/ixgbe: parse ethertype filter")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Mike Baucom
fcf681890a net/bnxt: fix assignment instead of comparison
Use comparison operator instead of incorrectly using the assignment
operator.

Coverity issue: 363566, 36357
Fixes: 42c40f8902 ("net/bnxt: consolidate template table processing")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-11-13 19:43:26 +01:00
Conor Walsh
f8b41a8e37 net/txgbe: fix build by simplifying xstats return
When DPDK is compiled with gcc 7.5 with the optimization level set to 1
gcc sees the 'offset' variable in txgbe_ethdev.c as possibly being
uninitialised.
The 'txgbe_get_offset_by_id()' return value, "-(int)(id + 1)", seems
confusing gcc that it assumes '0' can be returned in the failure case.
To correct this the return statement for error case in
'txgbe_get_offset_by_id()' is simplified to return '-1'.

Fixes: 91fe49c87d ("net/txgbe: support device xstats")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 19:43:26 +01:00
Guoyang Zhou
cb99500de9 net/hinic/base: add message check for command channel
In the command channel, a message may has several fragments,
and the several fragments should have same message id. To
prevent problems, this check is added.

Fixes: 1e4593db1d ("net/hinic/base: fix log info for PF command channel")
Cc: stable@dpdk.org

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
2020-11-13 19:43:26 +01:00
Leyi Rong
63b7be7870 net/iavf: fix performance drop after port reset
Needs to reset rxq->rxrearm_start to 0 when reset_rx_queue(),
otherwise, the random value of rxrearm_start will cause performance drop
due to L3 contested accesses.

Fixes: 69dd4c3d08 ("net/avf: enable queue and device")
Cc: stable@dpdk.org

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Simei Su
d827f610d3 net/ice: fix perfect match for ACL rule
A rule with an imperfect match (wildcarding) will be routed through
ACL. A perfect match should be rejected by ACL.

Fixes: 40d466fa9f ("net/ice: support ACL filter in DCF")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Ferruh Yigit
470b5c23ad net/af_xdp: fix pointer storage size
'uint64_t' is used to hold the pointer, for 32-bits build this
assumption is wrong and giving following build error:

rte_eth_af_xdp.c: In function ‘xdp_umem_configure’:
rte_eth_af_xdp.c:970:15:
    error: cast to pointer from integer of different size
           [-Werror=int-to-pointer-cast]
  970 |   base_addr = (void *)get_base_addr(mb_pool, &align);
      |               ^

Replacing the 'uint64_t' return type of the 'get_base_addr()' to the
'uintptr_t'.
Although not sure if the overall logic supports the 32-bits, using
'uintptr_t' should be safe both for 64/32 bits.

Fixes: d8a210774e ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
2020-11-13 19:43:26 +01:00
Suanming Mou
fabf8a3724 net/mlx5: fix shared RSS action release
As shared RSS action will be shared by multiple flows, the action
is created as global standalone action and managed only by the
relevant shared action management functions.

Currently, hrxqs will be created by shared RSS action or general
queue action. For hrxqs created by shared RSS action, they should
also only be released with shared RSS action. It's not correct to
release the shared RSS action hrxqs as general queue actions do
in flow destroy.

This commit adds a new fate action type for shared RSS action to
handle the shared RSS action hrxq release correctly.

Fixes: e1592b6c4d ("net/mlx5: make Rx queue thread safe")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 19:43:26 +01:00
Xueming Li
c3ba8ecb76 net/mlx5: fix missing meter packet
For transfer flow with meter, packet was passed without applying flow
action. The group level was multiplied by 10 for group level 65531.

This patch fixes this issue by correcting suffix table group level
calculation.

Fixes: 3e8f3e51fd ("net/mlx5: fix meter table definitions")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 19:43:26 +01:00
Ting Xu
ddd63c387e net/iavf: check RSS rule queue region size
When a rule is set to do RSS to redirect flows to a group of queues, the
queue region size should not be larger than the max RSS queue region
supported by HW. This patch added the step to check the queue region
size, and report failure if the size does not meet the requirement.

Fixes: e436cd4383 ("net/iavf: negotiate large VF and request more queues")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Ting Xu
36b8b06288 net/iavf: fix releasing mbufs
In the function _iavf_rx_queue_release_mbufs_vec to release rx mbufs,
rxq->rxrearm_nb is given the value of rx descriptor number at last.
However, since the process to release and allocate mbufs lacks the
initialization of rxrearm_nb, if we try to release mbufs next time, it
will return without releasing directly. In this patch, rxrearm_nb is
initialized to be zero in rx queue reset.

Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2020-11-13 19:43:26 +01:00
Ferruh Yigit
c2f4dc6d60 net/i40e: fix build for log format specifier
Build error:
i40e_common.c: In function "i40e_parse_discover_capabilities":
../drivers/net/i40e/base/../i40e_logs.h:43:50:
    error: format "%llX" expects argument of type "long long unsigned
           int", but argument 7 has type "u64" {aka "long unsigned int"
           [-Werror=format=]
   43 |  rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
      |                                                  ^~~~~~~~
.../i40e_osdep.h:87:3: note: in expansion of macro "PMD_DRV_LOG_RAW"
   87 |   PMD_DRV_LOG_RAW(DEBUG, "i40e %02x.%x " s,       \
      |   ^~~~~~~~~~~~~~~
.../base/i40e_common.c:4100:4: note: in expansion of macro "i40e_debug"
 4100 |    i40e_debug(hw, I40E_DEBUG_INIT,
      |    ^~~~~~~~~~

There are multiple build error because of same reason, all fixed.

Using 'PRIX64' to fix the build error.

Fixes: 889bc9f0cd ("i40e/base: unify the capability function")
Fixes: 9b1041574c ("i40e/base: enhance polling of NVM semaphore")
Fixes: 8db9e2a1b2 ("i40e: base driver")
Fixes: 3b7271f395 ("i40e/base: catch NVM write semaphore timeout and retry")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2020-11-13 19:43:26 +01:00
Junfeng Guo
4a38856458 net/ice: fix some RSS hash fields
Previous code in ice_rss_hash_set has mismatched hash fields and
headers for UDP and TCP.

Fixes: 16187528a9 ("net/ice/base: refactor RSS configure API")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Prateek Agarwal
876589e07e net/i40e: add C++ include guard
Add extern "C" in rte_pmd_i40e.h when be compiled with CPP.

Fixes: 17e906a1ea ("net/i40e: support link status notification")
Cc: stable@dpdk.org

Signed-off-by: Prateek Agarwal <prateekag@cse.iitb.ac.in>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Wenzhuo Lu
9c70bbd88c net/iavf: check cache pointer before dereference
The return value of rte_mempool_default_cache should be
checked as it can be NULL.

Fixes: 9ab9514c15 ("net/iavf: enable AVX512 for Tx")

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-11-13 19:43:26 +01:00
Wenzhuo Lu
4e61f1ac80 net/ice: check cache pointer before dereference
The return value of rte_mempool_default_cache should be
checked as it can be NULL.

Fixes: a4e480de26 ("net/ice: optimize Tx by using AVX512")

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-11-13 19:43:26 +01:00
Chenxu Di
fe5d0e85b7 net/i40e: fix flow director flex configuration
The configuration of FDIR flex mask and flex pit should not be set
during flow validate. It should be set when flow create.

Fixes: 6ced3dd72f ("net/i40e: support flexible payload parsing for FDIR")
Cc: stable@dpdk.org

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
2020-11-13 19:43:26 +01:00
Simei Su
333e1bde9d net/ice: fix crash when device reset
When device resets, it should not implement ACL initialization
which is only executed in DCF. This patch disable ACL init and
uninit when in DPDK PF only mode.

Fixes: 40d466fa9f ("net/ice: support ACL filter in DCF")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Jeff Guo
22e294e0e6 net/iavf: fix RXDID configure
When configure Rx queue by virtchnnl, the RXDID (Rx Descriptor ID)
should be configured only if the Rx queue has been set up.

Fixes: 12b435bf8f ("net/iavf: support flex desc metadata extraction")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-11-13 19:43:26 +01:00
Hongbo Zheng
37f54f3c5c net/hns3: use unsigned types for bit operator
According to bit operator reliability style, variables in
the right expression participating int bit operation
must be an unsigned type.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-13 19:43:26 +01:00
Lijun Ou
ee1607167b net/hns3: remove some blank lines
According to the rule of the static check tools
that arrange blank lines properly to keep the
code compact, here remove some unnecessary blank
line to fix the above rule warning.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-13 19:43:26 +01:00
Chengchang Tang
80ec1bbd5b net/hns3: fix queue state after reset
FLR operation will reset the queue enabling state and
the driver needs to restore the state after reset.
If the driver does not restore the state, it will result
in unpredictable behavior with reset when user start or
stop queue by calling the relevant function if.

This patch fix it by add a queue enabling state restore
function to the reset handler.

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-13 19:43:26 +01:00
Lijun Ou
6dd32ded17 net/hns3: check PCI config space write
Here adds a check for the return value when calling
rte_pci_write_config.

Coverity issue: 363714
Fixes: cea37e5133 ("net/hns3: fix FLR reset")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-13 19:43:26 +01:00
Hongbo Zheng
d3d3132436 net/hns3: adjust code style for struct initialization
According to the rule of the used static check tool,
each member is initialized on a separate lines when
struct and union members are initialized, here is
tempting to adjust some code lines in order to remove
the warning.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-13 19:43:25 +01:00
Hongbo Zheng
2427c27e03 net/hns3: use correct logging format specifiers
In current driver print log function, some print format
symbols does not match with the actual variable types.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
2020-11-13 19:43:25 +01:00
Ivan Malov
380f355228 net/sfc: use more robust string comparison
When it comes to comparing HW switch ID strings,
use strncmp to avoid reading past the buffer.

Fixes: e86b48aa46 ("net/sfc: add HW switch ID helpers")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2020-11-13 19:43:25 +01:00
Jiawen Wu
ee5cd91532 net/txgbe: remove direct use of compiler attribute
Remove direct use of compiler attribute.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 19:43:25 +01:00
Viacheslav Ovsiienko
27b095072b net/mlx5: fix Tx queue completion on stop
The Tx queue completion production index was not reset
on Tx queue stop and there were completions remaining
from the previous queue run. This caused the wrong
completion queue operating and overall Tx queue malfunction
on queue restart.

Fixes: 161d103b23 ("net/mlx5: add queue start and stop")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 19:43:25 +01:00
Viacheslav Ovsiienko
70d83ebbbb net/mlx5: fix Rx queue completion index consistency
The Rx queue completion consumer index got temporary
wrong value pointing to the midst of the compressed CQE
session. If application crashed at the moment the next
queue restart caused handling wrong CQEs pointed by index
and losing consuming index synchronization, that made
reliable queue restart impossible.

Fixes: 88c0733535 ("net/mlx5: extend Rx completion with error handling")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 19:43:25 +01:00
Suanming Mou
3770feb827 net/mlx5: fix hash list entry assert
The entry variable assert in the mlx5_hlist_register() function is not
correct. Remove the invalid entry variable.

Fixes: e69a59227d ("net/mlx5: support concurrent access for hash list")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 19:43:25 +01:00
Dekel Peled
58df16e08c net/mlx5: fix use of local array for global error
Recent patch uses a local string array as input for function
rte_flow_error_set().
This stack memory may be later used by other code sections,
overwriting the desired error string.

This patch implements an error string for the specific case
requested, of ICMP item not supported in Verbs flow engine.

Fixes: d51475d1bf ("net/mlx5: support item type error message in flow Verbs")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 19:43:25 +01:00