Commit Graph

584 Commits

Author SHA1 Message Date
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
Andrew Rybchenko
44fcad033f sfxge(4): do not limit driver RSS table to RSS channels max
Specification of entire RSS table in the driver allows to spread traffic
more equally across CPUs/RSS channels if number of RSS channels is not
power of 2.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D8910
2016-12-27 08:51:26 +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
715a90f64e sfxge(4): bump version to the closest out-of-tree driver version
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-09 12:33:53 +00:00
Andrew Rybchenko
af58aa462e sfxge(4): handle negative ticks difference correctly
ticks are signed int and if statistics is not updated for a long time
(more than INT_MAX ticks, but less than UINT_MAX) difference becomes
negative and less than hz for a long time.

Other option to repeat is simply load driver (which initializes
timestamps to 0) when ticks are negative.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6777
2016-06-09 12:29:03 +00:00
Andrew Rybchenko
414dec5f0f sfxge(4): host byte order is required for IP ID in TSO descriptors
Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-06-08 13:14:52 +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
3bbc1e08ed sfxge(4): pick an RSS bucket for the packet enqueued and select TXQ accordingly
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D6723
2016-06-06 09:08:16 +00:00
Andrew Rybchenko
f949e9f802 sfxge(4): set up the indirection table using the kernel-driven RSS bucket ids
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D6722
2016-06-06 09:07:26 +00:00
Andrew Rybchenko
35c0644e49 sfxge(4): bind interrupts to CPUs in accordance with bucket to CPU map
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D6721
2016-06-06 09:06:38 +00:00
Andrew Rybchenko
8e7d32065b sfxge(4): restrict the maximum number of RSS channels by the number of RSS buckets
This is done because one has no point to have more channels since they
will be unused.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D6720
2016-06-06 09:05:52 +00:00
Andrew Rybchenko
2da8819492 sfxge(4): get RSS key to be programmed into NIC from the kernel
Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D6719
2016-06-06 09:05:06 +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
84bcd65e0f sfxge(4): cope with code duplication on SW events composition
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D6666
2016-06-01 06:51:19 +00:00
Andrew Rybchenko
e1399ed7a2 sfxge(4): avoid code duplication in SW events definition
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D6662
2016-05-31 20:54:42 +00:00
Andrew Rybchenko
9885e222ea sfxge(4): move definition of the SW events to sfxge.h
Tx flush done event is defined and Rx-specific header is not a good
place for it.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-05-31 18:34:39 +00:00
Andrew Rybchenko
7d52b4a8a1 sfxge(4): zero should be used as RxQ label in SW event
The buggy code was using the rxq index but should use the evq label
associated with the rxq. It was missed in r298735.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D6661
2016-05-31 18:31:17 +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
Andrew Rybchenko
898285cdb2 sfxge(4): cope with lint for EFX_SET_OWORD_BIT() with const bit arg
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:47:56 +00:00
Andrew Rybchenko
647a7e8f49 sfxge(4): remove set but not used variable
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:47:11 +00:00
Andrew Rybchenko
1972e0c429 sfxge(4): remove unreachable break after goto
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:46:35 +00:00
Andrew Rybchenko
5e951ea735 sfxge(4): add constant condition note 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:45:42 +00:00
Andrew Rybchenko
a92a213321 sfxge(4): note unused variables 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:44:40 +00:00
Andrew Rybchenko
6dd81be2d2 sfxge(4): correct parenthesis location in if coundition
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-26 13:19:44 +00:00
Andrew Rybchenko
131bc376b9 sfxge(4): enable Medford support
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6510
2016-05-24 12:20:23 +00:00
Andrew Rybchenko
1baf53ec8d sfxge(4): bump driver version to the closest out-of-tree version
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-24 12:19:14 +00:00
Andrew Rybchenko
929c7feb83 sfxge(4): cleanup: update copyright to 2016
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6509
2016-05-24 12:16:57 +00:00
Andrew Rybchenko
ecaa500c4b sfxge(4): provide option to disable not a local MAC address check
Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by:   Laurence Evans <levans at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6508
2016-05-24 12:15:30 +00:00
Andrew Rybchenko
bdb482bfa0 sfxge(4): be ready to receive events immediately after event queues are created
Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6507
2016-05-24 12:14:19 +00:00
Andrew Rybchenko
899466f91e sfxge(4): cleanup: remove unused EFX preempt macros
The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-23 13:17:37 +00:00
Andrew Rybchenko
b108666635 sfxge(4): cleanup: remove trailing whitespaces
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-18 09:57:11 +00:00
Eitan Adler
cef367e6a1 Don't repeat the the word 'the'
(one manual change to fix grammar)

Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)
2016-05-17 12:52:31 +00:00
Andrew Rybchenko
2be4ef39bc sfxge(4): only raise an exception after MC assert or reboot in the common code
Fix efx_mcdi_request_poll so it only raises an exception if EIO is
reported from a detected MC assert or reboot. This prevents
an unnecessary exception being raised if an MCDI response error code
is trandlated to EIO.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6392
2016-05-17 06:28:03 +00:00
Andrew Rybchenko
fdbffbab18 sfxge(4): restore clearing of MCDI new epoch flag in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6390
2016-05-17 06:27:19 +00:00
Andrew Rybchenko
78e5c87c3b sfxge(4): fix Medford timer quantum calculation in common code
The event/timer block used sysclk in Huntington, but has been
moved to the dpcpu clock domain for Medford. Fix the computed
timer quantum to use the right clock.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6389
2016-05-17 06:26:02 +00:00
Andrew Rybchenko
d8484af2ba sfxge(4): query and use current MTU if setting the MTU fails
This allows the driver to fall back to the largest usable MTU if a
user attempts to configure an unprivileged function with an MTU higher
than that of the attached port.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6387
2016-05-17 06:25:00 +00:00
Andrew Rybchenko
5df3232c85 sfxge(4): store licensing state in efx_lic
Check licensing support at NIC startup to avoid multiple checks later.
As state is stored, licensing initialisation is moved later in start
procedure.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6385
2016-05-17 06:23:50 +00:00
Andrew Rybchenko
bba8dcbcd3 sfxge(4): cleanup: quieten more common code MCDI handlers
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:32:21 +00:00
Andrew Rybchenko
fb39178368 sfxge(4): cleanup: remove misnamed function declaration
Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:28:27 +00:00
Andrew Rybchenko
c6190b10d9 sfxge(4): cleanup: make MCDI license queries quieter in common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:27:20 +00:00
Andrew Rybchenko
ca2eff6584 sfxge(4): cleanup: simplify ef10_ev_qcreate
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 08:04:40 +00:00
Andrew Rybchenko
e9660953ab sfxge(4): translate MC_CMD_ERR_EEXIST to host errno value
This is needed because the new MCDI command nvram_private_append can
return MC_CMD_ERR_EEXIST

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:47:20 +00:00
Andrew Rybchenko
7d17c52bb0 fxge(4): cleanup: run genfwdef to propogate prior changes to TLV headers
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:45:43 +00:00
Andrew Rybchenko
ce674fe154 sfxge(4): set TSOv2 feature flag on Medford
Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:33:56 +00:00
Andrew Rybchenko
44e44413d4 sfxge(4): improve TX/RX queue error messages
Report the full error descriptor in a form that can be passed to
firmwaresrc/dpcpu/scripts/evdecode

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:29:50 +00:00
Andrew Rybchenko
95c6a8211c sfxge(4): fix license validation check for V3 licenses
Length consistency checks were failing for ECC hashes.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 07:12:04 +00:00
Andrew Rybchenko
0ecc971831 sfxge(4): regenerate MCDI headers from firmwaresrc .yml
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 06:59:12 +00:00
Andrew Rybchenko
ff2e27e5bb sfxge(4): increase maximum size of license keys
Increase buffer sizes for license keys to 160 bytes to accomodate ECDSA
hashes.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-16 06:42:45 +00:00
Andrew Rybchenko
b59e9e4a81 sfxge(4): fix V1 licensing MCDI operations
Implementation of the MCDI commands for Siena boards was requesting
the wrong operation.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6370
2016-05-16 06:40:17 +00:00
Andrew Rybchenko
f6d61784ad sfxge(4): improve PCIe link speed and width check
Perform a more accurate check of whether the PCIe bandwidth is
sufficient for the current/supported port modes.

Give a different warning if there is sufficient bandwidth to achieve
line rate, but the link is not fast enough for optimal latency.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6369
2016-05-16 06:38:51 +00:00
Andrew Rybchenko
1bc27f39c5 sfxge(4): cleanup: make TLV scans quieter
Find end of segments in a more direct way that avoids an error report at
the terminator.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6367
2016-05-16 06:32:06 +00:00
Andrew Rybchenko
01215be22d sfxge(4): cleanup: make VPD lookups quieter
A lookup on a VPD entry which is missing reports several failure
messages as it propagates through wrapper functions. Restructured
the wrappers to treat this gracefully as an expected case.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6366
2016-05-16 06:26:18 +00:00
Andrew Rybchenko
7d4ce67a76 sfxge(4): cleanup: make licensing function quieter
Silent handling of failure to invoke functions that are not supported on
older licensing versions.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6365
2016-05-16 06:19:17 +00:00
Andrew Rybchenko
fc3a62cf60 sfxge(4): restructure efx_lic to support V3 licensing
Create separate implementations of the efx_lic API for each revision of
the licensing system. All processing of the V1/V2 license partition is
moved to efx_lic, and an implementation of V3 licensing uses the existing
TLV functions with extensions for writing new TLV entries.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6364
2016-05-16 06:17:56 +00:00
Andrew Rybchenko
1943fefa8f sfxge(4): remove unused EFX PHY symbols
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:20:08 +00:00
Andrew Rybchenko
0489c34fc2 sfxge(4): remove obsolete EFX_MON types
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:18:49 +00:00
Andrew Rybchenko
45de2df438 sfxge(4): remove unimplemented sensor reconfigure method
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:17:55 +00:00
Andrew Rybchenko
6faddc3444 sfxge(4): remove unimplemented sensor reset method
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:17:03 +00:00
Andrew Rybchenko
39abff47d7 sfxge(4): fix build with -Werror=pointer-sign
-Werror=pointer-sign is enabled in OmniOS GLD driver build.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:16:14 +00:00
Andrew Rybchenko
0c9092472f sfxge(4): remove unimplemented MAC reset method
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:14:28 +00:00
Andrew Rybchenko
34ce59874d sfxge(4): cleanup: remove unused define EFX_EVQ_FALCON_TIMER_QUANTUM_NS
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:13:24 +00:00
Andrew Rybchenko
05716a35e7 sfxge(4): cleanup: remove unused variable flags
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:12:26 +00:00
Andrew Rybchenko
8a53d16bd7 sfxge(4): remove unimplemented EFX PHY methods
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:06:48 +00:00
Andrew Rybchenko
2d9312f664 sfxge(4): import TLV layout from firmwaresrc
Submitted by:   Laurence Evans <levans at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:05:45 +00:00
Andrew Rybchenko
7a3e390b24 sfxge(4): remove obsolete EFSYS_OPT_PHY_PROPS option and APIs
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:04:29 +00:00
Andrew Rybchenko
d31404ab6f sfxge(4): remove PHY property method stubs
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:03:18 +00:00
Andrew Rybchenko
16e5d7bfd0 sfxge(4): move ef10 definitions to ef10_impl.h
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-14 06:02:00 +00:00
Andrew Rybchenko
d5bd0d6b06 sfxge(4): prepare for moving EF10 definitions to ef10_impl.h
Move legacy privilege masks near to their only user.
Move Huntington definitions to the top of hunt_impl.h to prepare
for moving the remaining EF10 definitions to ef10_impl.h.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6343
2016-05-14 06:00:00 +00:00
Andrew Rybchenko
f7aa4b3d07 sfxge(4): rename falconsiena_filter types
Falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6342
2016-05-14 05:59:18 +00:00
Andrew Rybchenko
1c159dbf25 sfxge(4): rename falconsiena_filter_*
Falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:17:38 +00:00
Andrew Rybchenko
96ffcdee44 sfxge(4): rename falconsiena_tx_*
Falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:16:29 +00:00
Andrew Rybchenko
d2df9a4e48 sfxge(4): rename falconsiena_rx_*
Falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:15:51 +00:00
Andrew Rybchenko
5cab4fc7dc sfxge(4): rename falconsiena_mac_*
Falcon support has been removed, so this code only supports Siena.

Reviewed by:    Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:15:02 +00:00
Andrew Rybchenko
e7b2e8b0ac sfxge(4): rename falconsiena_intr_*
falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:12:14 +00:00
Andrew Rybchenko
0f981da774 sfxge(4): rename falconsiena_ev_*
Falcon support has been removed, so this code only supports Siena.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:11:36 +00:00
Andrew Rybchenko
cc3897cf73 sfxge(4): move ef10_vpd_* to ef10_vpd.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:10:07 +00:00
Andrew Rybchenko
69fb4e16ea sfxge(4): move ef10_tx_* to ef10_tx.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:08:33 +00:00
Andrew Rybchenko
204d1d179e sfxge(4): move ef10_rx_* to ef10_rx.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:06:57 +00:00
Andrew Rybchenko
647112a4b3 sfxge(4): move ef10_phy_* to ef10_phy.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:05:40 +00:00
Andrew Rybchenko
dcab148366 sfxge(4): move ef10_nvram_* to ef10_nvram.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:04:28 +00:00
Andrew Rybchenko
31bf5f0399 sfxge(4): move ef10_nic_* to ef10_nic.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:03:04 +00:00
Andrew Rybchenko
e67df18431 sfxge(4): move ef10_mcdi_* to ef10_mcdi.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 07:00:46 +00:00
Andrew Rybchenko
9573ed00c6 sfxge(4): move ef10_mac_* to ef10_mac.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 06:59:20 +00:00
Andrew Rybchenko
57a2a11847 sfxge(4): move ef10_intr_* to ef10_intr.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 06:58:20 +00:00
Andrew Rybchenko
fc737285c3 sfxge(4): move ef10_filter_* to ef10_filter.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 06:57:08 +00:00
Andrew Rybchenko
f6078949da sfxge(4): move ef10_ev_* to ef10_ev.c
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-13 06:54:18 +00:00
Andrew Rybchenko
fe7e969e7a sfxge(4): comment on when we assume multicast chaining is available
It's the same on Medford as Huntington.

Multicast chaining is not always on, even with Medford, as it's not
supported by low latency firmware.

Unlike the Linux driver, we don't need to support virtulization with
firmware released before support for multicast chaining was added.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6319
2016-05-13 06:47:47 +00:00
Andrew Rybchenko
d0a97c000f sfxge(4): avoid duplicate delivery of packets when changing multicast mode with multicast chaining enabled
With multicast chaining, if e.g. a specific multicast filter is
inserted and the multicast mis-match filter is then inserted, both may
match a packet and cause it to be delivered.

Copy the behaviour of the Linux driver, which is to remove the old filters
first, on the basis that customers are more likely to be able to handle
drops than duplicates (see bug49178 comment 4).

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6331
2016-05-13 06:47:07 +00:00
Andrew Rybchenko
2681c0e9fe sfxge(4): update multicast filter insertion algorithm
When the multicast filters we're allowed to insert are controlled by the
hypervisor, it may be that we can insert some but not others. So we need
to have fallbacks where we insert any filters we can without rolling back
when one fails to insert.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6318
2016-05-12 06:20:26 +00:00
Andrew Rybchenko
ec831f7ff9 sfxge(4): cleanup: constify common code method tables
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6317
2016-05-12 06:19:06 +00:00
Andrew Rybchenko
8b94864213 sfxge(4): update unicast filter insertion algorithm
As unicast filters are not chained, we should always try to insert the
specific filter for our MAC address, and then try to insert the unicast
mis-match filter if that fails or all unicast has been requested.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6295
2016-05-11 06:29:07 +00:00
Andrew Rybchenko
47cb5106d2 sfxge(4): fix efx_filter_reconfigure parameter type
This caused signed/unsigned errors in some subsequent patches.
The only value passed to this is a uint32_t.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6294
2016-05-11 06:28:08 +00:00
Andrew Rybchenko
b7875d2cdd sfxge(4): make efx_sram_test Siena-only
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6293
2016-05-11 06:21:07 +00:00
Andrew Rybchenko
f634dfda66 sfxge(4): add new Emerald board sensors to common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6292
2016-05-11 06:19:53 +00:00
Andrew Rybchenko
95812f27e1 sfxge(4): simplify efx_mac_select
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6291
2016-05-11 06:19:05 +00:00
Andrew Rybchenko
0de035aa72 sfxge(4): remove Falcon specific EV_GLOBAL support
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6290
2016-05-11 06:18:15 +00:00
Andrew Rybchenko
a4983a11aa sfxge(4): remove Falcon-specific code paths from common code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6289
2016-05-11 06:16:53 +00:00
Andrew Rybchenko
f49cb708cd sfxge(4): add TLV format buffer manipulation functions for V3 licensing
The licensing partition for V3 licensing will use the standard TLV format,
so Medford licensing operations on the staging buffer are implemented using
the TLV functions.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6288
2016-05-11 06:15:07 +00:00
Andrew Rybchenko
a07bcda4ea sfxge(4): cleanup: fix typo
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 08:00:40 +00:00
Andrew Rybchenko
dcb49ebade sfxge(4): cleanup: remove unneeded include files
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:59:23 +00:00
Andrew Rybchenko
04bd9a165a sfxge(4): cleanup: remove unused efx_infer_family()
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:42:18 +00:00
Andrew Rybchenko
908ecfc65d sfxge(4): cleanup: remove obsolete common code module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:40:03 +00:00
Andrew Rybchenko
7bfe1d8677 sfxge(4): cleanup: fix typos
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:38:23 +00:00
Andrew Rybchenko
69a8775247 sfxge(4): cleanup efx_check.h comments and error messages
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:22:19 +00:00
Andrew Rybchenko
b18622c3b3 sfxge(4): remove EFSYS_OPT_PHY_TXC43128
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:21:14 +00:00
Andrew Rybchenko
ffb5b3947f sfxge(4): remove EFSYS_OPT_PHY_SFX7101
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:20:18 +00:00
Andrew Rybchenko
7d276678b9 sfxge(4): remove EFSYS_OPT_PHY_SFT9001
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:19:15 +00:00
Andrew Rybchenko
784995f8f3 sfxge(4): remove EFSYS_OPT_PHY_QT2025C
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:18:18 +00:00
Andrew Rybchenko
0c2328b0ad sfxge(4): remove EFSYS_OPT_PHY_QT2022C2
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:17:08 +00:00
Andrew Rybchenko
45a31c66ed sfxge(4): remove EFSYS_OPT_PHY_NULL
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:15:57 +00:00
Andrew Rybchenko
eaec7581ab sfxge(4): remove EFSYS_OPT_NVRAM_SFX7101
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:15:09 +00:00
Andrew Rybchenko
d9b66edc7e sfxge(4): remove EFSYS_OPT_NVRAM_SFT9001
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:13:45 +00:00
Andrew Rybchenko
6e85f167f6 sfxge(4): remove EFSYS_OPT_FALCON_BOOTROM
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:12:27 +00:00
Andrew Rybchenko
1c7fb9c767 sfxge(4): remove EFSYS_OPT_MON_NULL
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:11:09 +00:00
Andrew Rybchenko
3f20cf969d sfxge(4): remove EFSYS_OPT_MON_MAX6647
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:09:18 +00:00
Andrew Rybchenko
4060d2b031 sfxge(4): remove EFSYS_OPT_MON_LM87
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:08:40 +00:00
Andrew Rybchenko
16f997ae55 sfxge(4): remove EFSYS_OPT_MAC_FALCON_XMAC
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:07:49 +00:00
Andrew Rybchenko
56dae5be28 sfxge(4): remove EFSYS_OPT_MAC_FALCON_GMAC
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:06:44 +00:00
Andrew Rybchenko
53e1d37767 sfxge(4): remove EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:02:59 +00:00
Andrew Rybchenko
e75412c9cb sfxge(4): remove EFSYS_OPT_FALCON
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-10 07:01:06 +00:00
Andrew Rybchenko
0d38c77d19 sfxge(4): add TLV item manipulation functions to common code
Add creation, deletion and checksumming operations to the private copy of
TLV functions in the common code.  Functions added in preparation for V3
licensing support, as licensing keys are stored in the TLV format.  Missing
support for multiple segment partitions added. Annotations for Windows code
analysis also updated.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6264
2016-05-10 06:53:38 +00:00
Andrew Rybchenko
5abce2b919 sfxge(4): restructure TLV buffer validation
Move TLV buffer validation into ef10-specific function and add accessor
function which also converts the partition ID to the internal
representation.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6263
2016-05-10 06:51:20 +00:00
Andrew Rybchenko
ca738e7a95 sfxge(4): remove EFSYS_OPT_PCIE_TUNE
With the removal of Falcon support, this is now dead code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-09 08:38:56 +00:00
Andrew Rybchenko
5af774cbaf sfxge(4): disable common code support for Falcon
This patch ensures that client code will fail to build
with Falcon support. Following patches remove Falcon
support code entirely.

sfxge(4) has never supported Falcon.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-09 08:37:42 +00:00
Andrew Rybchenko
aa7e294253 sfxge(4): cleanup: fix obsolete EFSYS_OPT_PHY_BIST option
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-09 08:35:08 +00:00
Andrew Rybchenko
edf6d8af7a sfxge(4): Siena no longer supports EFSYS_OPT_PCIE_TUNE
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-09 08:32:49 +00:00
Andrew Rybchenko
cc22e260bb sfxge(4): remove unused efx_nic_pcie_extended_sync()
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
2016-05-09 08:28:52 +00:00
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Andrew Rybchenko
341134426f sfxge(4): do not use RxQ index as label
Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts.
Since only one RxQ is running over each EvQ, zero label may be used.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
PR:             208267
Differential Revision:  https://reviews.freebsd.org/D6121
2016-04-28 06:20:43 +00:00
Pedro F. Giffuni
057b4402bf sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2016-04-26 15:03:15 +00:00
Edward Tomasz Napierala
9b0488ed2a Remove NULL checks after M_WAITOK allocations, which - by definition - can
never return NULL.

Reviewed by:	arybchik@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5773
2016-03-31 13:20:02 +00:00
Andrew Rybchenko
1e76f8b895 sfxge: implement SIOCGI2C to read information from phy modules
The IOCTL is used by 'ifconfig -v' to show SFP+/QSFP+ information
including inventory information and dianostics (temperature, light
levels, voltage etc).

Reviewed by:    gnn,melifaro
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D5240
2016-02-10 12:14:56 +00:00
Gleb Smirnoff
8ec07310fa These files were getting sys/malloc.h and vm/uma.h with header pollution
via sys/mbuf.h
2016-02-01 17:41:21 +00:00
Gleb Smirnoff
009d75e764 Use m_getjcl() instead of manually selecting zone.
Reviewed by:	arybchik
2016-01-28 16:51:56 +00:00
Andrew Rybchenko
a63987426f sfxge: refresh version to note matching version of out-of-tree driver
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-20 06:56:18 +00:00
Andrew Rybchenko
d2a37b9c9d sfxge: cleanup: support __out_bcount_part[_opt] PREfast annotations
New annotation coming into use in the common code. Support its use by
adding null macro definitions for non-Windows platforms.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
X-MFC with:     r293901
2016-01-20 06:50:30 +00:00
Andrew Rybchenko
c0b9f85bd6 sfxge: improve error handling in ef10_ev_rx()
Ensure that checksum flags and L3/L4 fields are ignored
if lower level errors are reported in the event.

Remove checks for CRC0_ERR (bad iSCSI header CRC) and
CRC1_ERR (bad iSCSI payload or FCoE/FCoIP CRC) as they
are not used by any existing code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4975
2016-01-19 06:07:39 +00:00
Andrew Rybchenko
9ad7e03f72 sfxge: select whether to read current or backup partition in Medford A/B scheme
The dynamic config on Medford is stored using two partitions in flash, and at
any time one is the 'current' partition, used to provide the active config,
and the other 'backup' partition is used for writes.  This means that there
are two potential partitions that can be used to service reads, and which is
required can depend on, for example, whether the read is to get the current
contents or to verify a write.

When the partition write lock is held, the default behaviour is to read from
the backup partition, which was wrong for most reads in the common code which
require the current partition. This change allows the current partition to be
read whilst the write lock is held.
There is one read in Manftest which needs the backup partition.

ef10_nvram_partn_read_mode() is created to avoid changing
ef10_nvram_partn_read() which shares a prototype with the equivalent Falcon
and Siena methods.

MC_CMD_NVRAM_READ_IN_V2 adds an extra field, but firmware which doesn't support
it just ignores it.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4974
2016-01-19 06:03:44 +00:00
Andrew Rybchenko
e78e1b4ddc sfxge: regenerate EF10 registers definition for Medford
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:59:00 +00:00
Andrew Rybchenko
199852a593 sfxge: fix unused function warning
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:54:15 +00:00
Andrew Rybchenko
e76a641b7a sfxge: regenerate siena_flash.h from FW sources
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:45:45 +00:00
Andrew Rybchenko
3e83cbac2a sfxge: cleanup: remove extra empty lines
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:39:06 +00:00
Andrew Rybchenko
5a59cbc95e sfxge: highlight that descriptor cache sizes are configured using TLV now
Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:38:21 +00:00
Andrew Rybchenko
8b18714db0 sfxge: support RFID-selectable segments of dynamic configuration
tlv_partition_header has field *preset* to support RFID-selectable
segments of dynamic configuration

Submitted by:   Mateusz Wrzesinski <mwrzesinski at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:33:15 +00:00
Andrew Rybchenko
08c5af79d9 sfxge: if supported by firmware, use enhanced SET_MAC command to only configure the MTU
This allows an MTU change to be requested on unpriviliged functions
without also setting all the other parameters supported by MC_CMD_SET_MAC.

The enhanced SET_MAC command was introduced in v4_7 firmware.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4958
2016-01-18 06:19:28 +00:00
Andrew Rybchenko
6d0b856c80 sfxge: convert nvram set_version method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:18:01 +00:00
Andrew Rybchenko
9218711910 sfxge: convert nvram get_version method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:16:51 +00:00
Andrew Rybchenko
eb9703da94 sfxge: convert nvram rw_finish method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-18 06:14:43 +00:00
Andrew Rybchenko
134c4c4a6c sfxge: convert nvram write method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4961
2016-01-18 06:13:09 +00:00
Andrew Rybchenko
b60ff8405f sfxge: convert nvram erase method to use partition id
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4957
2016-01-17 05:12:37 +00:00
Andrew Rybchenko
6de7c598a4 sfxge: check the RX DMA end padding configuration on Medford
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/D4952
2016-01-15 15:20:26 +00:00
Andrew Rybchenko
0afdf29c97 sfxge: convert nvram read method to use partition id
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/D4951
2016-01-15 15:19:18 +00:00
Andrew Rybchenko
c15d6d2120 sfxge: rename Huntington MAC methods to EF10 and use for Medford
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/D4950
2016-01-15 15:17:44 +00:00
Andrew Rybchenko
ee2812ad09 sfxge: rename common hunt PHY methods to ef10 and use for Medford
Leaving BIST methods for now as, though the Medford bootrom now has lots
of BIST support, production firmware doesn't appear to have been updated
yet.

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/D4949
2016-01-15 15:12:30 +00:00
Andrew Rybchenko
b936cc8d73 sfxge: cleanup: simplify ef10_get_datapath_caps
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/D4938
2016-01-15 06:30:46 +00:00
Andrew Rybchenko
5d846e8796 sfxge: convert nvram rw_start method to use partition id
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/D4937
2016-01-15 06:28:58 +00:00
Andrew Rybchenko
80af6f263c sfxge: Medford still needs fallback for no privilege mask
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/D4936
2016-01-15 06:27:51 +00:00
Andrew Rybchenko
739ebba619 sfxge: medford stores a single global copy of VPD
Not per PF copies as on Huntington.

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/D4935
2016-01-15 06:26:37 +00:00
Andrew Rybchenko
a45a0da19c sfxge: support FATSOv2
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4934
2016-01-15 06:25:26 +00:00
Andrew Rybchenko
1935b20b5a sfxge: rework MCDI request completion
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/D4933
2016-01-15 06:23:04 +00:00
Andrew Rybchenko
177347ddfb sfxge: rename hunt_link_state_t to ef10_link_state_t
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/D4932
2016-01-15 06:21:39 +00:00
Andrew Rybchenko
0ed660ee94 sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting
The "mcdi_err_arg" probe still reports results of failed MCDI
commands, unless the caller invoked efx_mcdi_execute_quiet().

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/D4919
2016-01-14 09:20:25 +00:00
Andrew Rybchenko
0c848230f7 sfxge: add accessors for license-related MCDI calls to common code
Add support for Huntington MCDI licensing interface to common code.
Ported from Linux net driver IOCTL functions with restructuring for
initial support for V3 licensing API.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4918
2016-01-14 09:19:28 +00:00
Andrew Rybchenko
dc5427fc70 sfxge: add table entries for License NVRAM partition
Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4917
2016-01-14 09:14:40 +00:00
Andrew Rybchenko
410298b138 sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity
Fix an explanatory comment which did not explain very well.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4916
2016-01-14 09:12:40 +00:00
Andrew Rybchenko
72cda83214 sfxge: fix common code VPD iterator and duplicate tag verification
Fix efx_vpd_hunk_next() which has -- since its inception -- failed to
correctly iterate over the tags and keywords contained in the VPD data.
Only the first tag or keyword would be returned and the next call with
*contp == 1 would walk to the end of the data and finish.

This was spotted when fixing up errors spotted by Prefast code analysis
(which neglected to set all of the out parameters in all successful cases)

Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of
correctly iterating over all the tags and keywords) was failing as it
detected that both the static VPD and dynamic VPD storage contained an
RV keyword in the VPD-R tag.  This is intentional as the static VPD and
dynamic VPD are stored separately (firmware merges their contents and
computes a new RV keyword checksum for the data readable from the VPD
capability in PCIe configuration space).

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/D4915
2016-01-14 09:11:20 +00:00
Andrew Rybchenko
ac23c34a9f sfxge: use correct register definitions for setting interrupt moderation on Medford
The only value which has changed is the number of rows
(ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS)
but that isn't used, so this shouldn't change behaviour.

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/D4913
2016-01-14 09:07:40 +00:00
Andrew Rybchenko
4ab4936911 sfxge: support FATSOv2 in common code
Sponsored by:   Solarflare Communications, Inc.
Reviewed by:    gnn
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4912
2016-01-14 09:05:51 +00:00
Andrew Rybchenko
0a91bc3ff4 sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE
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/D4911
2016-01-14 09:03:02 +00:00
Andrew Rybchenko
56bd83b0c5 sfxge: convert nvram size method to use partition id
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/D4910
2016-01-14 09:01:53 +00:00
Andrew Rybchenko
fd7501bf79 sfxge: rework MCDI start request
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/D4909
2016-01-14 09:00:35 +00:00
Andrew Rybchenko
cfa023eb90 sfxge: add Medford NIC methods
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/D4908
2016-01-14 08:59:38 +00:00
Andrew Rybchenko
6e4d48127c sfxge: cleanup: fix return code types
Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
2016-01-13 08:09:28 +00:00