The period should be taken into account by the function which
refreshes driver stats.
Reviewed by: philip
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9130
Firmware version which takes PERIOD_MS parameter into account is
required.
Reviewed by: philip
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9129
Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).
If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors. If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9120
Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.
Reviewed by: philip
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9061
It is safer to consider EFX_LINK_UNKNOWN as link down.
link_mode is set to EFX_LINK_UNKNOWN on port stop and fini.
Reviewed by: philip
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D9060
This allows the common code to use the correct type for the lock state
local variable passed to EFSYS_LOCK() and EFSYS_UNLOCK().
On Windows, this allows warning supression pragmas to be removed.
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Wake-on-lan is not supported in production on any of our adapters, as
they don't have the required AUX power connector. (It's possible that
AUX power is supplied to some of our ALOM or mezz adapters, but if so
then we've never implemented or tested WoL support.)
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8972
The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.
To fix it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return the
required length
- ensure that the list contents are valid and add comments
describing it
It is safe to change this API as, unsuprisingly, it has no users.
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/D8971
Manftest needs to know exactly what went wrong with the verified update
so that failing boards can be correctly diagnosed.
Submitted by: Tom Millington <tmillington at solarflare.com>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8969
In newer firmware that supports multithreaded MCDI processing,
longer running commands may be run ina background thread. Add
support for drivers to query the appropriate timeout for each
MCDI request.
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/D8968
Poll-mode driver does not use interrupts and number of used event queues
should not be limitted by the number of interrupts allocated for the
NIC.
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D8967
ICC complains that enumerated type mixed with another type.
Found by DPDK upstream build sanity check.
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D8954
It is not 100% correct to assign non-enum values to enum type
variables.
Found by ICC build (DPDK PMD upstreaming).
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D8953
It is not safe to push TSO option descriptors if pacer bypass is
enabled, so to make sure that doesn't happen never push TSO option
descriptors.
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/D8952
The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the
individual/group bit of the MAC address (with the two cases being
distingusished by the MAC address in the filter specification) was
introduced to mirror the Linux driver filtering code, but the
implementations are different enough anyway that it isn't of much value.
Having separate flags for unknown unicast and multicast simplifies
the code and allows the set of flags to match those used by MCDI.
It will also makes it easier to report whether these filters are
supported.
In the MCDI definitions, the unknown multicast and unicast flags have
the values 0x40000000 and 0x80000000 respectively, and so using the
same values for simplicity requires 32 bits in the filter specification
to store the flags. This means the structure is now a little bigger
than 64 bytes, but filters are not often used on critical paths so this
shouldn't have much impact - on Linux they are also bigger than they
used to be.
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/D8951
It is required to minimize RxQ context in the driver or avoid chaising
for the NIC handle in adapter (global per-interface) structure.
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D8950
The semantics of the MCDI interfacve require reading the first
dword of the header before any other data in the buffer. Add
a barrier to the common code MCDI handler to enforce this.
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/D8949
The port mask used for per-port sensors in mcdi_sensor_map
assumes zero-based port numbering. The port mask used in
the code is based on the one-based MCDI port number.
Fix this to lookup the correct per-port sensors, and to
allow reporting of sensor events from higher port numbers.
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/D8947
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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