dpdk.git
6 years agonet/sfc/base: add bit to indicate CTPIO availability
Guido Barzini [Tue, 20 Feb 2018 07:34:31 +0000 (07:34 +0000)]
net/sfc/base: add bit to indicate CTPIO availability

Signed-off-by: Guido Barzini <gbarzini@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add CTPIO statistics
Guido Barzini [Tue, 20 Feb 2018 07:34:30 +0000 (07:34 +0000)]
net/sfc/base: add CTPIO statistics

Signed-off-by: Guido Barzini <gbarzini@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: run genfwdef to update headers
Andy Moreton [Tue, 20 Feb 2018 07:34:29 +0000 (07:34 +0000)]
net/sfc/base: run genfwdef to update headers

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: document the event type for CTPIO sends
Guido Barzini [Tue, 20 Feb 2018 07:34:28 +0000 (07:34 +0000)]
net/sfc/base: document the event type for CTPIO sends

Document the TX_EV_TYPE used for TX completion events corresponding
to CTPIO sends.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add 1.3V voltage and current sensors
Andy Moreton [Tue, 20 Feb 2018 07:34:27 +0000 (07:34 +0000)]
net/sfc/base: add 1.3V voltage and current sensors

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: provide a flag for controlling CTPIO mode
Guido Barzini [Tue, 20 Feb 2018 07:34:26 +0000 (07:34 +0000)]
net/sfc/base: provide a flag for controlling CTPIO mode

Either cut-through or store-and-forward mode.

Signed-off-by: Guido Barzini <gbarzini@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support for tunnel encapsulations
Andy Moreton [Tue, 20 Feb 2018 07:34:25 +0000 (07:34 +0000)]
net/sfc/base: add Medford2 support for tunnel encapsulations

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support for licensing
Andy Moreton [Tue, 20 Feb 2018 07:34:24 +0000 (07:34 +0000)]
net/sfc/base: add Medford2 support for licensing

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support for external port numbers
Andy Moreton [Tue, 20 Feb 2018 07:34:23 +0000 (07:34 +0000)]
net/sfc/base: add Medford2 support for external port numbers

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: group Medford external port mapping entries
Andy Moreton [Tue, 20 Feb 2018 07:34:22 +0000 (07:34 +0000)]
net/sfc/base: group Medford external port mapping entries

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: clarify port mode names and masks
Andy Moreton [Tue, 20 Feb 2018 07:34:21 +0000 (07:34 +0000)]
net/sfc/base: clarify port mode names and masks

New port mode names are defined for Medford2 and later, and
the existing names are aliased to them. Add comments with the
numeric port mode to clarify the external port modes table.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support Medford2 event timer semantics
Andy Moreton [Tue, 20 Feb 2018 07:34:20 +0000 (07:34 +0000)]
net/sfc/base: support Medford2 event timer semantics

The event timer interface has changed for Medford2 - for
details see bug66418 comment 9. Update the common code to
use the new timer semantics for Medford2.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support FEC mode settings
Andy Moreton [Tue, 20 Feb 2018 07:34:19 +0000 (07:34 +0000)]
net/sfc/base: support FEC mode settings

Medford2 controllers support control and reporting of
FEC modes for 25G and higher links. See SF-109306-TC
for suggested usage in client code.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: remove obsolete comments
Andy Moreton [Tue, 20 Feb 2018 07:34:18 +0000 (07:34 +0000)]
net/sfc/base: remove obsolete comments

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move VI window size config to ef10 NIC board
Andy Moreton [Tue, 20 Feb 2018 07:34:17 +0000 (07:34 +0000)]
net/sfc/base: move VI window size config to ef10 NIC board

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move privilege config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:16 +0000 (07:34 +0000)]
net/sfc/base: move privilege config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move vector config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:15 +0000 (07:34 +0000)]
net/sfc/base: move vector config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move limits config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:14 +0000 (07:34 +0000)]
net/sfc/base: move limits config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move Tx config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:13 +0000 (07:34 +0000)]
net/sfc/base: move Tx config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move Rx config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:12 +0000 (07:34 +0000)]
net/sfc/base: move Rx config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move datapath config to ef10 NIC board cfg
Andy Moreton [Tue, 20 Feb 2018 07:34:11 +0000 (07:34 +0000)]
net/sfc/base: move datapath config to ef10 NIC board cfg

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move PHY/link config to ef10 NIC board cfg
Andy Moreton [Tue, 20 Feb 2018 07:34:10 +0000 (07:34 +0000)]
net/sfc/base: move PHY/link config to ef10 NIC board cfg

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move legacy board config to ef10 NIC board cfg
Andy Moreton [Tue, 20 Feb 2018 07:34:09 +0000 (07:34 +0000)]
net/sfc/base: move legacy board config to ef10 NIC board cfg

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move MAC address config to ef10 NIC board cfg
Andy Moreton [Tue, 20 Feb 2018 07:34:08 +0000 (07:34 +0000)]
net/sfc/base: move MAC address config to ef10 NIC board cfg

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move PF/VF config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:07 +0000 (07:34 +0000)]
net/sfc/base: move PF/VF config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move port config to ef10 NIC board config
Andy Moreton [Tue, 20 Feb 2018 07:34:06 +0000 (07:34 +0000)]
net/sfc/base: move port config to ef10 NIC board config

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add ef10 NIC board config method
Andy Moreton [Tue, 20 Feb 2018 07:34:05 +0000 (07:34 +0000)]
net/sfc/base: add ef10 NIC board config method

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: use correct name for frame truncation event
Andy Moreton [Tue, 20 Feb 2018 07:34:04 +0000 (07:34 +0000)]
net/sfc/base: use correct name for frame truncation event

The RX_ECC_ERR flag in RX events was misnamed, as it
reported frame truncation. Use the new RX_TRUNC_ERR
name for this flag.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: remove MAC stats size define
Andy Moreton [Tue, 20 Feb 2018 07:34:03 +0000 (07:34 +0000)]
net/sfc/base: remove MAC stats size define

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: size MAC stats DMA buffer to support Medford2
Andrew Rybchenko [Tue, 20 Feb 2018 07:34:02 +0000 (07:34 +0000)]
net/sfc: size MAC stats DMA buffer to support Medford2

Medford2 supports more MAC stats than previous HW. So DMA
buffer must be sized properly.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: resolve code analysis warnings
Richard Houldsworth [Tue, 20 Feb 2018 07:34:01 +0000 (07:34 +0000)]
net/sfc/base: resolve code analysis warnings

Minimal changes adding buffer size checks and simplifying checksum
processing.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: decode Medford2 FEC stats if available
Andy Moreton [Tue, 20 Feb 2018 07:34:00 +0000 (07:34 +0000)]
net/sfc/base: decode Medford2 FEC stats if available

Decode Medford2 FEC stats if available in MAC stats DMA buffer.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: run mkconfig.py to add FEC MAC stats
Andy Moreton [Tue, 20 Feb 2018 07:33:59 +0000 (07:33 +0000)]
net/sfc/base: run mkconfig.py to add FEC MAC stats

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: use MAC stats DMA buffer size when decoding
Andy Moreton [Tue, 20 Feb 2018 07:33:58 +0000 (07:33 +0000)]
net/sfc/base: use MAC stats DMA buffer size when decoding

On Medford2 and later the MAC stats buffer has been enlarged.
Use the MAC stats DMA buffer size to ensure that the stats END
generation count is read from the correct location, and that
over-reading of the DMA buffer is prevented.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: use MAC stats DMA buffer size from caps
Andy Moreton [Tue, 20 Feb 2018 07:33:57 +0000 (07:33 +0000)]
net/sfc/base: use MAC stats DMA buffer size from caps

For Medford2 the DMA buffer used for one-shot or periodic MAC stats
has been extended. Ensure the MAC stats DMA buffer size is large
enough to hold the number of stats counters supported by firmware.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: improve robustness of MAC stats get via MCDI
Andy Moreton [Tue, 20 Feb 2018 07:33:56 +0000 (07:33 +0000)]
net/sfc/base: improve robustness of MAC stats get via MCDI

Previously the code relied on the callers of efx_mcdi_mac_stats
to provide a DMA buffer or NULL depending on the action. Fix
this so that the DMA buffer is only passed in the request when
needed, and that an error is reported for a missing DMA buffer.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: retrieve number of MAC stats from NIC
Andy Moreton [Tue, 20 Feb 2018 07:33:55 +0000 (07:33 +0000)]
net/sfc/base: retrieve number of MAC stats from NIC

This reports the number of stats (and hence the DMA buffer size)
for MAC stats. If MC_GET_CAPABABILITIES_V4 is not supported then
use the legacy Siena-compatible MC_CMD_MAC_NSTATS value.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: refactor EF10 get datapath capabilities
Andy Moreton [Tue, 20 Feb 2018 07:33:54 +0000 (07:33 +0000)]
net/sfc/base: refactor EF10 get datapath capabilities

Inline efx_mcdi_get_capabilities() to prepare for reading
newer capabilities response versions.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: handle new speeds in link events
Andy Moreton [Tue, 20 Feb 2018 07:33:53 +0000 (07:33 +0000)]
net/sfc/base: handle new speeds in link events

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add efsys macro to get memory region size
Andy Moreton [Tue, 20 Feb 2018 07:33:52 +0000 (07:33 +0000)]
net/sfc/base: add efsys macro to get memory region size

EFSYS_MEM_SIZE() reports the DMA mapped size of an efsys_mem_t
allocated region (the allocation size may be different due to
memory allocator and DMA alignment restrictions).

This ensures that common code internals have explicit knowledge
of the usable size of DMA mapped memory regions.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add new loopback modes
Andy Moreton [Tue, 20 Feb 2018 07:33:51 +0000 (07:33 +0000)]
net/sfc/base: add new loopback modes

Report supported loopback modes for new Medford2 link speeds.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support new link modes
Andy Moreton [Tue, 20 Feb 2018 07:33:50 +0000 (07:33 +0000)]
net/sfc/base: support new link modes

Add basic support for new link modes for Medford2.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: simplify loopback type checking
Andy Moreton [Tue, 20 Feb 2018 07:33:49 +0000 (07:33 +0000)]
net/sfc/base: simplify loopback type checking

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: report memory BAR number
Andy Moreton [Tue, 20 Feb 2018 07:33:48 +0000 (07:33 +0000)]
net/sfc/base: report memory BAR number

On Medford and earlier controllers the BAR layout is:
  PF BAR 0: (32bit I/O) I/O mapped registers
  PF BAR 2: (64bit Mem) Memory mapped registers (VI aperture)
  PF BAR 4: (64bit Mem) MSI-X tables

  VF BAR 0: (64bit Mem) Memory mapped registers (VI aperture)
  VF BAR 2: (64bit Mem) MSI-X tables

On Medford2, the layout is:
  PF/VF BAR 0: (64bit Mem) Memory mapped registers (VI aperture)
  PF/VF BAR 2: (64bit Mem) MSI-X tables

Make the VI aperture BAR number available for drivers that need it.
Remove EFX_MEM_BAR define as it it is not correct on all platforms.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: update notes on interrupt testing on VFs
Andy Moreton [Tue, 20 Feb 2018 07:33:47 +0000 (07:33 +0000)]
net/sfc/base: update notes on interrupt testing on VFs

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: fix too long line
Andrew Rybchenko [Tue, 20 Feb 2018 07:33:46 +0000 (07:33 +0000)]
net/sfc/base: fix too long line

Fixes: 6f619653b9b1 ("net/sfc/base: import MCDI implementation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: refactoring eliminating code analysis warnings
Richard Houldsworth [Tue, 20 Feb 2018 07:33:45 +0000 (07:33 +0000)]
net/sfc/base: refactoring eliminating code analysis warnings

Addresses most of the warnings reported by the sfn windows driver.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: update hardware headers for Medford2
Andy Moreton [Tue, 20 Feb 2018 07:33:44 +0000 (07:33 +0000)]
net/sfc/base: update hardware headers for Medford2

The changes to efx_regs_ef10.h are auto-generated and include:

 - Updated event RX_L4_CLASS which is now 2 bits (was 3).
   The encoding of TCP, UDP and UNKNOWN are unchanged so
   the narrower Medford2 field definition is compatible with
   all controllers.

 - Fix definition of FATSOv2 option descriptors. These were
   added manually and differ from the auto-generated values
   in some fields (not yet used in common code). The field
   definitions have been corrected to agree with the Linux net
   driver headers and SF-108452-SW.

The remaining changes adapt the common code to use the updated
headers.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add method to make checksum option descriptors
Mark Spender [Tue, 20 Feb 2018 07:33:43 +0000 (07:33 +0000)]
net/sfc/base: add method to make checksum option descriptors

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: improve comments for EF10 ext port mapping
Richard Houldsworth [Tue, 20 Feb 2018 07:33:42 +0000 (07:33 +0000)]
net/sfc/base: improve comments for EF10 ext port mapping

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: support runtime VI window size
Andy Moreton [Tue, 20 Feb 2018 07:33:41 +0000 (07:33 +0000)]
net/sfc/base: support runtime VI window size

Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Update the common code to query the VI window size via MCDI,
and add new EFX_BAR_VI_* accessor macros for per-VI registers.

The existing EFX_BAR_TBL_* macros can be used for non-VI
register tables (and for code that can never be called for
a Medford2 controller e.g. Siena-only code).

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to MON module
Andy Moreton [Tue, 20 Feb 2018 07:33:40 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to MON module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to VPD module
Andy Moreton [Tue, 20 Feb 2018 07:33:39 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to VPD module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to BOOTCFG module
Andy Moreton [Tue, 20 Feb 2018 07:33:38 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to BOOTCFG module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to SRAM module
Andy Moreton [Tue, 20 Feb 2018 07:33:37 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to SRAM module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to NVRAM module
Andy Moreton [Tue, 20 Feb 2018 07:33:36 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to NVRAM module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to Tx module
Andy Moreton [Tue, 20 Feb 2018 07:33:35 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to Tx module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to Rx module
Andy Moreton [Tue, 20 Feb 2018 07:33:34 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to Rx module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to PHY module
Andy Moreton [Tue, 20 Feb 2018 07:33:33 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to PHY module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to MCDI module
Andy Moreton [Tue, 20 Feb 2018 07:33:32 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to MCDI module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to MAC module
Andy Moreton [Tue, 20 Feb 2018 07:33:31 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to MAC module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to INTR module
Andy Moreton [Tue, 20 Feb 2018 07:33:30 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to INTR module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to FILTER module
Andy Moreton [Tue, 20 Feb 2018 07:33:29 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to FILTER module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to EV module
Andy Moreton [Tue, 20 Feb 2018 07:33:28 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to EV module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: move RxDP config get to EF10 NIC code
Andy Moreton [Tue, 20 Feb 2018 07:33:27 +0000 (07:33 +0000)]
net/sfc/base: move RxDP config get to EF10 NIC code

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: correct PIO buffer dimensions for Medford2
Andy Moreton [Tue, 20 Feb 2018 07:33:26 +0000 (07:33 +0000)]
net/sfc/base: correct PIO buffer dimensions for Medford2

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 support to NIC module
Andy Moreton [Tue, 20 Feb 2018 07:33:25 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 support to NIC module

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add efsys option for Medford2
Andy Moreton [Tue, 20 Feb 2018 07:33:24 +0000 (07:33 +0000)]
net/sfc/base: add efsys option for Medford2

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add Medford2 PCI IDs
Andy Moreton [Tue, 20 Feb 2018 07:33:23 +0000 (07:33 +0000)]
net/sfc/base: add Medford2 PCI IDs

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: add 3.3V and 12.0V current sensors
Andy Moreton [Tue, 20 Feb 2018 07:33:22 +0000 (07:33 +0000)]
net/sfc/base: add 3.3V and 12.0V current sensors

Automatically generated using mkconfig.py.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: update autogenerated headers from firmwaresrc
Andrew Rybchenko [Tue, 20 Feb 2018 07:33:21 +0000 (07:33 +0000)]
net/sfc/base: update autogenerated headers from firmwaresrc

Pick up Medford2 interfaces.

Split AOE operations out into own header.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc/base: regenerate files with genfwdef after ID update
Andrew Jackson [Tue, 20 Feb 2018 07:33:20 +0000 (07:33 +0000)]
net/sfc/base: regenerate files with genfwdef after ID update

Add security level to image boot header.

Signed-off-by: Andrew Jackson <ajackson@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: add missing defines for SAL annotation
Andrew Rybchenko [Tue, 20 Feb 2018 07:33:19 +0000 (07:33 +0000)]
net/sfc: add missing defines for SAL annotation

Fixes: e1b944598579 ("net/sfc: build libefx")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agovhost: fix ring index returned to master on stop
Tomasz Kulasek [Fri, 9 Feb 2018 17:28:00 +0000 (18:28 +0100)]
vhost: fix ring index returned to master on stop

According to the "Vhost-user Protocol" document,
VHOST_USER_GET_VRING_BASE should get the available vring base offset.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix log macro name conflict
Tomasz Kulasek [Fri, 9 Feb 2018 17:24:00 +0000 (18:24 +0100)]
vhost: fix log macro name conflict

LOG_DEBUG is a symbol defined by POSIX, so if sys/log.h is
included the symbols conflict.

This patch changes LOG_DEBUG to VHOST_LOG_DEBUG.

Fixes: 1c01d52392d5 ("vhost: add debug print")
Cc: stable@dpdk.org
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: avoid function call in data path
Jianfeng Tan [Wed, 14 Feb 2018 04:01:00 +0000 (05:01 +0100)]
vhost: avoid function call in data path

Previously, get_device() is a function call. It's OK for slow path
configuration, but takes some cycles for data path.

To avoid that, we turn this function to inline type.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: remove unused log constant
Jianfeng Tan [Wed, 14 Feb 2018 04:01:00 +0000 (05:01 +0100)]
vhost: remove unused log constant

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix realloc failure
Tomasz Kulasek [Fri, 9 Feb 2018 17:19:00 +0000 (18:19 +0100)]
vhost: fix realloc failure

When reallocation of guest pages fails, vhost_user_set_mem_table() also
should fail.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")
Cc: stable@dpdk.org
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix device cleanup at stop
Tomasz Kulasek [Fri, 9 Feb 2018 17:10:00 +0000 (18:10 +0100)]
vhost: fix device cleanup at stop

This prevents from destroying & recreating user device in "incomplete"
vring state. virtio_is_ready() was returning true for devices with
vrings which did not have valid callfd (their VHOST_USER_SET_VRING_CALL
hasn't arrived yet)

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: check cmsg not null
Tomasz Kulasek [Fri, 9 Feb 2018 17:05:00 +0000 (18:05 +0100)]
vhost: check cmsg not null

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix offset while mmaping log base address
Tomasz Kulasek [Thu, 8 Feb 2018 16:59:00 +0000 (17:59 +0100)]
vhost: fix offset while mmaping log base address

QEMU always set offset to 0 but for sanity we should take the offset
into account.

Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")
Cc: stable@dpdk.org
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: check overflow before mmap
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: check overflow before mmap

If memory_size + mmap_offset overflows then the memory region is bogus.
Do not use the overflowed mmap_size value for mmap().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: validate virtqueue size
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: validate virtqueue size

Check the virtqueue size constraints so that invalid values don't cause
bugs later on in the code.  For example, sometimes the virtqueue size is
stored as unsigned int and sometimes as uint16_t, so bad things happen
if it is ever larger than 65535.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix message payload union in setting ring address
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: fix message payload union in setting ring address

vhost_user_set_vring_addr() uses the msg->payload.addr union member, not
msg->payload.state.  Luckily the offset of the 'index' field is
identical in both structs, so there was never any buggy behavior.

Fixes: 5cd690e4fda9 ("vhost: fix vring addresses not translated")
Cc: stable@dpdk.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: reject invalid log base mmap offset
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: reject invalid log base mmap offset

If the log base mmap_offset is larger than mmap_size then it points
outside the mmap region.  We must not write to memory outside the mmap
region, so validate mmap_offset in vhost_user_set_log_base().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: clear out unused SCM_RIGHTS file descriptors
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: clear out unused SCM_RIGHTS file descriptors

The number of file descriptors received is not stored by vhost_user.c.
vhost_user_set_mem_table() assumes that memory.nregions matches the
number of file descriptors received, but nothing guarantees this:

  for (i = 0; i < memory.nregions; i++)
      close(pmsg->fds[i]);

Another questionable code snippet is:

  case VHOST_USER_SET_LOG_FD:
      close(msg.fds[0]);

If not enough file descriptors were received then fds[] contains
uninitialized data from the stack (see read_fd_message()).  This might
cause non-vhost file descriptors to be closed if the uninitialized data
happens to match.

Refactoring vhost_user.c to pass around and check the number of file
descriptors everywhere would make the code more complex.  It is simpler
for read_fd_message() to set unused elements in fds[] to -1.  This way
close(-1) is called and no harm is done.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: validate untrusted memory regions number field
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: validate untrusted memory regions number field

Check if memory.nregions is valid right away.  This eliminates the
possibility of bugs when memory.nregions is used later on in
vhost_user_set_mem_table().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: avoid enum fields in VhostUserMsg
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: avoid enum fields in VhostUserMsg

The VhostUserMsg struct binary representation must match the vhost-user
protocol specification since this struct is read from and written to the
socket.

The VhostUserMsg.request union contains enum fields.  Enum binary
representation is implementation-defined according to the C standard and
it is unportable to make assumptions about the representation:

  6.7.2.2 Enumeration specifiers
  ...
  Each enumerated type shall be compatible with char, a signed integer
  type, or an unsigned integer type. The choice of type is
  implementation-defined, but shall be capable of representing the
  values of all the members of the enumeration.

Additionally, librte_vhost relies on the enum type being unsigned when
validating untrusted inputs:

  if (ret <= 0 || msg.request.master >= VHOST_USER_MAX) {

If msg.request.master is signed then negative values pass this check!

Even if we assume gcc on x86_64 (SysV amd64 ABI) and don't care about
portability, the actual enum constants still affect the final type.  For
example, if we add a negative constant then its type changes to signed
int:

  typedef enum VhostUserRequest {
      ...
      VHOST_USER_INVALID = -1,
  };

This is very fragile and it's unlikely that anyone changing the code
would remember this.  A security hole can be introduced accidentally.

This patch switches VhostUserMsg.request fields to uint32_t to avoid the
portability and potential security issues.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: add security model documentation
Stefan Hajnoczi [Mon, 5 Feb 2018 12:16:00 +0000 (13:16 +0100)]
vhost: add security model documentation

Input validation is not applied consistently in vhost_user.c.  This
suggests that not everyone has the same security model in mind when
working on the code.

Make the security model explicit so that everyone can understand and
follow the same model when modifying the code.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/mlx5: fix disabling Tx packet inlining
Yongseok Koh [Mon, 26 Feb 2018 17:50:57 +0000 (09:50 -0800)]
net/mlx5: fix disabling Tx packet inlining

Adding 'txq_inline=0' to PMD parameter should disable Tx packet inlining
but it doesn't work properly for Enhanced Multi-Packet Send.

Fixes: 6ce84bd88919 ("net/mlx5: add enhanced multi-packet send for ConnectX-5")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix tunnel offloads cap query
Shahaf Shuler [Sun, 25 Feb 2018 07:28:37 +0000 (09:28 +0200)]
net/mlx5: fix tunnel offloads cap query

The query for the tunnel stateless offloads is wrongly implemented
because of:

1. It was using the device id to query for the offloads.
2. It was using a compilation flag for Verbs which no longer exits.

The main reason was lack of proper API from Verbs.

Fixing the query to use rdma-core API. The capability returned from
rdma-core refer to both Tx and Rx sides.
Eventhough there is a separate cap for GRE and VXLAN, implementation merge
them into a single flag in order to simplify the checks on the data
path.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Fixes: f5fde5205101 ("net/mlx5: add hardware checksum offload for tunnel packets")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix flow creation with a single target queue
Nélio Laranjeiro [Wed, 14 Feb 2018 15:04:45 +0000 (16:04 +0100)]
net/mlx5: fix flow creation with a single target queue

Adding a pattern targeting a single queues wrongly behaves as it is an RSS
request, ending by creating several Verbs flows rules to match the RSS
configuration.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx: control netdevices through ioctl only
Adrien Mazarguil [Thu, 8 Feb 2018 16:37:06 +0000 (17:37 +0100)]
net/mlx: control netdevices through ioctl only

Several control operations implemented by these PMDs affect netdevices
through sysfs, itself subject to file system permission checks enforced by
the kernel, which limits their use for most purposes to applications
running with root privileges.

Since performing the same operations through ioctl() requires fewer
capabilities (only CAP_NET_ADMIN) and given the remaining operations are
already implemented this way, this patch standardizes on ioctl() and gets
rid of redundant code.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
6 years agomk: fix kernel modules build dependency
Thomas Monjalon [Thu, 29 Mar 2018 15:28:26 +0000 (17:28 +0200)]
mk: fix kernel modules build dependency

Some kernel modules may need some header files to be "installed"
in the build directory.

When running multiple threads of make, kernel modules can try to
be compiled before the lib headers are ready:
make -j3
kernel/linux/kni/kni_misc.c:19:37: fatal error:
exec-env/rte_kni_common.h: No such file or directory

This error appeared recently after moving kernel modules in their
own directory.

Fixes: acaa9ee991b5 ("move kernel modules directories")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agousertools: support AVP device
Xiaohua Zhang [Mon, 5 Mar 2018 09:16:32 +0000 (17:16 +0800)]
usertools: support AVP device

Signed-off-by: Xiaohua Zhang <xiaohua.zhang@windriver.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agokvargs: fix syntax in comments
Keith Wiles [Sat, 10 Mar 2018 16:24:28 +0000 (10:24 -0600)]
kvargs: fix syntax in comments

Use commas as separator, not semicolons.

Fixes: a8b97e3a1db0 ("devargs: use a comma instead of semicolon to separate key/values")
Cc: stable@dpdk.org
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoexamples/exception_path: limit core count to 64
Radu Nicolau [Tue, 20 Feb 2018 12:05:57 +0000 (12:05 +0000)]
examples/exception_path: limit core count to 64

Application doesn't support more that 64 lcores due to command
line limitation of using a coremask that is parsed as a 64bit
value, so changed it to reflect this limitation.

Coverity issue: 30688
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoapp/procinfo: fix strncpy usage in args parsing
Radu Nicolau [Tue, 20 Feb 2018 13:52:22 +0000 (13:52 +0000)]
app/procinfo: fix strncpy usage in args parsing

Replace strncpy with snprintf to avoid overwriting the last
NULL character.

Coverity issue: 143252
Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobus/vdev: fix finding device by name
Nachiketa Prachanda [Mon, 12 Mar 2018 16:54:00 +0000 (09:54 -0700)]
bus/vdev: fix finding device by name

Use strcmp to compare device names as the strncmp in original code
causes find_vdev to return -EEXIST  for names that are prefix
of another. The creation of interfaces fails unpredictably based
on the order of their creation. An easy way hit this bug is to create
eth_vhost1 after eth_vhost11.

Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")
Cc: stable@dpdk.org
Signed-off-by: Nachiketa Prachanda <nprachan@vyatta.att-mail.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agokni: fix build on RHEL 7.5
Lee Roberts [Thu, 1 Mar 2018 23:20:35 +0000 (16:20 -0700)]
kni: fix build on RHEL 7.5

Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>