Commit Graph

3963 Commits

Author SHA1 Message Date
Andrew Rybchenko
d8115cadb3 net/sfc/base: clarify meaning of Rx desc lbits in PS mode
There is no point to add mask plus one before mask applying since it
still does not help to avoid overflow on subtract. Modulo mask
arithmetic works perfectly for unsigned integers of the same type.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
11e993ce52 net/sfc/base: add description of the PS packets layout
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
3e3317f7f6 net/sfc/base: improve RxQ label init prototype
RxQ type provides more information which may be useful to
setup event queue appropriately.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
1f0769246e net/sfc/base: improve PS credits push function name
Make it clear from the name that it pushes doorbell.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Lee
f4891612e4 net/sfc/base: support MUM/SUC firmware partitions
Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
c14a991305 net/sfc/base: fix ignoring function return value
fix PreFAST issue, add missing annotation that function return value
should not be ignored. Fix alignment.

Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
e9d804ad26 net/sfc/base: quieten get version methods
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
e5fff4ee25 net/sfc/base: remove duplicate NVRAM asserts
The checking performed in the ->envo_type_to_partn
internal method make these assertions unnecessary.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
3821084031 net/sfc/base: precheck and verify flash writes
Read existing flash content before writing, so the flash write can be
avoided if the existing partition content matches the new image. This
avoids unnecessary write cycles for the flash device, and may also be
faster. If the flash does need to be updated, verify the content after
writing.

Note that reading the flash content after writing but before calling
efx_nvram-rw_finish() avoids firmware bug68170, which can lead to
signed image updates failing on Medford.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
2620f47aa7 net/sfc/base: fix check in NVRAM validate
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
e74e5d32b2 net/sfc/base: report correct partition write chunk size
If the firmware reports a non-zero write chunk size then nvram writes
may fail if a different granularity is used (e.g. for MUM firmware on
Sorrento).

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
f4332a5f48 net/sfc/base: check NVRAM locking by partition ID
Tracking which partition is locked avoids being overly conservative
when EFX_NVRAM_xxx maps to more than one partition (depnding on the
current port number).

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
90f8fc7b9d net/sfc/base: simplify NVRAM type to partition mappings
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
8586cd0964 net/sfc/base: rename firmware update verify result cap field
The existing name confuses support for secure boot with
support for reporting a verify result after an NVRAM update.

As the capability only reports support for returning a verify
result, change the name to be less confusing.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
79e2a9d018 net/sfc/base: extend NVRAM RW finish to return verify result
Extend efx_nvram_rw_finish() to return firmware verify result code.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
26b17d5ff7 net/sfc/base: report verify result from RW finish callback
This makes the verify result visible to efx_nvram_rw_finish(), which
can be extended to report it in a later patch.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
84fc2e97a0 net/sfc/base: simplify verify result handling
Simplify verify result handling in NVRAM update finish

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andy Moreton
54a8950e37 net/sfc/base: fix result code in MCDI NVRAM update finish
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Mark Spender
118575d50b net/sfc/base: do not use Tx desc push with TSO descriptors
Pushing TSO option descriptors is unsafe if pacer bypass is enabled,
so to make sure that doesn't happen never push TSO option descriptors.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Jackson
bdf5276fc9 net/sfc/base: copy new header from firmware src
Signed-off-by: Andrew Jackson <ajackson@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-16 18:47:49 +01:00
Hemant Agrawal
704e657bea net/ixgbe: fix ARM big endian build
fixes the following compilation error on compiling with ARM BE compiler

ixgbe_common.c: In function ‘ixgbe_host_interface_command’:
ixgbe_common.c:4610:22: error: passing argument 1 of
‘__builtin_bswap32’ makes integer from pointer without a cast
[-Werror=int-conversion]
   IXGBE_LE32_TO_CPUS(&buffer[bi]);
                      ^
Fixes: aa4fc14d2c ("ixgbe: update base driver")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-12 17:27:08 +01:00
Hemant Agrawal
80c557be08 net/i40e: fix ARM big endian build
This patch fixes the following error observed when
compiling with ARM BE compiler.

i40e_ethdev.c: In function ‘i40e_dev_tunnel_filter_set’:
i40e_ethdev.c:6988:5: error: lvalue required as unary ‘&’ operand
     &rte_cpu_to_le_32(ipv4_addr),

Fixes: edc845bd53 ("app/testpmd: fix build on FreeBSD")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2018-01-12 17:27:07 +01:00
Thierry Herbelot
8f87ba7015 fix typos
Repeated occurrences of 'the'.

The change was obtained using the following command:

  sed -i "s;the the ;the ;" `git grep -l "the "`

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
2018-01-11 18:26:46 +01:00
Jerin Jacob
aaf4363e1e drivers: use SPDX tag for Cavium copyright files
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-09 16:19:01 +01:00
Stephen Hemminger
eb23e8c9af net/bnx2x: remove redundant parenthesis
No need for extra parentheis around simple if expresssion

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-05 22:07:03 +01:00
Bruce Richardson
5566a3e358 drivers: use SPDX tag for Intel copyright files
Replace the BSD license header with the SPDX tag for files
with only an Intel copyright on them.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-04 22:41:39 +01:00
Hemant Agrawal
d81734cacc drivers: use SPDX tag in NXP dpaa files
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-04 22:41:39 +01:00
Hemant Agrawal
131a75b6e4 drivers: use SPDX tag in NXP dpaa2 files
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-04 22:41:39 +01:00
Shahaf Shuler
0384f21dff net/mlx5: fix flow mark action on port start
Mark action flag was not set on the flow, causing the rx burst function
after port start to ignore the flow mark.

Fixes: 8086cf08b2 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-15 09:06:31 +01:00
Andrew Rybchenko
048da2530d net/sfc: avoid Tx queue setup failure if thresholds are set
Tx queue prefetch, host and writeback thresholds are used for
performance fine-tuning and not applicable to Solarflare NICs.
It is safe to just log warning and do not fail Tx queue setup
to be more friendly to DPDK applications which hardcode it.

Fixes: b1b7ad933b ("net/sfc: set up and release Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-11-14 18:57:22 +01:00
Andrew Rybchenko
fdd7361b68 net/sfc: avoid Rx queue setup failure if thresholds are set
Rx queue prefetch, host and writeback thresholds are used for
performance fine-tuning and not applicable to Solarflare NICs.
It is safe to just log warning and do not fail Rx queue setup
to be more friendly to DPDK applications which hardcode it.

Fixes: ce35b05c63 ("net/sfc: implement Rx queue setup release operations")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-11-14 18:55:41 +01:00
Thierry Herbelot
cb98affeef net/mlx5: fix build without soft counters
total_length is only visible when SOFT_COUNTERS are enabled

Fixes: 3f13f8c23a ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-14 18:44:24 +01:00
Nelio Laranjeiro
e49f113654 net/mlx5: fix flow director deletion
The specification are wrongly computed causing the rule to not be match
correctly for deletion.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
2017-11-14 06:31:18 +01:00
Pengzhen Liu
43d18765c0 net/virtio: fix memory leak on failure
In function eth_virtio_dev_init(), dynamic memory stored
in "eth_dev->data->mac_addrs" variable and it is not freed
when function return,
this is a possible memory leak.

Fixes: 8ced1542f7 ("net/virtio: eth_dev->data->mac_addrs is not freed")
Cc: stable@dpdk.org

Signed-off-by: Pengzhen Liu <liupengzhen3@huawei.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2017-11-12 19:50:43 +01:00
Zhiyong Yang
fe19d49cb5 net/virtio: fix Rx interrupt with VFIO
When running l3fwd-power to test virtio rxq interrupt using vfio
pci noiommu mode, startup fails. In the function virtio_read_caps,
the code if (flags & PCI_MSIX_ENABLE) intends to double check
if vfio msix is enabled or not. However, it is not enable at that
time. So use_msix is assigned to "0", not "1", which causes the
failure of configuring rxq intr in l3fwd-power.
This patch adds the function "vtpci_msix_detect" to detect the status
of msix when interrupt changes happen.
In the meanwhile, virtio_intr_enable/disable are introduced to wrap
rte_intr_enable/disable to enhance the ability to detect msix.
use_msix can indicate three different msix status by:
VIRTIO_MSIX_NONE (0)
VIRTIO_MSIX_DISABLED (1)
VIRTIO_MSIX_ENABLED (2)

Fixes: cb482cb3a3 ("net/virtio: fix MAC address read")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2017-11-11 15:54:16 +01:00
Edward Makarov
b113cb5ee6 net/mlx5: fix link speed bitmasks
The constant ETHTOOL_LINK_MODE_1000baseT_Full_BIT and the others like
that in mlx5_link_update_unlocked_gs must be bit masks but unfortunately
they are bit numbers. This commit fixes the issue.

Fixes: 1884087198 ("net/mlx5: fix support for newer link speeds")
Cc: stable@dpdk.org

Signed-off-by: Edward Makarov <makarov@kraftway.ru>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-11 15:54:16 +01:00
Matan Azrad
46d7b08b91 net/mlx4: fix missing stamp during Tx completion
After processing completed packets, the owner bit of each TXBB comprised
in its WQEs must be invalidated. The loop stops short of processing the
last WQE.

Fixes: c3c977bbec ("net/mlx4: add Tx bypassing Verbs")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-11 15:54:16 +01:00
Ajit Khaparde
9a82633c27 net/bnxt: fix link handling and configuration
Remove a case where we were sending a deprecated field to the FW.
There is no need to send auto_link_speed to the FW.
Also set the auto_mode correctly depending on the setting requested.

Fixes: 7bc8e9a227 ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-11-10 09:42:25 +00:00
Ajit Khaparde
1ccdd771d6 net/bnxt: fix duplicate creation of ntuple filter
Prevent the creation of duplicate 5tuple filters.

Fixes: b7435d660a ("net/bnxt: add ntuple filtering support")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-11-10 09:42:10 +00:00
Alejandro Lucero
7c90eef52f net/nfp: fix possible memory leak
Memory allocated was not being released in any exit path.

Coverity issue: 195030
Fixes: 48e2255f1b ("net/nfp: add NSP support for HW link configuration")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
fee720e929 net/nfp: fix null pointer check
First, the received pointer was not checked before. Then the pointer
from malloc was not the one used in the existing check.

Coverity issue: 195027
Fixes: ad60bca348 ("net/nfp: read PF port MAC addr using NSP")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
1fdbf9b06a net/nfp: fix possible bad shif operation
We do not know how big can the BAR be, but we know anything less
than 1MB is an error. This BAR needs to be big enough for accessing
most of NFP internals.

Coverity issue: 195024
Fixes: d12206e005 ("net/nfp: add NSP user space interface")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
f5cba91b09 net/nfp: fix checking function return value
The fstat function could return a value that indicates an error condition.
If this is not checked, the error condition may not be handled correctly.

Coverity issue: 195019
Fixes: f37d8a4b67 ("net/nfp: add NSP FW upload command")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
eb04bc1052 net/nfp: fix resource leak
File descriptor is not released in any potential exit path
inside the function.

Coverity issue: 195018
Fixes: f37d8a4b67 ("net/nfp: add NSP FW upload command")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
965f0aaa7c net/nfp: fix memory allocation
If the function actually returns a null value, a null pointer
dereference will occur.

Coverity issue: 195013
Fixes: dd63df2bff ("net/nfp: add NSP symbol resolution command")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:24 +00:00
Alejandro Lucero
9b634927a7 net/nfp: fix stats struct initial value
Not all struct fields will be written and random data could
confuse readers.

Coverity issue: 140755
Fixes: 92aa491b88 ("nfp: add statistics")
Cc: stable@dpdk.org

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
2017-11-10 09:31:18 +00:00
Ilya V. Matveychikov
6c293ffd63 drivers/net: fix number of segment storage type
Fixes: 97cb466d65 ("mbuf: use 2 bytes for port and nb segments")
Cc: stable@dpdk.org

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-11-10 09:17:13 +00:00
Shahaf Shuler
8ec50cd624 net/mlx4: fix rxq interrupt memory corruption
intr_vec allocation size was wrong causing a memory corruption.

Fixes: 0a2ae70319 ("net/mlx4: fix Rx interrupts management")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-10 09:04:20 +00:00
Shahaf Shuler
b2e0e28e30 net/mlx5: fix rxq interrupt memory corruption
intr_vec allocation size was wrong causing a memory corruption.

Fixes: e1016cb733 ("net/mlx5: fix Rx interrupts management")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2017-11-10 08:56:26 +00:00
Nélio Laranjeiro
4daae08e7f net/mlx5: fix flow director rules comparison
When deleting/replacing a flow director rule the first rule of the list
was always the one replaced instead of the corresponding one.

Fixes: 4c3e9bcdd5 ("net/mlx5: support flow director")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-11-10 08:27:27 +00:00