Commit Graph

417 Commits

Author SHA1 Message Date
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