Commit Graph

26005 Commits

Author SHA1 Message Date
Shougang Wang
55384497fe doc: update firmware/driver mapping table for i40e
Update i40e PMD firmware/driver mapping table.

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@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
Matan Azrad
de956d5ecf app/testpmd: support age shared action context
When an age action becomes aged-out the next call for
rte_flow_get_aged_flows API should return the action context supplied
by the action configuration structure.

In case the age action is created by the shared action API, the shared
action context of the Testpmd application was not set.

In addition, the application handler of the contexts returned by the
rte_flow_get_aged_flows API didn't consider the fact that the action
could be set by the shared action API and considered it as regular flow
context.

This caused a crash in Testpmd when the context is parsed.

This patch set context type in the flow and shared action context and
uses it to parse the aged-out contexts correctly.

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Dekel Peled <dekelp@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@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
Ting Xu
7a483d58db doc: add large iavf support to release notes
Update release note for large VF, supporting up to 256 queue pairs per
VF.

Fixes: e436cd4383 ("net/iavf: negotiate large VF and request more queues")

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
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
Ivan Malov
df78fe717e common/sfc_efx/base: improve MCDI version/boot clarity
Improve the clarity of the code.

Fixes: 833cfcd590 ("common/sfc_efx/base: add API for querying board info")
Fixes: 312191e86e ("common/sfc_efx/base: refactor version / boot info get helper")

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
Maxime Coquelin
7804bbd13a vhost: fix virtqueue initialization
This patches fixes virtqueue initialization issue causing
segfault or file descriptor being closed unexpectedly.

The wrong index was passed to init_vring_queue() by
alloc_vring_queue() when a hole in the virtqueue array was
met.

Fixes: 8acd7c2133 ("vhost: fix virtqueues metadata allocation")
Cc: stable@dpdk.org

Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
2020-11-13 19:43:25 +01:00
Patrick Fu
45ba914134 vhost: fix async inflight packet counter
Async inflight packet counter should take failed packets into account.
Failed packets will be deducted in the error handling logic.

Fixes: 6b3c81db8b ("vhost: simplify async copy completion")
Fixes: cd6760da10 ("vhost: introduce async enqueue for split ring")
Cc: stable@dpdk.org

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-13 19:43:25 +01:00
Ibtisam Tariq
854dbee2ac examples/vhost_crypto: add new line character in usage
Add new line character(\n) in the usage of vhost_crypto example for
better readability

Fixes: 709521f4c2 ("examples/vhost_crypto: support multi-core")
Cc: stable@dpdk.org

Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.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
Jiawei Wang
9ade91dfe8 net/mlx5: fix group value of sample suffix flow
mlx5 PMD split the sampling flow into prefix flow and suffix
flow. On the sample action translation function, the scaled
group value of suffix flow be attached into sample object and
saved into sample resource.

mlx5 PMD fetched the group value from the sample resource to
create the suffix flow. On the mlx5_flow_group_to_table
function the group value of suffix flow was scaled with table
factor again and translated into HW table. That caused the
incorrect group value of sample suffix flow.

The fix introduces a 'skip_scale' flag and sets it to 1 for the
sample suffix flow creation. On the mlx5_flow_group_to_table
function skips the scale with table factor to use the correct
group value.

Fixes: 4ec6360de3 ("net/mlx5: implement tunnel offload")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 19:43:25 +01:00
Dong Zhou
cdbdcd46a2 net/mlx5: fix switch port id when representor in bonding
In the bonding configurations the port switch id for representors was
composed of pf index in bonding as the 1 MSB and the representor's index
as the remaining 15 LSBs. The special corner case for the host PF
representor on BF setups with representor id 0xFFFF was missed as well.

The new switch port id consists of 4 MSBs for the pf bonding index and
the remaining 12 LSBs for the representor index. The switch port id
ranges for each type of representors are as follows:

Uplink representor(AKA master): 0xFFFF
Host PF representor: 0x<pf_bond>FFF
VF representor: 0x<pf_bond>[0-FFE]

Fixes: bee57a0a35 ("net/mlx5: update switch port id in bonding configuration")
Cc: stable@dpdk.org

Signed-off-by: Dong Zhou <dongzhou@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 19:42:40 +01:00
Dekel Peled
105d214965 net/mlx5: fix aging queue doorbell ringing
Recent patch introduced a new SQ for ASO flow hit management.
This SQ uses two WQEBB's for each WQE.
The SQ producer index is 16 bits wide.

The enqueue loop posts new WQEs to the ASO SQ, using WQE index for
the SQ management.
This 16 bits index multiplied by 2 was wrongly used also for SQ
doorbell ringing.
The multiplication caused the SW index overlapping to be out of sync
with the hardware index, causing it to get stuck.

This patch separates the WQE index management from the doorbell index
management.
So, for each WQE index incrementation by 1, the doorbell index is
incremented by 2.

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-13 16:26:54 +01:00
Bing Zhao
ebda282cbb net/mlx5: fix eCPRI common header endianness
The input header of a RTE flow item is with network byte order. In
the host with little endian, the bit field order are the same as the
byte order.
When checking the eCPRI message type, the wrong field will be selected.
Fixing to use correct field.

Fixes: daa38a8924 ("net/mlx5: add flow translation 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 16:26:54 +01:00
Wei Huang
e6dc14c800 raw/ifpga/base: check adapter pointer before dereference
In opae_adapter_destroy(), pointer "adapter" is not validated before
passing it to opae_adapter_shm_free() and opae_adapter_mutex_close()
which dereference it.

Coverity issue: 363752
Fixes: e41856b515 ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2020-11-13 16:26:54 +01:00
Wei Huang
2414339cee raw/ifpga/base: unlock mutex on Nios init failure
In fme_nios_spi_init(), a mutex is locked for protecting nios
initialization process, the mutex is only unlocked when process
is successful, it should also be unlocked when process fail.

Coverity issue: 363751
Fixes: e41856b515 ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2020-11-13 16:26:54 +01:00
Ivan Malov
e9d5c5fb68 common/sfc_efx/base: avoid reading past buffer
Existing field ID validity check does not validate the field
descriptor availability. Make it more rigorous to avoid
reading past the buffer containing field descriptors.

Coverity issue: 363742
Fixes: 370ed675a9 ("common/sfc_efx/base: support setting PPORT in match spec")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2020-11-13 16:26:54 +01:00
Olivier Matz
f1b9107465 net/ring: fix typo in log message
Add a missing space.

Fixes: 869bf6d222 ("net/ring: fix coding style")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 16:26:54 +01:00
Jiawen Wu
f2f55ea457 net/txgbe: replace forbidden functions
Remove rte_panic(), and use rte_atomic_thread_fence()
instead of rte_smp_[r/w]mb.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-11-13 16:26:54 +01:00
Matan Azrad
876b5d52a3 net/mlx5: fix Tx queue stop state
The Tx queue stop API doesn't call the PMD callback when the state of
the queue is stopped.
The drivers should update the state to be stopped when the queue stop
callback is done successfully or when the port is stopped.
The drivers should update the state to be started when the queue start
callback is done successfully or when the port is started.

The driver wrongly didn't update the state as started when the port
start callback was done which kept the state as stopped.
Following call to a queue stop API was not completed by ethdev layer
because the state is already stopped.

Move the state update from the Tx queue setup to the port start
callback.

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

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 16:26:54 +01:00
Matan Azrad
95940894f3 net/mlx5: fix Tx queue reference count check
The Txq refcnt 1 value means that there is no real reference to the
queue and only the control configurations are saved in the struct.

The patch below wrongly didn't consider it and caused a leak in the Txq
object resource.

Revert the specific update in the refcnt.

Fixes: b5c8b3e70c ("net/mlx5: use C11 atomics for RxQ/TxQ refcounts")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 16:26:54 +01:00
Jiawei Wang
992e6df3da common/mlx5: free MR resource on device DMA unmap
mlx5 PMD created the MR (Memory Region) resource on the
mlx5_dma_map call to make the memory available for DMA
operations. On the mlx5_dma_unmap call the MR resource
was not freed but inserted to MR Free list for further
garbage collection.
Actual MR resource destroying happened on device stop
call. That caused the runtime out of memory in case of
application performed multiple DMA map/unmap calls.

The fix immediately frees the MR resource on mlx5_dma_unmap
call not engaging the list. The export for mlx5_mr_free
function from common PMD part is added as well.

Fixes: 989e999d93 ("net/mlx5: support PCI device DMA map and unmap")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2020-11-13 16:26:54 +01:00
Tal Shnaiderman
8178d9be73 net/mlx5: fix SQ resources release in error flow
Fix in error flow in which the function
mlx5_txq_release_devx_sq_resources is called twice by setting the
release object to NULL after the first call

The incorrect flow was introduced in the work done on generic
object creation.

Once an error flow inside mlx5_txq_create_devx_sq_resources
occurs the function will call mlx5_txq_release_devx_sq_resources
however the released pointers are not set to NULL after the release
calls and undefined memory is released in the same call in
mlx5_txq_release_devx_resources.

This results in calls to MLX5_FREE with
an already released memory addresses and assert in mlx5_release_dbr:

EAL: Error: Invalid memory
EAL: Error: Invalid memory

PANIC in mlx5_txq_release_devx_sq_resources():
assert "(mlx5_release_dbr(&txq_obj->txq_ctrl->priv->dbrpgs,
 mlx5_os_get_umem_id (txq_obj->sq_dbrec_page->umem),
 txq_obj->sq_dbrec_offset)) == 0" failed

The fix is setting the released pointers to NULL after the first release
calls.

Fixes: 86d259cec8 ("net/mlx5: separate Tx queue object creations")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 16:26:54 +01:00
Ophir Munk
6c3dc9ebaa net/mlx5: fix Rx queue object allocation with MPRQ
The space for extra buffer pointers used by MPRQ routines was not
allocated in Rx queue object creation structure causing memory
corruption.
The fix allocates the extra memory for the pointers in case MPRQ is
engaged.

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

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2020-11-13 16:26:53 +01:00
Stephen Hemminger
1ef8c6290c net/bnxt: remove useless prefetches
Prefetching only helps performance if it is done several 100
instructions before the actual use. The purpose of the prefetch
is to read ahead, it doesn't help if the next instruction
will block.

The code in the bnxt driver was doing these unnecessary prefetches.

Fixes: 2eb53b134a ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-11-13 16:26:53 +01:00
Maxime Coquelin
048a2aa3f3 config: enable packet prefetching with Meson
With Make build system, RTE_PMD_PACKET_PREFETCH was enabled
by default. It got lost when transitioning to Meson build
system.

In order to avoid performance changes, this patch enables
packet prefetching in rte_config.h.

Fixes: 9314afb68a ("drivers: add infrastructure for meson build")
Cc: stable@dpdk.org

Reported-by: Marvin Liu <yong.liu@intel.com>
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-11-14 10:56:30 +01:00
Yi Yang
b605df71be gro: fix packet type detection with IPv6 tunnel
For VxLAN packets, GRO will mistakenly reassemble them
if inner L3 is IPv6, inner L4 is TCP or UDP, and outer L3
is IPv4 because the value of IS_IPV4_VXLAN_TCP4/UDP4_PKT
is true for them.

This fix makes sure IS_IPV4_TCP_PKT, IS_IPV4_UDP_PKT,
IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_VXLAN_UDP4_PKT can make
decision precisely.

Fixes: e2d8110636 ("gro: support VXLAN UDP/IPv4")
Fixes: 1ca5e67408 ("gro: support UDP/IPv4")
Fixes: 9e0b9d2ec0 ("gro: support VxLAN GRO")
Fixes: 0d2cbe59b7 ("lib/gro: support TCP/IPv4")
Cc: stable@dpdk.org

Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
2020-11-14 10:56:30 +01:00