History log of /freebsd-current/sys/dev/ixl/if_ixl.c
Revision Date Author Comments
# 51e23514 16-Aug-2023 Marius Strobl <marius@FreeBSD.org>

iflib drivers: Constify PCI ID LUTs

Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready
for this change.
While at it, make isc_driver_version strings (static) const where
not apparently un-const on purpose, too.
This reduces the size of the amd64 GENERIC by about 10 KiB.


# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# ba2f531f 20-Jul-2023 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Add link state polling

In some cases driver may ask FW about link state before FW finishes
configuration of a (Q)SFP+ transceiver. If first attempt of using Get Link
Status AQC after loading driver or handling a reset fails, then re-try
periodically for 5 seconds.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Tested by: jeffrey.e.pieper@intel.com
Approved by: erj@
MFC after: 2 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D40899


# b8f51b8c 06-Jun-2023 Piotr Kubaj <pkubaj@FreeBSD.org>

ixl: port ice's atomic API to ixl

Differential Revision: https://reviews.freebsd.org/D40532
Approved by: erj


# 1d02c6b1 15-Feb-2023 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Fix MAC/VLAN filters accounting

- Account for a filter required to enable reception of untagged frames
while registering and unregistering VLANs to avoid trying to add more
filters than HW supports

- While adding MAC/VLAN filters, pre-set matching method field in the
Admin Queue Command response buffer to expected error value to work
around an issue with some FW versions, which do not update that field if
operation fails, and be able correctly track which filters were
configured in HW.

- Remove unused IXL_MAX_FILTERS macro definition

- Update number of available MAC/VLAN filters as in newer FW versions it
was decreased by one.

- Simplify i40e_dma_mem structure

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by: erj@
Tested by: Gowtham Kumar Ks <gowtham.kumar.ks@intel.com>
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D37457


# 40791290 22-Jun-2022 Elliott Mitchell <ehem+freebsd@m5p.com>

ixl: purge EOL release compatibility

Drop code that differentiated between FreeBSD 10 and 11.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560


# 402810d3 20-Oct-2021 Justin Hibbits <jhibbits@FreeBSD.org>

Convert iflib(4) and iflib-based drivers to the DrvAPI

Summary:
Convert iflib(4) and the following drivers:
* axgbe
* em
* ice
* ixl
* vmxnet

Sponsored by: Juniper Networks, Inc.
Reviewed by: kbowling, #iflib
Differential Revision: https://reviews.freebsd.org/D37768


# 17859d53 06-Dec-2022 Andrew Gallatin <gallatin@FreeBSD.org>

ixl: silence runtime warning when PCI_IOV is not enabled

When PCI_IOV is not enabled, do not attempt to call
iflib_softirq_alloc_generic(...IFLIB_INTR_IOV), as it results
in boot-time warnings similar to:
taskqgroup_attach_cpu: qid not found for iov cpu=2
ixl2: taskqgroup_attach_cpu failed 22
Instead, make it conditional on PCI_IOV like the other
SR-IOV related code.

Reviewed by: erj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D37609


# b7b40e4a 24-May-2022 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Add support for I710 devices and remove non-inclusive language

Intel introduces a new line of 1G Ethernet adapters
with Device ID 0x0DD2. While at that also remove
non-inclusive language.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by: kbowling@
Tested by: gowtham.kumar.ks@intel.com
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34924


# 83c0a9e8 06-May-2022 John Baldwin <jhb@FreeBSD.org>

iavf/ice/ixl: Remove unused devclass arguments to DRIVER_MODULE.


# d7125850 19-Nov-2021 Gordon Bergling <gbe@FreeBSD.org>

ixl(4): Fix a typo in a sysctl description

MFC after: 3 days


# abf77452 13-Sep-2021 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Fix 2.5 and 5G speeds reporting and update shared code

Fix 2.5 and 5G speeds reporting and update shared code with recent
changes:
- Update expected FW API versions for X710 and X722 adapters
- Define pointers related to Preservation Rules Module
- Add definitions for Shadow RAM pointers to new modules: 5th and 6th
FPA, and Preservation Rules Module.
- Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know
opcode for parser aborted packets.
- Add the new filter types needed for custom cloud filters.
- Add support for Minimum Rollback Revision
- Fix RX_ONLY mode for unicast promiscuous on VLAN
- Add EEE LPI status check for X722 adapters
- Fix PHY type identifiers for 2.5G and 5G adapters
- Fix update link data for X722
- Increase the timeout value for PF reset to give PF more time to finish
reset if it is loaded with filters.
- Added support for Min Rollback Revision for 4 more X722 modules
- Fix reporting of Active Optical Cable media type
- Add flags and fields for double VLAN processing
- Fix potentially uninitialized variables in NVM code

Reviewed by: kbowling@, mike.jakubik@gmail.com
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D31565


# c4622b01 20-Aug-2021 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Fix reporting of unqualified transceivers

When link_active_on_if_down flag is disabled and link is brought down
with ifconfig, FW reports a false positive link event about an
unqualified transceiver. The condition used in the driver to filter out
those false positive events was incorrect and caused that unqualified
module event to also not be reported when the event was valid.

Change the condition to rely on IFF_UP flag instead of
link_active_on_if_down and bump driver version to 2.3.1-k.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by: stallamr@netapp.com, erj@
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D30733


# 20a52706 05-Apr-2021 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Add tunable to override Flow Control settings

Add flow_control to hw.ixl tunables tree to let override
initial flow control configuration for all interfaces.
Keep using configuration set by NVM by default.

Reviewed by: erj@, gallatin@
Tested by: gowtham.kumar.ks_intel.com
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D29338


# ffe3def9 07-Mar-2021 Mark Johnston <markj@FreeBSD.org>

iflib: Make if_shared_ctx_t a pointer to const

This structure is shared among multiple instances of a driver, so we
should ensure that it doesn't somehow get treated as if there's a
separate instance per interface. This is especially important for
software-only drivers like wg.

DEVICE_REGISTER() still returns a void * and so the per-driver sctx
structures are not yet defined with the const qualifier.

Reviewed by: gallatin, erj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29102


# 21802a12 02-Mar-2021 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Add ability to control link state on ifconfig down

Add sysctl link_active_on_if_down, which allows user to control
if interface is kept in active state when it is brought
down with ifconfig. Set it to enabled by default to preserve
backwards compatibility.

Reviewed by: erj
Tested by: gowtham.kumar.ks@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28028


# 7d4dceec 03-Feb-2021 Krzysztof Galazka <krzysztof.galazka@intel.com>

ixl(4): Fix VLAN HW filtering

X700 family of controllers has limited number of available VLAN
HW filters. Driver did not handle properly a case when user
assigned more VLANs to the interface which had all filters
already in use. Fix that by disabling HW filtering when
it is impossible to create filters for all requested VLANs.
Keep track of registered VLANs using bitstring to be able
to re-enable HW filtering when number of requested VLANs
drops below the limit.

Also switch all allocations to use M_IXL malloc type
to ease detecting memory leaks in the driver.

Reviewed by: erj
Tested by: gowtham.kumar.ks@intel.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28137


# 38bfc6de 01-Feb-2021 Sai Rajesh Tallamraju <stallamr@netapp.com>

iflib: Free resources in a consistent order during detach

Memory and PCI resources are freed with no particular order. This could
cause use-after-frees when detaching following a failed attach. For
instance, iflib_tx_structures_free() frees ctx->ifc_txqs[] but
iflib_tqg_detach() attempts to access this array. Similarly, adapter
queues gets freed by IFDI_QUEUES_FREE() but IFDI_DETACH() attempts to
access adapter queues to free PCI resources.

MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D27634


# 81be6552 18-Dec-2020 Matt Macy <mmacy@FreeBSD.org>

iflib: ensure that tx interrupts enabled and cleanups

Doing a 'dd' over iscsi will reliably cause stalls. Tx
cleaning _should_ reliably happen as data is sent.
However, currently if the transmit queue fills it will
wait until the iflib timer (hz/2) runs.

This change causes the the tx taskq thread to be run
if there are completed descriptors.

While here:

- make timer interrupt delay a sysctl

- simplify txd_db_check handling

- comment on INTR types

Background on the change:

Initially doorbell updates were minimized by only writing to the register
on every fourth packet. If txq_drain would return without writing to the
doorbell it scheduled a callout on the next tick to do the doorbell write
to ensure that the write otherwise happened "soon". At that time a sysctl
was added for users to avoid the potential added latency by simply writing
to the doorbell register on every packet. This worked perfectly well for
e1000 and ixgbe ... and appeared to work well on ixl. However, as it
turned out there was a race to this approach that would lockup the ixl MAC.
It was possible for a lower producer index to be written after a higher one.
On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial
response was to add a lock around doorbell writes - fixing the problem but
adding an unacceptable amount of lock contention.

The next iteration was to use transmit interrupts to drive delayed doorbell
writes. If there were no packets in the queue all doorbell writes would be
immediate as the queue started to fill up we could delay doorbell writes
further and further. At the start of drain if we've cleaned any packets we
know we've moved the state machine along and we write the doorbell (an
obvious missing optimization was to skip that doorbell write if db_pending
is zero). This change required that tx interrupts be scheduled periodically
as opposed to just when the hardware txq was full. However, that just leads
to our next problem.

Initially dedicated msix vectors were used for both tx and rx. However, it
was often possible to use up all available vectors before we set up all the
queues we wanted. By having rx and tx share a vector for a given queue we
could halve the number of vectors used by a given configuration. The problem
here is that with this change only e1000 passed the necessary value to have
the fast interrupt drive tx when appropriate.

Reported by: mav@
Tested by: mav@
Reviewed by: gallatin@
MFC after: 1 month
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D27683


# 2984a8dd 01-Sep-2020 Eric Joyner <erj@FreeBSD.org>

ixl(4): Add support for X710-T*L devices

Add support for new devices which are capable of 2.5 and 5G speeds, as well as
Energy Efficient Ethernet (EEE):

- introduce new device ids
- add ability to select 2.5 and 5G speeds on devices which support it
- add sysctls to enable EEE and read related statistics

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: #IntelNetworking
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D25549


# b4a7ce06 09-Jun-2020 Eric Joyner <erj@FreeBSD.org>

ixl(4): Add FW recovery mode support and other things

Update the iflib version of ixl driver based on the OOT version ixl-1.11.29.

Major changes:

- Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c
to simplify code sharing between legacy and iflib version of driver

- Add support for most recent FW API version (1.10), which extends FW
LLDP Agent control by user to X722 devices

- Improve handling of device global reset

- Add support for the FW recovery mode

- Use virtchnl function to validate virtual channel messages instead of
using separate checks

- Fix MAC/VLAN filters accounting

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: erj@
Tested by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after: 1 week
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D24564


# cf150917 11-May-2020 Eric Joyner <erj@FreeBSD.org>

em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib method

Pursuant to r360398, implement driver-specific versions of the
ifdi_needs_restart iflib device method.

Some (if not most?) Intel network cards don't need reinitializing when a
VLAN is added or removed from the device hardware, so these implement
ifdi_needs_restart in a way that tell iflib not to bring the interface
up or down when a VLAN is added or removed, regardless of whether the
VLAN_HWFILTER interface capability flag is set or not.

This could potentially solve several PRs relating to link flaps that
occur when VLANs are added/removed to devices.

Signed-off-by: Eric Joyner <erj@freebsd.org>

PR: 240818, 241785
Reviewed by: gallatin@, olivier@
MFC after: 3 days
MFC with: r360398
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D24659


# c65f571c 05-Mar-2020 Leandro Lupori <luporl@FreeBSD.org>

ixl: Add missing conversions from/to LE16

This fixes some errors on PPC64, during attach and when trying to assign an IP
to an interface. With this change, basic operation of X710 NICs is now
possible.

This also fixes builds with IXL_DEBUG enabled

Reviewed by: erj
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23975


# 20b91f0a 24-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (15 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.


# ab43ce7a 02-Jan-2020 Eric Joyner <erj@FreeBSD.org>

ixl: prevent non-privileged access to NVM update interface

Add a privilege check to the ixl_handle_nvmupd_cmd function, ensuring
that only privileged users are allowed to access the NVM update
interface.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reported by: markj@
Reviewed by: markj@, erj@, jeffrey.e.pieper@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D22870


# ba76aa63 14-Oct-2019 Gleb Smirnoff <glebius@FreeBSD.org>

Convert if_foreach_llmaddr() KPI.

Reviewed by: erj


# af06fa26 14-Feb-2019 Eric Joyner <erj@FreeBSD.org>

ixl: Fix panic caused by bug exposed by r344062

Don't use a struct if_irq for IFLIB_INTR_IOV type interrupts since that results
in get_core_offset() being called on them, and get_core_offset() doesn't
handle IFLIB_INTR_IOV type interrupts, which results in an assert() being triggered
in iflib_irq_set_affinity().

PR: 235730
Reported by: Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after: 1 day
Sponsored by: Intel Corporation


# b97de13a 30-Jan-2019 Marius Strobl <marius@FreeBSD.org>

- Stop iflib(4) from leaking MSI messages on detachment by calling
bus_teardown_intr(9) before pci_release_msi(9).
- Ensure that iflib(4) and associated drivers pass correct RIDs to
bus_release_resource(9) by obtaining the RIDs via rman_get_rid(9)
on the corresponding resources instead of using the RIDs initially
passed to bus_alloc_resource_any(9) as the latter function may
change those RIDs. Solely em(4) for the ioport resource (but not
others) and bnxt(4) were using the correct RIDs by caching the ones
returned by bus_alloc_resource_any(9).
- Change the logic of iflib_msix_init() around to only map the MSI-X
BAR if MSI-X is actually supported, i. e. pci_msix_count(9) returns
> 0. Otherwise the "Unable to map MSIX table " message triggers for
devices that simply don't support MSI-X and the user may think that
something is wrong while in fact everything works as expected.
- Put some (mostly redundant) debug messages emitted by iflib(4)
and em(4) during attachment under bootverbose. The non-verbose
output of em(4) seen during attachment now is close to the one
prior to the conversion to iflib(4).
- Replace various variants of spelling "MSI-X" (several in messages)
with "MSI-X" as used in the PCI specifications.
- Remove some trailing whitespace from messages emitted by iflib(4)
and change them to consistently start with uppercase.
- Remove some obsolete comments about releasing interrupts from
drivers and correct a few others.

Reviewed by: erj, Jacob Keller, shurd
Differential Revision: https://reviews.freebsd.org/D18980


# 37761e2e 08-Nov-2018 Eric Joyner <erj@FreeBSD.org>

ixl/iavf(4): Fix TSO offloads when TXCSUM is disabled

From Jake:
The iflib stack does not disable TSO automatically when TXCSUM is
disabled, instead assuming that the driver will correctly handle TSOs
even when CSUM_IP is not set.

This results in iflib calling ixl_isc_txd_encap with packets which have
CSUM_IP_TSO, but do not have CSUM_IP or CSUM_IP_TCP set. Because of
this, ixl_tx_setup_offload will not setup the IPv4 checksum offloading.

This results in bad TSO packets being sent if a user disables TXCSUM
without disabling TSO.

Fix this by updating the ixl_tx_setup_offload function to check both
CSUM_IP and CSUM_IP_TSO when deciding whether to enable IPv4 checksums.

Once this is corrected, another issue for TSO packets is revealed. The
driver sets IFLIB_NEED_ZERO_CSUM in order to enable a work around that
causes the ip->sum field to be zero'd. This is necessary for ixl
hardware to correctly perform TSOs.

However, if TXCSUM is disabled, then the work around is not enabled, as
CSUM_IP will not be set when the iflib stack checks to see if it should
clear the sum field.

Fix this by adding IFLIB_TSO_INIT_IP to the iflib flags for the iavf and
ixl interface files.

It is uncertain if the hardware needs IFLIB_NEED_ZERO_CSUM for any other
case besides TSO, so leave that flag assigned. It may be worth
investigating to see if this work around flag could be disabled in
a future change.

Once both of these changes are made, the ixl driver should correctly
offload TSO packets when TSO4 offload is enabled, regardless of whether
TXCSUM is enabled or disabled.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@, shurd@
MFC after: 0 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D17900


# 77c1fcec 12-Oct-2018 Eric Joyner <erj@FreeBSD.org>

ixl/iavf(4): Change ixlv to iavf and update it to use iflib(9)

Finishes the conversion of the 40Gb Intel Ethernet drivers to iflib(9) for
FreeBSD 12.0, and fixes numerous bugs in both ixl(4) and iavf(4).

This commit also re-adds the VF driver to GENERIC since it now compiles and
functions.

The VF driver name was changed from ixlv(4) to iavf(4) because the VF driver is
now intended to be used with future products, not just with Fortville/Fort Park
VFs.

A man page update that documents these drivers is forthcoming in a separate
commit.

Reviewed by: sbruno@, kbowling@
Tested by: jeffrey.e.pieper@intel.com
Approved by: re (gjb@)
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D16429


# 0dc34160 26-Sep-2018 Warner Losh <imp@FreeBSD.org>

Add PNP info to PCI attachments of cbb, cxgb, ida, iwn, ixl, ixlv,
mfi, mps, mpr, mvs, my, oce, pcn, ral, rl. This only labels existing
pci device tables, and has no probe / attach code changes.

Reviewed by: imp, chuck
Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com>
Sponsored by: Google, Inc. (GSoC 2018)
Approved by: re (glen)


# 7f87c040 15-Jul-2018 Marius Strobl <marius@FreeBSD.org>

Assorted TSO fixes for em(4)/iflib(9) and dead code removal:
- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
was committed in r295133, CSUM_TSO always got disabled unconditionally
by em(4) on the first invocation of em_init_locked(). However, even with
that problem fixed, it turned out that for at least e. g. 82579 not all
necessary TSO workarounds are in place, still causing MAC hangs even at
Gigabit speed. Thus, for stable/11, TSO usage was deliberately disabled
in r323292 (r323293 for stable/10) for the EM-class by default, allowing
users to turn it on if it happens to work with their particular EM MAC
in a Gigabit-only environment.
In head, the TSO workaround for speeds other than Gigabit was lost with
the conversion to iflib(9) in r311849 (possibly along with another one
or two TSO workarounds). Yet at the same time, for EM-class MACs TSO4
got enabled by default again, causing device hangs. Therefore, change the
default for this hardware class back to have TSO4 off, allowing users
to turn it on manually if it happens to work in their environment as
we do in stable/{10,11}. An alternative would be to add a whitelist of
EM-class devices where TSO4 actually is reliable with the workarounds in
place, but given that the advantage of TSO at Gigabit speed is rather
limited - especially with the overhead of these workarounds -, that's
really not worth it. [1]
This change includes the addition of an isc_capabilities to struct
if_softc_ctx so iflib(9) can also handle interface capabilities that
shouldn't be enabled by default which is used to handle the default-off
capabilities of e1000 as suggested by shurd@ and moving their handling
from em_setup_interface() to em_if_attach_pre() accordingly.
- Although 82543 support TSO4 in theory, the former lem(4) didn't have
support for TSO4, presumably because TSO4 is even more broken in the
LEM-class of MACs than the later EM ones. Still, TSO4 for LEM-class
devices was enabled as part of the conversion to iflib(9) in r311849,
causing device hangs. So revert back to the pre-r311849 behavior of
not supporting TSO4 for LEM-class at all, which includes not creating
a TSO DMA tag in iflib(9) for devices not having IFCAP_TSO4 set. [2]
- In fact, the FreeBSD TCP stack can handle a TSO size of IP_MAXPACKET
(65535) rather than FREEBSD_TSO_SIZE_MAX (65518). However, the TSO
DMA must have a maxsize of the maximum TSO size plus the size of a
VLAN header for software VLAN tagging. The iflib(9) converted em(4),
thus, first correctly sets scctx->isc_tx_tso_size_max to EM_TSO_SIZE
in em_if_attach_pre(), but later on overrides it with IP_MAXPACKET
in em_setup_interface() (apparently, left-over from pre-iflib(9)
times). So remove the later and correct iflib(9) to correctly cap
the maximum TSO size reported to the stack at IP_MAXPACKET. While at
it, let iflib(9) use if_sethwtsomax*().
This change includes the addition of isc_tso_max{seg,}size DMA engine
constraints for the TSO DMA tag to struct if_shared_ctx and letting
iflib_txsd_alloc() automatically adjust the maxsize of that tag in case
IFCAP_VLAN_MTU is supported as requested by shurd@.
- Move the if_setifheaderlen(9) call for adjusting the maximum Ethernet
header length from {ixgbe,ixl,ixlv,ixv,em}_setup_interface() to iflib(9)
so adjustment is automatically done in case IFCAP_VLAN_MTU is supported.
As a consequence, this adjustment now is also done in case of bnxt(4)
which missed it previously.
- Move the reduction of the maximum TSO segment count reported to the
stack by the number of m_pullup(9) calls (which in the worst case,
can add another mbuf and, thus, the requirement for another DMA
segment each) in the transmit path for performance reasons from
em_setup_interface() to iflib_txsd_alloc() as these pull-ups are now
done in iflib_parse_header() rather than in the no longer existing
em_xmit(). Moreover, this optimization applies to all drivers using
iflib(9) and not just em(4); all in-tree iflib(9) consumers still
have enough room to handle full size TSO packets. Also, reduce the
adjustment to the maximum number of m_pullup(9)'s now performed in
iflib_parse_header().
- Prior to the conversion of em(4)/igb(4)/lem(4) and ixl(4) to iflib(9)
in r311849 and r335338 respectively, these drivers didn't enable
IFCAP_VLAN_HWFILTER by default due to VLAN events not being passed
through by lagg(4). With iflib(9), IFCAP_VLAN_HWFILTER was turned on
by default but also lagg(4) was fixed in that regard in r203548. So
just remove the now redundant and defunct IFCAP_VLAN_HWFILTER handling
in {em,ixl,ixlv}_setup_interface().
- Nuke other redundant IFCAP_* setting in {em,ixl,ixlv}_setup_interface()
which is (more completely) already done in {em,ixl,ixlv}_if_attach_pre()
now.
- Remove some redundant/dead setting of scctx->isc_tx_csum_flags in
em_if_attach_pre().
- Remove some IFCAP_* duplicated either directly or indirectly (e. g.
via IFCAP_HWCSUM) in {EM,IGB,IXL}_CAPS.
- Don't bother to fiddle with IFCAP_HWSTATS in ixgbe(4)/ixgbev(4) as
iflib(9) adds that capability unconditionally.
- Remove some unused macros from em(4).
- Bump __FreeBSD_version as some of the above changes require the modules
of drivers using iflib(9) to be recompiled.

Okayed by: sbruno@ at 201806 DevSummit Transport Working Group [1]
Reviewed by: sbruno (earlier version), erj
PR: 219428 (part of; comment #10) [1], 220997 (part of; comment #3) [2]
Differential Revision: https://reviews.freebsd.org/D15720


# c9da8d8b 12-Jul-2018 Eric Joyner <erj@FreeBSD.org>

ixl(4): Set baudrate on link up using proper link_speed variable

And remove old, now-completely unused link_speed variable.

Reported by: Jacob Keller <jacob.e.keller@intel.com>
MFC after: 1 month


# f4cc2d17 18-Jun-2018 Eric Joyner <erj@FreeBSD.org>

ixl(4): Update version number to 2.0.0-k

And update copyrights to current year.

MFC after: 1 month
Sponsored by: Intel Corporation


# 1031d839 18-Jun-2018 Eric Joyner <erj@FreeBSD.org>

ixl(4): Update to use iflib

Update the driver to use iflib in order to bring performance,
maintainability, and (hopefully) stability benefits to the driver.

The driver currently isn't completely ported; features that are missing:

- VF driver (ixlv)
- SR-IOV host support
- RDMA support

The plan is to have these re-added to the driver before the next FreeBSD release.

Reviewed by: gallatin@
Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com
Tested by: jeffrey.e.pieper@intel.com
MFC after: 1 month
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15577


# ceebc2f3 01-May-2018 Eric Joyner <erj@FreeBSD.org>

ixl(4): Update to 1.9.9-k

Refresh upstream driver before impending conversion to iflib.

Major changes:

- Support for descriptor writeback mode (required by ixlv(4) for AVF support)
- Ability to disable firmware LLDP agent by user (PR 221530)
- Fix for TX queue hang when using TSO (PR 221919)
- Separate descriptor ring sizes for TX and RX rings

PR: 221530, 221919
Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: #IntelNetworking
MFC after: 1 day
Relnotes: Yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D14985


# cb6b8299 09-Feb-2017 Eric Joyner <erj@FreeBSD.org>

ixl(4): Update to 1.7.12-k

Refresh upstream driver before impending conversion to iflib.

Major new features:

- Support for Fortville-based 25G adapters
- Support for I2C reads/writes

(To prevent getting or sending corrupt data, you should set
dev.ixl.0.debug.disable_fw_link_management=1 when using I2C
[this will disable link!], then set it to 0 when done. The driver implements
the SIOCGI2C ioctl, so ifconfig -v works for reading I2C data,
but there are read_i2c and write_i2c sysctls under the .debug sysctl tree
[the latter being useful for upper page support in QSFP+]).

- Addition of an iWARP client interface (so the future iWARP driver for
X722 devices can communicate with the base driver).
- Compiling this option in is enabled by default, with "options IXL_IW" in
GENERIC.

Differential Revision: https://reviews.freebsd.org/D9227
Reviewed by: sbruno
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 4294f337 07-Aug-2016 Sean Bruno <sbruno@FreeBSD.org>

ixl(4): Update to ixl-1.6.6-k.

Submitted by: erj
Reviewed by: jeffrey.e.pieper@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D7391


# 761e5261 06-Jul-2016 Sean Bruno <sbruno@FreeBSD.org>

Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by: arnaud.ysmal@stormshield.eu
Reviewed by: erj@freebsd.org
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7030


# aa874653 22-May-2016 Adrian Chadd <adrian@FreeBSD.org>

[ixl] fix build for RSS.

Untested.


# 6bb8f4f6 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Re-add a change to TC0 setup made in D5203.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# d4683565 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.27-k.

Changes:

Kevin Scott i40e-shared: Save off VSI resource count when updating VSI
Anjali Singhai Jain i40e-shared: Expose some registers to program parser, FD and RSS logic
Eric Joyner ixl: Fix errors in queue interrupt setup in MSIX mode.
Shannon Nelson i40e-shared: implement and use rx ctl helper functions
Shannon Nelson i40e-shared: don't use AQ calls from clear_hw
Eric Joyner ixl: Use rx ctl read/write functions instead of register accesses in certain places.
Shannon Nelson i40e-shared: add adminq commands for rx ctl registers
Shannon Nelson i40e-shared: implement and use rx ctl helper functions
Jeremiah Kyle i40e-shared: Corrected function name in comment block
Deepthi Kavalur i40e-shared: correcting a HW capability display info
Shannon Nelson i40e-shared: fixups for (Linux) upstream consistency
Eric Joyner ixl: Only stop firmware's LLDP agent on older firmware versions.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 6d011ad5 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.24-k.

Changes by author:

Eric Joyner ixl: Fix compile error when IXL_DEBUG is defined.
Eric Joyner ixl: Fix taskqueues created in init() not being freed in stop().
Eric Joyner ixl: Add additional debug sysctls, for Tx and Rx queue stats.
Eric Joyner ixl: Enable dynamic itr by default.
Eric Joyner ixl: Edit spacing, comments, function signatures (to conform to style(9)).
Eric Joyner ixl: Check for errors when tearing down msix interrupts.
Eric Joyner ixl: Remove unnecessary register reads/writes.
Eric Joyner ixl: Remove admin queue interrupt enable from general interrupt enable.
Eric Joyner ixl: Update switch config after teardown/reset flow in init().
Eric Joyner ixl: Add additional admin queue error code output to admin queue call errors.
Eric Joyner ixl: Don't destroy i40e spinlock if it's already uninitialized.
Shannon Nelson i40e-shared: clean event descriptor before use
Anjali Singhai Jain i40e-shared: When in promisc mode apply promisc mode to Tx Traffic as well
Kevin Scott i40e_shared: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit
Eric Joyner ixlv: Fix IXL_DEBUG compile issue.
Eric Joyner ixlv: Attempt to fix panic/other issues when rapidly unloading/loading driver.
Eric Joyner ixl/ixlv: Revert m_collapse() in ixl_xmit() to m_defrag().
Deepthi Kavalur i40e_shared: Trace logging HW capabilities
Eric Joyner ixlv: Correctly unlock/relock around init() call in vc_completion().
Eric Joyner ixl: Stop preventing changing flow control mode for CR4 media.
Eric Joyner ixl: Set IPv6 TCP offload flag when doing TSO.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 6c426059 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.20-k.

Changes by author:

Eric Joyner ixl: Add more error messages/checks to ixl_vsi_assign_msix().
Eric Joyner ixl/ixlv: Clarify a comment about descriptors.
Eric Joyner ixl/ixlv: Improve i40e_debug() implementation.
Eric Joyner ixl/ixlv: Remove unused ASSERT() macro; move struct around.
Eric Joyner ixl: Set initial advertised speed value in init_locked().
Eric Joyner ixl: Fix flow control sysctl value being stored when new value is invalid.
Eric Joyner Edit comments and spacing.
Carolyn Wyborny i40e-shared: Add functions to blink led on Coppervale PHY
Eric Joyner ixl: Re-do interrupt setup.
Eric Joyner ixl: Remove VFLR task setup from legacy flow.
Eric Joyner ixl: Shutdown/setup HMC when handling an EMPR reset.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 1d767a8e 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.17-k.

Changes:

Kiran Patil i40e-shared: APIs to Add/remove port mirroring rules
Shannon Nelson i40e-shared: add VEB stat control and remove L2 cloud filter
Eric Joyner ixl: Update NVM version information shown.
Eric Joyner ixl: Remove empty else block.
Eric Joyner ixl: Slightly re-work ixl_init_msix().
Eric Joyner ixl: Remove duplicate queue enablement.
Shannon Nelson i40e-shared: implement the API function for aq_set_switch_config
Eric Joyner ixl: Update nvm version string shown in sysctl.
Eric Joyner ixl/ixlv: Changes to PF/VF minor version checking/handling.
Eric Joyner ixlv: Reduce maximum wait time for responses to VF AQ messages.
Eric Joyner ixl/ixlv: Edit comments, comment out code, and edit spacing.
Eric Joyner ixl: Print log message when SR-IOV init is successful.
Eric Joyner ixl: Add Tx Flow Control filter from main PF VSI.
Eric Joyner ixlv: Add extra error message when ixlv_get_vf_config times out.
Eric Joyner ixl: Assign current MOCS optics the XLPPI media type.
Eric Joyner ixl: Remove conditional wait after link status event.
Eric Joyner ixl: Add line break and remove extraneous return statement.
Eric Joyner ixl: Allow 40G speeds in the advertise_speed sysctl.
Eric Joyner ixl: Add "CRC enable" field to link_status sysctl output.
Eric Joyner ixl: Move sbuf.h include out of IXL_DEBUG* defines.
Eric Joyner ixl: Move remaining debug sysctl funcs to IXL_DEBUG_SYSCTL define.
Eric Joyner ixl: Add cases for all remaining media types in shared code to media_status().

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 95bb0504 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.13-k.

Changes:

Shannon Nelson i40e-shared: set shared bit for multicast filters
Piotr Raczynski i40e-shared: Bump AQ minor version for FVL/FPK
Eric Joyner ixl: Remove call to i40e_aq_set_mac_config() in init path.
Eric Joyner ixl: Always add interface mac address to driver+hw filter list.
Eric Joyner ixl: Edit comments.
Eric Joyner ixl: Add more descriptive sysctl help messages.
Eric Joyner ixl: Report more info in link_status sysctl.
Eric Joyner ixl: Flip set_aq_phy_int_mask mask bits.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# fdb6f38a 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.12-k.

Changes by author:

Eric Joyner ixl: Remove substitution of EACCES for EPERM when perrno is set on an nvmupdate command return.
Eric Joyner ixl: Print message when hardware sends GRST interrupt.
Eric Joyner ixl: Fix kernel panic when driver fails to initialize admin queue.
Eric Joyner ixl: Print out messages when a non-handled other interrupt occurs.
Eric Joyner ixl: Fix spaces in a couple messages.
Eric Joyner ixl: Add lock around nvmupd command entry point and reconvert EPERM errors to EACCES.
Anjali Singhai Jain i40e-shared: Make some changes in the nvm read code
Shannon Nelson i40e-shared: AQ Add Run PHY Activity struct
Shannon Nelson i40e-shared: AQ Add Geneve cloud tunnel type
Shannon Nelson i40e-shared: AQ Add external power class to get link status response struct
Shannon Nelson i40e-shared: AQ Add shared resource flags for macvlan filters
Shannon Nelson i40e-shared: AQ Add set_switch_config
Shannon Nelson i40e-shared: AQ Add VXLAN-GPE tunnel type for cloud filter and tunnel commands
Shannon Nelson i40e-shared: AQ thermal sensor control struct
Shannon Nelson i40e-shared: Bump AQ minor version to 1.5 for FVL5 features
Shannon Nelson i40e-shared: add a little more to an NVM update debug message
Carolyn Wyborny i40e-shared: Fix for PHY NVM interaction problem
Eric Joyner i40e-shared: Add prototypes for private NVM write functions
Eric Joyner ixl/ixlv: Remove unused define from ixl.h.
Eric Joyner ixl: Add handling of EMP reset for nvm update purposes.
Eric Joyner ixl: Move addition of device sysctls to separate function.
Eric Joyner ixl: Fix up a couple error messages in ixl_attach().
Eric Joyner ixl: Update the hardware resource allocation debug sysctl.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 7f70bec6 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.9-k.

Changes by author:

Kamil Krawczyk i40e-shared: use explicit cast from u16 to u8
Anjali Singhai Jain i40e-shared: Add a Virtchnl offload for RSS PCTYPE V2
Eric Joyner ixl: Remove HP device IDs.
Jesse Brandeburg i40e-shared: add small bit of debug
Mitch Williams i40e-shared: check for stopped admin queue
Mitch Williams i40e-shared: set aq count after memory allocation
Jesse Brandeburg i40e-shared: remove forever unused ID
Eric Joyner ixl: Fix bug where RSS does not hash to more than 16 queues.
Shannon Nelson i40e-shared: define function capabilities in only one place
Eric Joyner ixl: Change spacing, comments, and a single error message.
Eric Joyner ixl: Save admin queue phy interrupt mask as a define.
Eric Joyner ixl: Move callout_reset() to later in init_locked(), and stop clearing OACTIVE in driver flags.
Eric Joyner ixl: Add new reset+build flow to init() if it detects that the admin queue is stopped.
Eric Joyner ixl: Return EACCES instead of EPERM when an nvmupdate command fails.
Eric Joyner ixl: Remove KX_A device ID.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 223d846d 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.7-k.

Changes by author:

Helin Zhang i40e_shared: Fix compilation error - pointer-arith
Paul M Stillwell Jr i40e-shared: Replace sprintf with i40e_debug
Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement
Jesse Brandeburg i40e-shared: remove useless assignments
Anjali Singhai Jain i40e-shared: Add a workaround to drop all flow control frames
Anjali Singhai Jain i40e-shared: Add new response struct from FW for AQ command i40e_aqc_lldp_set_local_mib
Anjali Singhai Jain i40e-shared: Acquire NVM, before issuing an AQ read nvm command
Eric Joyner ixl/ixlv: Remove unused MAX_LOOP define.
Eric Joyner ixl: Remove extra aq_get_link_info() call in attach().
Eric Joyner ixl: Modify a couple error messages in attach() to be more informative.
Eric Joyner ixl: Add i40e_get_link_status() call to init_locked().
Eric Joyner ixl: Move callout_stop() to earlier in ixl_stop().
Eric Joyner ixl: Add extra comments around link ITR code.
Eric Joyner ixl: Attempt to enhance link event handling.
Eric Joyner ixl: Style, spacing, and comment changes.
Eric Joyner ixl: Add I40E_NVM_ACCESS definition.
Eric Joyner ixl: Add interface for nvmupdate tool ioctl to driver.
Eric Joyner ixl: Don't strip out nvm update support from the driver anymore.
Eric Joyner ixl: Interrupts are now allocated/setup and torn down/released on init()/stop().

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# a48d00d2 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.6-k.

Changes by author:

Greg Rose ixl: Add MAC+VLAN filter for LAA MAC assignment
Carolyn Wyborny i40e_shared: fix for PHY NVM interaction problem
Anjali Singhai Jain i40e-shared: Fix an accidental error with BIT_ULL replacement
Eric Joyner ixl: Fix potential crash when loading driver a startup and cannot setup all requested MSIX vectors.
Eric Joyner ixl: Add max of 8 queues limit to autoconfig.
Eric Joyner ixl: Re-add ian@'s sysctl fixes from upstream (r280043).

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# ac83ea83 12-May-2016 Eric Joyner <erj@FreeBSD.org>

ixl: Update to 1.4.5-k.

This first update will revert some upstream changes; forthcoming updates will reinstate them.

Changes, by author:

Anjali Singhai Jain i40e-shared: Add WB_ON_ITR offload support
Shannon Nelson i40e-shared: fix phy_types bitmap type
Kevin Scott i40e-shared: Store off PHY capabilities
Shannon Nelson i40e-shared: fix byteswap of phy_type
Jingjing Wu i40e-shared: Fix compile issue related to const string
Greg Bowers i40e-shared: Add AQ defines for non-willing Apps (DCB)
Greg Bowers i40e-shared: Support for non-willing Apps (DCB)
Shannon Nelson i40e-shared: use upper-32 bit macro for address
Shannon Nelson i40e-shared: grab the AQ spinlocks before clearing registers
Eric Joyner ixl: Properly strip out X722_SUPPORT (temporarily).
Eric Joyner ixl: Allow Fort Pond devices to advertise 100M in set_advertise sysctl.

Differential Revision: https://reviews.freebsd.org/D6211
Reviewed by: sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after: 2 weeks
Sponsored by: Intel Corporation


# 648970d8 09-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

ixl(4): replace 0 with NULL for pointers.

Found by devel/coccinelle.

Differential Revision: https://reviews.freebsd.org/D5894
Reviewed by: erj


# eb4cd7cb 03-Mar-2016 Steven Hartland <smh@FreeBSD.org>

Fix ixl with RSS

Fix compilation of ixl when RSS option is set, broken by r295946

MFC after: 3 weeks
X-MFC-With: r295946
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5428


# e4c893dd 23-Feb-2016 Eric Joyner <erj@FreeBSD.org>

ixl(4)/ixlv(4): Remove a couple unnecessary register writes/flushes.

The one in ixl_xmit() has brought up to us as being unnecessary at least a
couple times.

Differential Revision: https://reviews.freebsd.org/D5208
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation


# e84c2dea 23-Feb-2016 Eric Joyner <erj@FreeBSD.org>

ixl(4): Fix potential driver interrupt setup issues and startup crash.

- Limit queue autoconfiguration to 8 queues to prevent the driver from
requesting a large number of MSI-X vectors at boot.

- Fix potential kernel panic that occurs when the driver loads and cannot
get all requested MSIX vectors. Instead, attach() will fail with an error.
- Move taskqueue setup to later in attach() to prevent having to free
taskqueues if some other error in attach() occurs.

Differential Revision: https://reviews.freebsd.org/D5205
MFC after: 1 month
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation


# 42d7398e 19-Feb-2016 Eric Joyner <erj@FreeBSD.org>

ixl(4): Fix errors in queue interrupt setup in MSIX mode.

- I40E_PFINT_DYN_CTLN needs to be cleared, and not have a queue index
written to it.
- The interrupt linked list for each queue is changed to only include
the queue's Rx and Tx queues.

Differential Revision: https://reviews.freebsd.org/D5206
Reviewed by: sbruno
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation


# 300d1454 19-Feb-2016 Eric Joyner <erj@FreeBSD.org>

ixl(4): Remove unsupported device IDs.

There is no official support for 20G SKUs on FreeBSD, and the KX_A
device ID was never used.

Differential Revision: https://reviews.freebsd.org/D5204
Reviewed by: sbruno, jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation


# c11f1016 19-Feb-2016 Eric Joyner <erj@FreeBSD.org>

ixl(4): Fix two important RSS bugs.

- Change tc_mapping field to assign 64 queues instead of 16 to the PF's VSI;
add comments to describe how this is done.

- Set hash lut size to 512 when setting filter control; the lut size defaults
to 128 if this isn't set.

Differential Revision: https://reviews.freebsd.org/D5203
Reviewed by: gallatin
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation


# 29899c0a 18-Feb-2016 Kevin Lo <kevlo@FreeBSD.org>

Add missing parentheses.

Found by: PVS-Studio


# 4088e743 29-Jan-2016 Steven Hartland <smh@FreeBSD.org>

Fix phy interrupts setup for ixl

Fix the inverted set of interrupts being used as the mask for ixl.

Without this ixl devices fail to detect link state changes.

Reviewed by: erj, sbruno
MFC after: 2 days
Sponsored by: Multiplay


# 1c66ead7 03-Jan-2016 Enji Cooper <ngie@FreeBSD.org>

Fix ixl(4) compilation with PCI_IOV pre-r266974

stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the
structure directly if the __FreeBSD_version is < 1100022, so the driver can
be built with PCI_IOV support on stable/10, without backporting all of
r266974 (which requires additional changes due to projects/ifnet, etc)

Differential Revision: https://reviews.freebsd.org/D4759
Reviewed by: erj, sbruno
Sponsored by: EMC / Isilon Storage Division


# 9cc0d056 12-Nov-2015 Steven Hartland <smh@FreeBSD.org>

Fix ixl debug sysctls panic

Remove the use of sbuf_data on drained sbufs from the debug sysctls:
* ixl_sysctl_hw_res_alloc
* ixl_sysctl_switch_config

This prevents a kernel panic when accessing these values under a kernel
compiled with INVARIANTS.

Sponsored by: Multiplay


# 2b70dea6 13-Oct-2015 Sean Bruno <sbruno@FreeBSD.org>

ixl(4): Remove compile warning for unused function.

sys/dev/ixl/if_ixl.c:4377:1: warning: unused function 'ixl_debug_info' [-Wunused-function]
ixl_debug_info(SYSCTL_HANDLER_ARGS)

Differential Revision: https://reviews.freebsd.org/D3718
Submitted by: bz


# 39020fdf 21-Jul-2015 Eric Joyner <erj@FreeBSD.org>

Fix for a customer issue with ixl(4):

- Add required MAC/VLAN filter when adding an LAA
- Fix bug where code did not check for I40E_SUCCESS from a successful
i40e_validate_mac_address() call in ixl_init_locked(), when setting
an LAA.

PR: 201240
Differential Revision: https://reviews.freebsd.org/D3111
Submitted by: Gregory Rose <gregory.v.rose@intel.com>
Reviewed by: gnn, rstone
Approved by: gnn
MFC after: 2 weeks


# 53aab9ea 19-Jun-2015 Andrew Gallatin <gallatin@FreeBSD.org>

Fix typo in baudrate initialization that was causing ixl to be seen as
a 4GbE NIC, rather than a 40GbE NIC.

Reviewed by: Eric Joyner <eric.joyner@intel.com>
MFC after: 3 days
Sponsored by: Netflix


# be771cda 05-Jun-2015 Jack F Vogel <jfv@FreeBSD.org>

Update SW4 to the Intel ixl/ixlv drivers. This is primarily a shared
code update, with supporting changes in the CORE. Changes for the extended
media types, VF driver has virtual channel protocol changes, and some
register use corrections. This software change should be coordinated with
Firmware updates to your hardware, contact your support channels for that.

MFC after: 1 week


# f3bb9251 28-May-2015 John Baldwin <jhb@FreeBSD.org>

Create a separate kobj interface for leaf-driver PCI IOV methods.

Leaf drivers should not import the PCI bus interface to add IOV handling.
Instead, move the IOV client methods to a separate kobj interface.

Differential Revision: https://reviews.freebsd.org/D2584
Reviewed by: rstone


# 4e8e1ebd 19-May-2015 John Baldwin <jhb@FreeBSD.org>

Remove executable property from several ixl(4) source files.

Differential Revision: https://reviews.freebsd.org/D2583
Reviewed by: erj


# 207e7228 15-Mar-2015 Ian Lepore <ian@FreeBSD.org>

Remove redundant sysctl_handle_string() calls, the sbuf auto-drain takes
care of that.

Reviewed by: erj@


# 31830672 10-Mar-2015 Jack F Vogel <jfv@FreeBSD.org>

Replace the DEV_NETMAP code that accidentally got removed in the
last commit.

MFC after: 1 week


# 56c2c47b 10-Mar-2015 Jack F Vogel <jfv@FreeBSD.org>

This delta introduces SRIOV support, thanks to Ryan Stone of Sandvine for
adding this major feature to the driver. Secondly, this updates the base
driver with new 20G device support, and with the new firmware levels some
changes to link handling and initialization were required.

MFC after: 1 week


# 977dc4e2 25-Feb-2015 Adrian Chadd <adrian@FreeBSD.org>

Migrate using CPU_ZERO() + CPU_SET() -> CPU_SETOF().

Tested:

* ixgbe, igb, RSS enabled

Submitted by: jhb
Sponsored by: Norse Corp, Inc.


# 9756bd59 24-Feb-2015 Adrian Chadd <adrian@FreeBSD.org>

Change uses of taskqueue_start_threads_pinned() -> taskqueue_start_threads_cpuset()

Differential Revision: https://reviews.freebsd.org/D1897
Reviewed by: jfv


# bc8b78d3 23-Feb-2015 Luigi Rizzo <luigi@FreeBSD.org>

Add native netmap support to ixl.
Preliminary tests indicate 32 Mpps on tx, 24 Mpps on rx
with source and receiver on two different ports of the same 40G card.
Optimizations are likely possible.
The code follows closely the one for ixgbe so i do not
expect stability issues.

Hardware kindly supplied by Intel.

Reviewed by: Jack Vogel
MFC after: 1 week


# b6c8f260 19-Feb-2015 Jack F Vogel <jfv@FreeBSD.org>

Bring the XL710 drivers up to the SW3 release level.

MFC after: 1 week


# dcd7b3b2 16-Jan-2015 Jack F Vogel <jfv@FreeBSD.org>

Some RSS issues discovered by Adrian, missing header, variable
names fat fingered, incorrect hash config setup. Thanks :)

MFC after: 1 week


# df1d7a71 13-Jan-2015 Jack F Vogel <jfv@FreeBSD.org>

Cleanup some bogus code in the RSS config, and add the include
for the rss option file. And bump the version.

MFC after: 1 week


# 393c4bb1 12-Jan-2015 Jack F Vogel <jfv@FreeBSD.org>

Intel I40E driver updates:
if_ixl to version 1.3.0, if_ixlv to version 1.2.0
- Major change in both drivers is to add RSS support
- In ixl fix some interface speed related issues, dual
speed was not changing correctly, KR/X media was not
displaying correctly (this has a workaround until a
more robust media handling is in place)
- Add a warning when using Dell NPAR and the speed is
less than 10G
- Wrap a queue hung message in IXL_DEBUG, as it is non-fatal,
and without tuning can display excessively

MFC after: 1 week


# e5100ee2 06-Nov-2014 Jack F Vogel <jfv@FreeBSD.org>

Update the Intel i40e drivers, ixl version 1.2.8, ixlv version 1.1.18
-Improved VF stability, thanks to changes from Ryan Stone,
and Juniper.
- RSS fixes in the ixlv driver
- link detection in the ixlv driver
- New sysctl's added in ixl and ixlv
- reset timeout increased for ixlv
- stability fixes in detach
- correct media reporting
- Coverity warnings fixed
- Many small bug fixes
- VF Makefile modified - nvm shared code needed
- remove unused sleep channels in ixlv_sc struct

Submitted by: Eric Joyner (committed by jfv)
MFC after: 1 week


# f0188618 21-Oct-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix multiple incorrect SYSCTL arguments in the kernel:

- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after: 3 days
Sponsored by: Mellanox Technologies


# cf3c0c32 29-Sep-2014 Ryan Stone <rstone@FreeBSD.org>

Ensure that ixl_flush() uses a defined register on VFs

In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by: Eric Joyner <ricera10 AT gmail.com>
MFC after: 3 days
Sponsored by: Sandvine Inc


# 4b443922 27-Sep-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Convert driver to if_get_counter method.

Submitted by: rstone
Reviewed by: Eric Joyner <ricera10 gmail.com>


# 7e0dde7d 20-Sep-2014 Bjoern A. Zeeb <bz@FreeBSD.org>

Properly hide calls to ARP under #ifdef INET to allow IPv6-only
kernels to compile.

MFC atfer: 3 days


# d94ca7cf 18-Sep-2014 Bjoern A. Zeeb <bz@FreeBSD.org>

Revert r270808, which were changes to common code (i40e_alloc.h).

Rather than #define-ing common code function calls to OS-dependent
ones, make the osdep versions match the common code expectations,
adjust the FreeBSD specific code to use those, and remove the
#defines.

In the FreeBSD specific code, use "i40e_mem_reserved" for the
now expected but unused argument to i40e_allocate_dma_mem().

Reviewed by: gnn, eric.joyner intel.com
MFC after: 3 days


# 1bffa951 30-Aug-2014 Gleb Smirnoff <glebius@FreeBSD.org>

Use define from if_var.h to access a field inside struct if_data,
that resides in struct ifnet.

Sponsored by: Nginx, Inc.


# ff21e856 29-Aug-2014 Bjoern A. Zeeb <bz@FreeBSD.org>

First try on fixing some more compile errors without actually testing:
- use proper __FreeBSD_version check and more importantly check for __am64__
to be defined. Whether the FreeBSD(_version) checks are needed is a
different question.
- cast uint64_t to uintmax_t and use %jx for printing.

Note: there are more values that could be printed in that status function
but leave that for the future; printf doesn't seem to be the right
way to do it anyway.
Note: there is more breakage related to i40e_allocate_dma*() having
conflicting declarations, so more fixes to come.

PR: 193112
MFC after: 3 days
X-MFC with: r270755


# 1f873f18 28-Aug-2014 Jack F Vogel <jfv@FreeBSD.org>

Remove the DEV_NETMAP code from the ixl drivers, it was a placeholder
and not yet ready to be defined, and its causing build errors.

MFC after: 3 days


# 61ae650d 22-Aug-2014 Jack F Vogel <jfv@FreeBSD.org>

Update to the Intel Base driver for the Intel XL710 Ethernet Controller Family
- It was decided to change the driver name to if_ixl for FreeBSD
- This release adds the VF Driver to the tree, it can be built into
the kernel or as the if_ixlv module
- The VF driver is independent for the first time, this will be
desireable when full SRIOV capability is added to the OS.
- Thanks to my new coworker Eric Joyner for his superb work in
both the core and vf driver code.

Enjoy everyone!

Submitted by: jack.vogel@intel.com and eric.joyner@intel.com
MFC after: 3 days (hoping to make 10.1)