Commit Graph

70 Commits

Author SHA1 Message Date
Matt Macy
81be655266 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
2021-01-07 14:07:35 -08:00
Eric Joyner
2984a8dd7c 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
2020-09-01 23:16:38 +00:00
Eric Joyner
b4a7ce0690 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
2020-06-09 22:42:54 +00:00
Eric Joyner
cf1509179c 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
2020-05-11 17:42:04 +00:00
Leandro Lupori
c65f571c89 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
2020-03-06 12:37:04 +00:00
Pawel Biernacki
20b91f0aa5 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.
2020-02-24 10:51:26 +00:00
Eric Joyner
ab43ce7a22 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
2020-01-02 23:24:57 +00:00
Gleb Smirnoff
ba76aa6357 Convert if_foreach_llmaddr() KPI.
Reviewed by:	erj
2019-10-14 20:21:02 +00:00
Eric Joyner
af06fa2652 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
2019-02-14 18:02:37 +00:00
Marius Strobl
b97de13ae0 - 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
2019-01-30 13:21:26 +00:00
Eric Joyner
37761e2eda 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
2018-11-08 19:10:43 +00:00
Eric Joyner
77c1fcec91 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
2018-10-12 22:40:54 +00:00
Warner Losh
0dc34160f3 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)
2018-09-26 17:12:30 +00:00
Marius Strobl
7f87c0406d 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
2018-07-15 19:04:23 +00:00
Eric Joyner
c9da8d8beb 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
2018-07-12 17:42:36 +00:00
Eric Joyner
f4cc2d1710 ixl(4): Update version number to 2.0.0-k
And update copyrights to current year.

MFC after:	1 month
Sponsored by:	Intel Corporation
2018-06-18 20:32:53 +00:00
Eric Joyner
1031d839aa 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
2018-06-18 20:12:54 +00:00
Eric Joyner
ceebc2f348 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
2018-05-01 18:50:12 +00:00
Eric Joyner
cb6b8299fd 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
2017-02-10 01:04:11 +00:00
Sean Bruno
4294f337b0 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
2016-08-07 18:12:36 +00:00
Sean Bruno
761e526185 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
2016-07-07 03:39:18 +00:00
Adrian Chadd
aa87465313 [ixl] fix build for RSS.
Untested.
2016-05-23 03:46:36 +00:00
Eric Joyner
6bb8f4f665 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
2016-05-12 18:22:34 +00:00
Eric Joyner
d4683565fd 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
2016-05-12 18:22:12 +00:00
Eric Joyner
6d011ad5f6 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
2016-05-12 18:21:52 +00:00
Eric Joyner
6c42605965 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
2016-05-12 18:21:34 +00:00
Eric Joyner
1d767a8eae 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
2016-05-12 18:21:17 +00:00
Eric Joyner
95bb050439 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
2016-05-12 18:20:59 +00:00
Eric Joyner
fdb6f38a3d 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
2016-05-12 18:20:36 +00:00
Eric Joyner
7f70bec623 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
2016-05-12 18:20:18 +00:00
Eric Joyner
223d846d93 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
2016-05-12 18:19:53 +00:00
Eric Joyner
a48d00d276 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
2016-05-12 18:19:31 +00:00
Eric Joyner
ac83ea833d 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
2016-05-12 18:18:55 +00:00
Pedro F. Giffuni
648970d8eb ixl(4): replace 0 with NULL for pointers.
Found by devel/coccinelle.

Differential Revision:	https://reviews.freebsd.org/D5894
Reviewed by:	erj
2016-04-09 17:37:36 +00:00
Steven Hartland
eb4cd7cb9a 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
2016-03-03 19:49:37 +00:00
Eric Joyner
e4c893dd01 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
2016-02-24 01:11:51 +00:00
Eric Joyner
e84c2dea93 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
2016-02-24 00:42:43 +00:00
Eric Joyner
42d7398e7e 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
2016-02-19 22:45:09 +00:00
Eric Joyner
300d145480 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
2016-02-19 22:33:50 +00:00
Eric Joyner
c11f1016ec 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
2016-02-19 21:58:14 +00:00
Kevin Lo
29899c0add Add missing parentheses.
Found by:	PVS-Studio
2016-02-19 01:56:59 +00:00
Steven Hartland
4088e74393 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
2016-01-29 21:06:59 +00:00
Enji Cooper
1c66ead7d6 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
2016-01-03 18:09:46 +00:00
Steven Hartland
9cc0d05612 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
2015-11-12 09:45:35 +00:00
Sean Bruno
2b70dea602 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
2015-10-13 17:20:05 +00:00
Eric Joyner
39020fdfa0 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
2015-07-21 21:07:18 +00:00
Andrew Gallatin
53aab9ea70 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
2015-06-19 21:40:26 +00:00
Jack F Vogel
be771cda12 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
2015-06-05 22:52:42 +00:00
John Baldwin
f3bb925153 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
2015-05-28 22:01:50 +00:00
John Baldwin
4e8e1ebd71 Remove executable property from several ixl(4) source files.
Differential Revision:	https://reviews.freebsd.org/D2583
Reviewed by:	erj
2015-05-19 18:35:18 +00:00