Commit Graph

451 Commits

Author SHA1 Message Date
Andrew Rybchenko
20c5aab398 sfxge(4): add Medford2 support to Tx module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18152
2018-11-27 12:21:30 +00:00
Andrew Rybchenko
34352ef8c3 sfxge(4): add Medford2 support to Rx module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18151
2018-11-27 12:21:19 +00:00
Andrew Rybchenko
10d4c14d98 sfxge(4): add Medford2 support to PHY module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18150
2018-11-27 12:21:08 +00:00
Andrew Rybchenko
eecf8d281f sfxge(4): add Medford2 support to MCDI module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18149
2018-11-27 12:20:57 +00:00
Andrew Rybchenko
cbc3f94f08 sfxge(4): add Medford2 support to MAC module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18148
2018-11-27 12:20:46 +00:00
Andrew Rybchenko
1bef83ea41 sfxge(4): add Medford2 support to INTR module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18147
2018-11-27 12:20:35 +00:00
Andrew Rybchenko
d6f0fbb15b sfxge(4): add Medford2 support to FILTER module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18146
2018-11-27 12:20:23 +00:00
Andrew Rybchenko
5095efd4f5 sfxge(4): add Medford2 support to EV module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18145
2018-11-27 12:20:12 +00:00
Andrew Rybchenko
45becd7603 sfxge(4): move RxDP config get to EF10 NIC code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18144
2018-11-27 12:20:01 +00:00
Andrew Rybchenko
4f58306ca6 sfxge(4): correct PIO buffer dimensions for Medford2
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18143
2018-11-27 12:19:49 +00:00
Andrew Rybchenko
ae64ac9336 sfxge(4): add Medford2 support to NIC module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18142
2018-11-27 12:14:16 +00:00
Andrew Rybchenko
553455ea93 sfxge(4): put Siena-specific code under its efsys option
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18141
2018-11-27 12:14:05 +00:00
Andrew Rybchenko
97ce60b7d6 sfxge(4): add efsys option for Medford2
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18140
2018-11-27 12:13:54 +00:00
Andrew Rybchenko
e995da72bb sfxge(4): add Medford2 PCI IDs
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18139
2018-11-27 12:13:39 +00:00
Andrew Rybchenko
acc84f29fe sfxge(4): add 3.3V and 12.0V current sensors
Automatically generated using mkconfig.py.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18138
2018-11-26 07:42:52 +00:00
Andrew Rybchenko
9ed106d0b4 sfxge(4): update autogenerated headers from firmwaresrc
Pick up Medford2 interfaces.

Split AOE operations out into own header.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18137
2018-11-26 07:23:02 +00:00
Andrew Rybchenko
208539a4f7 sfxge(4): regenerate files with genfwdef after ID update
Add security level to image boot header.

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18289
2018-11-26 07:15:19 +00:00
Andrew Rybchenko
fdbe38cf9d sfxge(4): add API to control UDP tunnel ports
HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18134
2018-11-26 06:20:13 +00:00
Andrew Rybchenko
4ed151b893 sfxge(4): allow to request inner classes for Rx packets
If HW/FW supports tunnel encapsulations, Rx event may contain
either inner or outer packet classes. By default outer classes
are requested. Make it possible to request inner classes to
have more information about packet type and allow to interpret
inner frame checksum validation results correctly.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18133
2018-11-24 18:13:34 +00:00
Andrew Rybchenko
074cfb5c75 sfxge(4): add function to create packed stream RxQ
Encoding packed stream buffer size in RxQ type is not a future-proof
idea taking into account a new RxQ types with extra parameters.
To be consistent make packet stream buffer size a separate parameter.
In order to avoid blowing of the default RxQ create function prototype
add a dedicated function to create packed stream RxQ without not
applicable paramters.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18132
2018-11-24 18:13:21 +00:00
Andrew Rybchenko
9445d1c5e0 sfxge(4): control RxQ scatter using flag instead of type
Rx scatter may be applicable to different Rx queue types.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18131
2018-11-24 18:13:07 +00:00
Andrew Rybchenko
687e45b163 sfxge(4): remove Falcon-specific concurrency check
Falcon support has been withdrawn from libefx, however, there is still
an obsolete Falcon-specific assertion that efx_mac_stats_upload()
and efx_port_poll() aren't concurrent. To be consistent with an overall
Falcon support revocation it's desirable to remove it.

Fix debug build invalid assertion failure.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18130
2018-11-24 16:31:43 +00:00
Andrew Rybchenko
afd307d69c sfxge(4): move BIU test code into Siena-specific file
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18129
2018-11-24 16:31:31 +00:00
Andrew Rybchenko
9a3efb216c sfxge(4): fix PreFAST static analysis warning (C6001)
Fix warning
"C6001: Using uninitialized memory '*sensor_maskp'"
which could occur when the npages argument to efx_mcdi_sensor_info()
is less than or equal to zero.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18128
2018-11-24 16:31:20 +00:00
Andrew Rybchenko
ee1d6deeeb sfxge(4): expand on comment on number of queues field
Expand on comment on RSS_CONTEXT_ALLOC_IN_NUM_QUEUES field.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18127
2018-11-24 16:31:08 +00:00
Andrew Rybchenko
3651ecc55b sfxge(4): remove obsolete check for pre-Siena hardware
The fail4 label was used twice, so it doesn't need removing.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18126
2018-11-24 16:30:57 +00:00
Andrew Rybchenko
c708002c5f sfxge(4): fix warnings from VS2015 C compiler (C4214)
Fix multiple level 4 warnings
"C4214: nonstandard extension used: bit field types other than int";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18125
2018-11-24 16:30:46 +00:00
Andrew Rybchenko
7e17c17d9f sfxge(4): fix warnings from VS2015 C compiler (C4057)
Fix two level 4 warnings
"C4057: 'function': 'const uint8_t *' differs in indirection to
slightly different base types from 'caddr_t'"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18124
2018-11-24 16:30:34 +00:00
Andrew Rybchenko
cc8d2b2393 sfxge(4): fix warnings from VS2015 C compiler (C4189)
Fix multiple level 4 warnings
"C4189: 'xxx': local variable is initialized but not referenced";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18123
2018-11-24 16:30:22 +00:00
Andrew Rybchenko
bbea960434 sfxge(4): fix warnings from VS2015 C compiler (C4100)
Fix multiple level 4 warnings
"C4100: 'xxx': unreferenced formal parameter"
no functional changes.

The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
Studio 2015 C compiler with the following:

    #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
    #define _NOTE(_annotation)   _NOTE_ ## _annotation

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18122
2018-11-24 16:30:09 +00:00
Andrew Rybchenko
54bee5b4fd sfxge(4): fix warnings from VS2015 C compiler (C4245)
Fix level 4 warning
"C4245: 'initializing': conversion from 'int' to 'uint32_t',
signed/unsigned mismatch" warning; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18121
2018-11-24 16:29:58 +00:00
Andrew Rybchenko
5ef1830c5c sfxge(4): fix warnings from VS2015 C compiler (C4244)
Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss
of data"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18120
2018-11-24 16:29:46 +00:00
Andrew Rybchenko
5e7bb158cb sfxge(4): fix warnings from VS2015 C compiler (C4310)
Fix level 4 warning
"C4310: cast truncates constant value";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18119
2018-11-24 16:29:35 +00:00
Andrew Rybchenko
79ddc22463 sfxge(4): fix probes in licensing support
EFSYS_PROBE1 takes one typed value (in addition to the probe name),
whereas EFSYS_PROBE has just the probe name.

Which to use is determined by the probe name - "fail1" probes are
expected to include the function result.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18118
2018-11-24 16:29:23 +00:00
Andrew Rybchenko
07542d7365 sfxge(4): fix diagnostics support build without Siena
The compilation failed because __efx_sram_pattern_fns was used in
efx_nic.c, but defined in efx_sram.c which is only needed when
supporting Siena.

To fix it move all the code using __efx_sram_pattern_fns into
Siena-specific files (except for the definition in efx_sram.c itself,
as that file only needs to be included in Siena-supporting builds
anyway).

The functions to test registers and tables are unlikely to apply to any
new hardware and so can be moved into Siena files. Since Huntington
such tests have been implemented in firmware.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18117
2018-11-24 16:29:11 +00:00
Andrew Rybchenko
a6f6c2f06d sfxge(4): allow to use PHY stats on Huntington/Medford
EFSYS_OPT_PHY_STATS can be used with Huntington or Medford, not just Siena.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18116
2018-11-24 16:28:58 +00:00
Andrew Rybchenko
95c45bd003 sfxge(4): fix coding style
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18115
2018-11-24 15:24:47 +00:00
Andrew Rybchenko
dda2b341f9 sfxge(4): remove unused defined for WPTR alignment
MEDFORD_RX_WPTR_ALIGN is not used.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18114
2018-11-24 15:24:35 +00:00
Andrew Rybchenko
17a2b32ade sfxge(4): support new sensors
Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18113
2018-11-24 15:24:23 +00:00
Andrew Rybchenko
df2215d5d2 sfxge(4): add new sensors
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18112
2018-11-24 15:24:12 +00:00
Andrew Rybchenko
2d99dff8ca sfxge(4): move Siena-specific defs to right header
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18111
2018-11-24 15:23:58 +00:00
Andrew Rybchenko
c68c424c14 sfxge(4): fix build issue with PHY LED control enabled
Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
Medford.

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18110
2018-11-24 15:23:46 +00:00
Andrew Rybchenko
0c9ef1f52e sfxge(4): improve names for TXQ descriptor counts
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18109
2018-11-24 15:23:34 +00:00
Andrew Rybchenko
59ee8172c5 sfxge(4): improve names for RXQ descriptor counts
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18108
2018-11-24 15:23:22 +00:00
Andrew Rybchenko
6995308309 sfxge(4): improve names for EVQ descriptor counts
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18107
2018-11-24 15:23:09 +00:00
Andrew Rybchenko
ddef7d7980 sfxge(4): remove assertion on no longer used define
MC_CMD_INIT_RXQ_OUT_LEN is not used any more.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18106
2018-11-24 15:22:57 +00:00
Andrew Rybchenko
fbca55a51c sfxge(4): request info about outer frame in Rx events
For encapsulated packets, the firmware gives info about the inner frame
fields by default. When not using encapsulation offload, ask for info
about the outer frame instead.

On SFN8xxx with firmware version before v6.4.2.1007 driver reload is
needed after switching from full-feature to low-latency firmware
variant since the driver still thinks that firmware supports
encapsulation, but firmware does not tolerate request to provide info
about outer frame in Rx events.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18105
2018-11-23 16:18:36 +00:00
Andrew Rybchenko
9d89c911bb sfxge(4): ignore error in completion event on MCDIv2 HW
With MCDIv2, the reponse length can be to big to fit into the
CMDDONE_DATALEN field in the MCDI completion event. But rather that
the length being truncated, it can overflow into the CMDDONE_ERRNO
field (this is a longstanding firmware bug). Hence the CMDDONE_ERRNO
field may not be valid.

It isn't necessary to use the value in the CMDDONE_ERRNO field though,
so it can be ignored. The actual error code is already read from the
response header on MCDIv2 capable hardware and stored in emr_rc, so
that can be used instead.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18104
2018-11-23 15:59:49 +00:00
Andrew Rybchenko
641c3370f4 sfxge(4): use MCDIv2 for requests with too long response
Use MCDIv2 for requests with a response size too long for MCDIv1.

Required for MC_CMD_MAC_STATS to reports the stats without using DMA.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18103
2018-11-23 15:59:37 +00:00
Andrew Rybchenko
18b602f954 sfxge(4): support inner checksum offload on transmit
Inner checksum offloads may be used only if firmware supports
these tunnels.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18102
2018-11-23 13:12:04 +00:00