Commit Graph

12087 Commits

Author SHA1 Message Date
Andy Moreton
e29dc43f93 net/sfc/base: run genfwdef to update headers
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:43 +02:00
Guido Barzini
c27347336b 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
373f9fe185 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>
2018-03-30 14:08:43 +02:00
Guido Barzini
6117505a28 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
f79095529c 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
62f544985d net/sfc/base: add Medford2 support for licensing
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:43 +02:00
Andy Moreton
e782bf865d 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
9fa69746a2 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
1a04c2d163 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
75ff34e83e 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
665d7b9aa1 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
ec79c42c6d net/sfc/base: remove obsolete comments
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:43 +02:00
Andy Moreton
5858ad96ce 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
1e2fa1e1fa 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
01a22b15b4 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
107cf1d792 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>
2018-03-30 14:08:43 +02:00
Andy Moreton
9bd777a7e6 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
32a3020461 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
04dbe8e6d4 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
77b5cbfe48 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
fa7e671a08 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
08d38249bc 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
579c1e6f2e 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
7cd282350e 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
540a928bdd 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
3cef86b503 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
e936b53ce4 net/sfc/base: remove MAC stats size define
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:42 +02:00
Andrew Rybchenko
c953aea983 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>
2018-03-30 14:08:42 +02:00
Richard Houldsworth
667d40513f 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
400ba3daee 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
d4b6631b89 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
cf89d0c9ed 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
e5d5a7983e 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
0edb4ecbe8 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
96cab03ded 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
4aab7f07a6 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
1eb735b2c8 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
9768b715c6 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
f1ba8c27fd 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
a1527a3a9e 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
0d854a2f07 net/sfc/base: simplify loopback type checking
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:42 +02:00
Andy Moreton
e434de5d6b 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
64548b47e1 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>
2018-03-30 14:08:42 +02:00
Andrew Rybchenko
ae8caa46a7 net/sfc/base: fix too long line
Fixes: 6f619653b9 ("net/sfc/base: import MCDI implementation")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-03-30 14:08:42 +02:00
Richard Houldsworth
8b743724c0 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
7e48cfe9ef 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>
2018-03-30 14:08:42 +02:00
Mark Spender
0ecf255632 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>
2018-03-30 14:08:42 +02:00
Richard Houldsworth
5c1c935890 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
b9673329e1 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>
2018-03-30 14:08:42 +02:00
Andy Moreton
93b05b626c 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>
2018-03-30 14:08:42 +02:00