Commit Graph

332 Commits

Author SHA1 Message Date
Andrew Rybchenko
0ca76fa98a sfxge(4): fix efx_ev_qpoll for non-Siena builds
Both Siena and EF10 use the siena_ev_qpoll() implementation, but this
function is not defined in builds without EFSYS_OPT_SIENA.

Remove siena_ev_qpoll and inline it into efx_ev_qpoll to allow it
to be used in non-Siena builds.

Also remove outdated FIXME comment, as EF10 event batching/merging has
been implemented long ago without needing to modify this code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8939
2016-12-29 06:49:32 +00:00
Andrew Rybchenko
7b37475fef sfxge(4): fix common code for non-Siena builds
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8938
2016-12-29 06:47:53 +00:00
Andrew Rybchenko
897921fc45 sfxge(4): fix misuse of siena_build_filter in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8937
2016-12-29 06:46:20 +00:00
Andrew Rybchenko
7fb55c62f7 sfxge(4): cleanup: remove last use of deprecated function flags with privilege check
The function flags were changed to mirror the privileges, but
the privileges are preferred.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8936
2016-12-28 18:07:17 +00:00
Andrew Rybchenko
cc7a82f5da sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8935
2016-12-28 17:56:03 +00:00
Andrew Rybchenko
fa4a3ccff6 sfxge(4): add UEFI ROM support to the common code
Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8934
2016-12-28 17:52:24 +00:00
Andrew Rybchenko
ab72be51e2 sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford
On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end
padding setting is in the ADMIN group, and so fails for
unprivileged functions. In that case, assume the largest size
supported by Medford hardware (256bytes) to prevent overrun.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8933
2016-12-28 17:50:48 +00:00
Andrew Rybchenko
5081d55d40 sfxge(4): support Medford bootcfg partition layout in common code
For Siena and Huntington, the per-port bootcfg (aka expcfg) is
stored in a dedicated 4Kbyte partition for each port.

For Medford, the per-PF bootcfg is stored in a 2Kbyte sector
within a single shared partition. Update the common code to support
the new bootcfg layout.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8932
2016-12-28 17:49:33 +00:00
Andrew Rybchenko
a3fe009ab4 sfxge(4): add possibility to control event queue performance profile
It is ignored on SFN5xxx/6xxx (aka Siena).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8931
2016-12-28 17:45:52 +00:00
Andrew Rybchenko
75fed2ce6f sfxge(4): fix invalid type of eft_unicst_filter_count
Found by clang when boolean_t is defined as bool for DPDK PMD.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 16:28:09 +00:00
Andrew Rybchenko
80d051ee13 sfxge(4): do not initialize enumerated type variable to another type
Fix build warning generated by ICC.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 16:21:46 +00:00
Andrew Rybchenko
406b8d7d9b sfxge(4): translate MC_CMD_ERR_ERANGE to host errno value
This is needed because MCDI command MC_CMD_REKEY can return
MC_CMD_ERR_ERANGE.

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 15:24:44 +00:00
Andrew Rybchenko
c75d636205 sfxge(4): rename hunt_bist_* methods to ef10_bist_*
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 13:28:44 +00:00
Andrew Rybchenko
3222b9de29 sfxge(4): cleanup: improve prefast annotations
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:43:11 +00:00
Andrew Rybchenko
1f4bb1bd2a sfxge(4): fix defined-but-not-used warning if neither VPD nor NVRAM opt enabled
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:28:16 +00:00
Andrew Rybchenko
56ec54c70f sfxge(4): cleanup: add missing spaces
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:25:17 +00:00
Andrew Rybchenko
98a9ac91f0 sfxge(4): cleanup: avoid unspecified unsigned
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:19:54 +00:00
Andrew Rybchenko
60cf15c592 sfxge(4): enclose macro complex value in parenthesis
Found by DPDK checkpatches.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:11:15 +00:00
Andrew Rybchenko
09b3e655d5 sfxge(4): make strings array pointer itself immutable
Found by DPDK checkpatches.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:09:45 +00:00
Andrew Rybchenko
a260bd77cf sfxge(4): cleanup: add const qualifier to const array pointer
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:07:34 +00:00
Andrew Rybchenko
69621b26c0 sfxge(4): cleanup: avoid spaces before TAB
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:04:36 +00:00
Andrew Rybchenko
b99afef3b3 sfxge(4): cleanup: avoid space just before TAB in efx_types.h
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:03:06 +00:00
Andrew Rybchenko
01a6119ccf sfxge(4): cleanup: use TAB to indent
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 11:01:01 +00:00
Andrew Rybchenko
6b3fab1a53 sfxge(4): cleanup: add missing space between type and pointer symbol
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:53:53 +00:00
Andrew Rybchenko
bf42516d2c sfxge(4): cleanup: open brace should be on a type name line
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:52:04 +00:00
Andrew Rybchenko
5e9a2dc5d6 sfxge(4): cleanup: remove trailing whitespaces
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:49:41 +00:00
Andrew Rybchenko
fe497b15a1 sfxge(4): cleanup: pointer symbol should go together with struct member name
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:48:15 +00:00
Andrew Rybchenko
75b16fa082 sfxge(4): cleanup: avoid C99 // comments
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:47:04 +00:00
Andrew Rybchenko
1e57660f86 sfxge(4): cleanup: remove unnecessary spaces
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:45:14 +00:00
Andrew Rybchenko
2910c2465f sfxge(4): cleanup: use spaces around binary arithmetic operations
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:44:03 +00:00
Andrew Rybchenko
6d4e783ecb sfxge(4): cleanup: fix wrong indent
Found by DPDK checkpatch.sh

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:43:04 +00:00
Andrew Rybchenko
85365dfcbf sfxge(4): cleanup: remove trailing whitespace
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:40:21 +00:00
Andrew Rybchenko
62b5fe03b9 sfxge(4): cleanup: fix typo in siena_mac_loopback_set() instrumentation
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-12-28 10:39:11 +00:00
Bryan Drewery
28323add09 Fix improper use of "its".
Sponsored by:	Dell EMC Isilon
2016-11-08 23:59:41 +00:00
Andrew Rybchenko
b36a7ad2c9 sfxge(4): update external port mapping for Medford
Extend the mapping table for external port numbering to support port modes
which output to the second external port only. Where supported, map from
the current port mode rather than inferring from all the available modes.
Updated comments for clarity.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8210
2016-10-11 13:08:48 +00:00
Andrew Rybchenko
622429035a sfxge(4): sync tlv_layout.h with firmwaresrc and update port-mode definition use
It fixes driver attach issue to a new firmware which reports a new
port-modes.

Reviewed by:    gnn
Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8203
2016-10-10 09:54:01 +00:00
Andrew Rybchenko
37b580cbf9 sfxge(4): cleanup: add missing probes to ef10_nvram_segment_write_tlv
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-08 12:40:21 +00:00
Andrew Rybchenko
ba3049f99c sfxge(4): update TX vFIFO ULL tag location to avoid merge conflict
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-06 09:30:31 +00:00
Andrew Rybchenko
995a3bf49c sfxge(4): allow firmware to auto-configure event queues on Medford
On Medford, licenses are required to enable RX and event cut through and to
disable RX batching. To avoid the need for the driver to make decisions based on
the licensing state, the MC_CMD_INIT_EVQ has been extended to allow us to leave
the decision to the firmware. If the adapter is licensed for low-latency use,
the firmware will choose the optimal settings for latency, otherwise it will use
the best settings for throughput.

For Huntington we still need to choose the settings ourselves.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6717
2016-06-05 06:37:54 +00:00
Andrew Rybchenko
095bde9316 sfxge(4): always be ready to receive batched events
When the low-latency firmware variant is running, it is reported as not
being capable of batching RX events, but it can still do so if the
FORCE_EV_MERGING flag is set on an RXQ.  Therefore we need to handle
batched RX events even if the capability isn't set.

If this bug is fixed in the firmware such that the capability is set
even when running the low-latency firmware variant, it will almost
always be reported so I don't think we lose much by removing the check.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6705
2016-06-04 09:20:46 +00:00
Andrew Rybchenko
b839ed60bd sfxge(4): add helper to compute timer quantum
This also adjusts the timer values used to match the Linux net
driver implementation:
a) non-zero time intervals should result in at least one quantum
b) timer load/reload values are only zero biased for Falcon/Siena

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6704
2016-06-04 09:17:45 +00:00
Andrew Rybchenko
e26f5dac7f sfxge(4): support EVQ timer workaround via MCDI
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/6675
2016-06-03 05:27:34 +00:00
Andrew Rybchenko
6bf4498cbc sfxge(4): cleanup: remove unused variables in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-01 14:16:16 +00:00
Andrew Rybchenko
e6023d7095 sfxge(4): cleanup: add missing space after if keyword
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-01 14:11:40 +00:00
Andrew Rybchenko
5c4c3d9285 sfxge(4): set moderation in efx_ev_qcreate
This simplifies setting an initial interrupt moderation value, and
avoids most calls to evx_ev_qmoderate from contexts where MCDI is
not allowed (MCDI is need for an EVQ timer workaround in a later patch).

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6673
2016-06-01 14:03:07 +00:00
Andrew Rybchenko
e73954218a sfxge(4): regenerate MCDI headers from firmwaresrc .yml
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-31 18:04:16 +00:00
Andrew Rybchenko
c34e3d6862 sfxge(4): fix typo in monitor types strings in common code
Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-27 11:50:26 +00:00
Andrew Rybchenko
8d8507f1ba sfxge(4): avoid necessity to add one more constant condition note
Use for forever loop instead of while.

Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-27 11:49:46 +00:00
Andrew Rybchenko
2bfb64322a sfxge(4): cope with always true unsigned comparison with 0 to make lint happier
Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-27 11:49:05 +00:00
Andrew Rybchenko
2ceb37acba sfxge(4): unsigned 1 should be shifted to produce bitmask
Found by lint on illumos.

Submitted by:   Garrett D'Amore <garrett at damore.org>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-27 11:48:25 +00:00