Commit Graph

342 Commits

Author SHA1 Message Date
Kevin Bowling
725e4008ef iflib: invert default restart on VLAN changes
In rS360398, a new iflib device method was added to opt out of VLAN
events needing an interface reset.

I am switching the default to not requiring a restart for:
* VLAN events
* unknown events

After fixing various bugs, I do not think this would be a common need
of hardware and it is undesirable from the user's perspective causing
link flaps and much slower VLAN configuration. Currently, there are no
other restart events besides VLAN events, and setting the
ifdi_needs_restart default to false will alleviate the need to churn
every driver if an odd event is added in the future for specific
hardware.

markj points out this could cause churn in the other direction; I will
solve that problem with an event registration system as he mentions in
the review should we need it in the future.

These drivers will opt into restart and need further inspection or work:
* ixv (needs code audit, 61a8231 fixed principal issue; re-init probably
not necessary)
* axgbe (needs code audit; re-init probably not necessary)
* iavf - (needs code audit; interaction with Malicious Driver Detection
mentioned in rS360398)
* mgb - no VLAN functions are currently implemented. Left a comment.

MFC after:	2 weeks
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D41558
2023-08-24 13:48:19 -07:00
Marius Strobl
51e235148a iflib drivers: Constify PCI ID LUTs
Since d49e83eac3, 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.
2023-08-17 20:34:23 +02:00
Warner Losh
71625ec9ad sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:24 -06:00
Kevin Bowling
bef7d49101 ixgbe: define IXGBE_LE32_TO_CPUS
Richard Lowe notes in PR 170267 IXGBE_LE32_TO_CPUS was previously
directly defined as le32dec() which is a pure function but the shared
code is expecting an in place conversion.

In SVN r282289 its assignment was removed altogether.

There was some deliberation in the PR on what to define this as, we
just need to do the update in place which is easy enough.

The uintptr_t casts in the shared code were from a DPDK sync and are
unwanted with our new ixgbe_osdep.h implementation.

PR:		170267
Reported by:	Richard Lowe <richlowe@richlowe.net>
MFC after:	1 week
2023-08-13 18:55:39 -07:00
Piotr Pietruszewski
73fa89e041 ix: Fix accessing wrong register
Use IXGBE_GRC_BY_MAC(hw) macro instead of IXGBE_GRC as IXGBE_GRC's
address is different on Denverton platform.

This patch is part of change made in NetBSD kernel
by Masanobu Saitoh, NetBSD maintainer.

Differential Revision:	https://reviews.freebsd.org/D19175
Approved by:	erj
2023-08-10 15:43:21 +02:00
Kevin Bowling
9228ac3a69 ixgbe: Add support for 82599 LS
Obtained from:	DPDK 549ccd3dc01539e060597b503f2b65b272de3347
MFC after:	1 week
2023-08-09 18:31:39 -07:00
Kevin Bowling
8b4a3fbdd5 ixgbe: Check for fw_recovery
The x550 uses an upgradable flash code.  Check for recovery condition
like other flashable intel cards do in case of fw errors.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31869
2023-08-09 17:38:00 -07:00
Yuichiro Naito
61a8231d15 ixv: Separate VFTA table for each interface
The vlan setting is independent for each interface. Use VFTA table in
'struct ixgbe_softc' that is already defined.

This pull request fixes following bug scenario.

    create ixv0.10
    create ixv1.10
    destroy ixv1.10
    create ixv0.11
    ixv0.10 no longer receives vlan 10 packets.

In this case, destroying ixv1.10 affects to ixv0.

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/774
2023-08-03 13:36:21 -07:00
Kevin Bowling
a93409fc3c ixgbe: Warn once for unsupported SFPs
The driver belabors the point about unsupported SFPs, printing multiple
times on link up. Limit it to once.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39785
2023-08-02 23:00:58 -07:00
Piotr Kubaj
5ddb1aa305 ix, ixv: fix kernel build
struct adapter was renamed to struct sc.

Reported by: FreeBSD User <freebsd@walstatt-de.de>
2023-07-11 19:41:26 +02:00
Piotr Kubaj
6ad2a9a64f ix: remove stale comment
Reported by:	Navdeep Parhar
2023-07-11 18:45:04 +02:00
Piotr Pietruszewski
a0302c9231 ix, ixv: Update link status with autonegotiated baudrate value
Use autonegotiated link speed value while updating link status
to iflib.

This patch is part of change made in NetBSD kernel
by Masanobu Saitoh, NetBSD maintainer.

Differential Revision:	https://reviews.freebsd.org/D19176
Approved by:	erj
2023-07-11 18:14:26 +02:00
Przemyslaw Lewandowski
156424fce9
ixgbe: Change if condition for RSS and rxcsum
This patch fixes TCP connection hangs for 1 rxq and 1 txq without rxcsum
enabled. Documentation for 10G cards and other drivers suggest enabling
rxcsum for RSS and disabling otherwise. When PCSD bit is not set then
fragment checksum and IP identification are reported in the rx
descriptor. When PCSD bit is set then RSS hash value is reported in the
rx descriptor. RSS and RX IPP checksum are mutually exclusive.

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

PR:		268910
Reviewed by:	erj@
Tested by:	jeffrey.e.pieper@intel.com
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D38621
2023-05-24 16:29:40 -07:00
Ian Moffett
99cb088f1a ixgbe: Fix typos in source code comments
- s/feilds/fields/

Reviewed by:	zlei
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/707
2023-04-28 18:01:58 +08:00
Krzysztof Galazka
04a5e6d7ca
ixgbe(4): Filter out spurious link up indication
Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay
to filter out spurious link up indication by transceiver with no fiber
cable connected.

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/D38395
2023-02-15 14:38:05 -08:00
Elliott Mitchell
29a4a60fff ixgbe: purge EOL release compatibility
Remove support for pre FreeBSD 8.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560
2023-02-04 09:11:05 -07:00
Andrew Gallatin
8de48df35c ixgbe: Do not count L3/L4 checksum errors as input errors
NIC input errors have traditionally indicated problems at the link
level (crc errors, runts, etc).  People tend to build monitoring
infrastructure  around such errors in order to monitor for bad network
hardware. When L3/L4 checksum errors are included in the category of
input errors, it breaks such monitoring, as these errors can originate
anywhere on the internet, and do not necessarily indicate faulty
local network hardware.

Reviewed by: erj, glebius
Differential Revision: https://reviews.freebsd.org/D38346
Sponsored by: Netflix
2023-02-02 10:14:12 -05:00
Justin Hibbits
ff06a8dbb6 Mechanically convert ixgbe(4) to IfAPI
Reviewed by:	erj
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37845
2023-01-24 15:05:28 -05:00
Andrey V. Elsukov
8526120ad4 ixgbe: workaround errata about UDP frames with zero checksum
Intel 82599 has errata related to IPv4 UDP frames with zero checksum.
It reports such datagrams with L4 integrity errors in IXGBE_XEC
register. And after afb1aa4e6d commit such errors are reported
via IFCOUNTER_IERRORS. This confuses users, since actually all frames
are handled correctly by the system.
To workaround the problem, let's ignore the XEC register value for
82599 cards for now.

PR:		266048
Discussed with:	erj
MFC after:	1 week
Sponsored by:	Yandex LLC
2022-11-10 12:34:40 +03:00
Kristof Provost
e7abb89701 ixgbe: fix software vlan handling
If hardware vlan tagging is disabled (after a vlan has been added) we
receive double-tagged packets, even if the packet on the wire only has a

single VLAN tag.  That looks like this:

	17:29:30.370787 00:51:82:11:22:02 > 90:ec:77:1f:8a:5f, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 802.1Q, vlan 1001, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.101.0.12 is-at 00:51:82:11:22:02, length 42

This happens because the ixgbe driver does not clear the vlan flags in
the hardware (such as IXGBE_RXDCTL_VME) if IFCAP_VLAN_HWTAGGING is
cleared.

Add code to do so, which fixes this issue.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36139
2022-08-17 16:39:18 +02:00
Neel Chauhan
4f1d91e413 if_ix: Reset on an ECC error
This mirrors the Linux behavior as seen in the kernel commit d773ce2.

Reviewed by:		kbowling
MFH after:		3 days
Differential Revision:	https://reviews.freebsd.org/D35542
2022-06-21 20:22:25 -07:00
Gordon Bergling
cd7e11f78d ixgbe(4): Fix common typos in source code comments
- s/filer/filter/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-06 07:28:56 +02:00
John Baldwin
964c2b3a6f ix/ixv: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:39:31 -07:00
Kevin Bowling
395cc55d89 ixgbe: Update mc filter before FCTRL flags
Update mc filter array before changing FCTRL flags, similar to 5a3eb6207a

Approved by:	grehan
MFC after:	2 weeks
2022-04-13 08:59:21 -07:00
John Baldwin
c0a42a0451 ix: Remove cpu_id and related code from ixgbe_if_msix_intr_assign.
Reviewed by:	erj
Differential Revision:	https://reviews.freebsd.org/D34828
2022-04-12 17:01:46 -07:00
John Baldwin
c1710eaf32 ix: Mark variables only used in debug traces as unused. 2022-04-06 16:45:29 -07:00
Piotr Pietruszewski
d381c80751
ix(4): Add control of 2.5/5G autonegotiation speeds
This change enables the user to control 2.5G and 5G autonegotiation
speeds via advertise_speed sysctl for X550T devices. Due to reported
interoperability issues with switches, 2.5G and 5G speeds will not be
advertised by default.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Tested by:	gowtham.kumar.ks@intel.com
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D26245
2022-03-04 10:53:07 -08:00
Piotr Pietruszewski
a3e719bbc2
ixv(4): Allow PF to control the VF link state
This patch adds checks of a VF link state provided by PF via mailbox
API. Such change enables the PF to disable a VF administratively.

Since command needed by the PF to control the VF is introduced in
mailbox api version 1.2, this patch also bumps supported mailbox api
version to 1.2.

Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed By:	kbowling@
Tested by:	lukasz.szczepaniak@intel.com
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D32004
2022-03-04 10:53:07 -08:00
Vincenzo Maffione
f7926a6d0c net: iflib: fix vlan processing in the drivers
The logic that sets iri_vtag and M_VLANTAG does not handle the
case where the 802.11q VLAN tag is 0. Fix this issue across
the iflib drivers. While there, also improve and align the
VLAN tag check extraction, by moving it outside the RX descriptor
loop, eliminating a local variable and additional checks.

PR:             260068
Reviewed by:    kbowling, gallatin
Reported by:	erj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D33156
2021-12-28 11:11:41 +00:00
Vincenzo Maffione
52f45d8ace net: iflib: let the drivers use isc_capenable
Since isc_capenable (private copy of ifp->if_capenable) is
now synchronized to if_capenable, use it in the drivers
when checking the IFCAP_* bits.
This results in better cache usage and avoids indirection
through the ifp pointer.

PR:             260068
Reviewed by:    kbowling, gallatin
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D33156
2021-12-28 11:03:52 +00:00
Gordon Bergling
8da5034954 ixgbe(4): Fix a few typos in source code comments
- s/Manageblility/Managebility/
- s/alows/allows/

MFC after:	3 days
Obtained from:	NetBSD
2021-11-03 16:16:20 +01:00
Kevin Bowling
3f66b96d86 ixgbe: Update shared code catchup
Leftovers from DPDK sync

Reviewed by:	grehan
Obtained from:	DPDK
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D31621
2021-10-06 18:45:55 -07:00
Kevin Bowling
15d077995b ixgbe: whitespace cleanup pass
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32131
2021-09-26 11:29:02 -07:00
Kevin Bowling
b1d5caf3c7 ixgbe: Rename 'struct adapter' to 'struct ixgbe_softc'
Rename the 'struct adapter' to 'struct ixgbe_softc' to avoid type
ambiguity in things like kgdb.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32131
2021-09-26 11:18:07 -07:00
Qiming Yang
5fd1f4be8d ixgbe: increase the timeout
Increase SECRX_RDY polling frequency and semaphore timeout which
fixes the FWSW.PT check in ixgbe_mng_present().

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Approved by:	imp
Obtained from:	DPDK (6175260d12cc22852cecf2fb7ecd95cdb07611b5)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:19 -07:00
Guinan Sun
46981e903c ixgbe: cleanup spelling mistakes in comments
Several functions in the driver code have a weird function comment
formatting which uses two spaces instead of only one space for the main
function body.

This formatting will be mechanically fixed by sed in a future patch, but
doing so leads to some spelling warnings on that patch. Cleanup the
spelling mistakes that will be detected first. This way, it is easier to
verify the mechanical transformation done by sed in the following patch.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (fc75eee32037c1379e77e57031c1c353badd2272)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:19 -07:00
Guinan Sun
3a89005394 ixgbe: remove unnecessary return value check
Remove unnecessary return value check.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (4b0ee6529b7897c2a08dd56669f07ac1f46a8474)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:19 -07:00
Guinan Sun
80a39a2bda ixgbe: create function to restart autoneg
This patch is for restarting auto negotiation on PHY.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (664ea2614eafbec8eda5c86764ff047475a1e5c6)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:19 -07:00
Guinan Sun
ff8db817ab ixgbe: add register definitions for NVM update
Added additional register for X550 and above device family.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (4a6847d78814b1c3df896efe31562643d419317d)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:18 -07:00
Guinan Sun
dc11ba4eb3 ixgbe: move increments after evaluations
The retry variable was being incremented before it was evaluated by the
subsequent conditional against the maximum retries to figure out which
message to print.  So we'll move the increment op to the end.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (390445ec30b4c52a3d2887c3d2a202d9cf37ea8e)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:18 -07:00
Kevin Bowling
4cdc5e12a8 ixgbe: remove whitespace in function comments
Remove unnecessary extra whitespace on all function comments, replacing
' *  ' with ' * '.

This was done automatically via sed using the following transformation:

  sed 's/^ \*  / * /'

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (40023f73c76579e58a859dab87b4c30278eb2e48)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:18 -07:00
Xiaoyun Li
9e65ae746d ixgbe: support DCB registers dump
Add support for DCB registers dump.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (36a036bc6fdd0da74576a39ab74e50954598ba82)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:18 -07:00
Xiaoyun Li
0a4f0befab ixgbe: update X550 SFP identification
Use ixgbe_identify_sfp_module_X550em to update SFP identification
flow. ixgbe_identify_sfp_module_X550em includes specific checks for
X550 about supported SFP modules.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (175bedb0cc8f801be3050fa35b8d8d0971cea7cc)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 21:17:13 -07:00
Kevin Bowling
8455e365f7 ixgbe: Update copyright to 2020
Synced to the ixgbe shared code with DPDK shared code which has local
fixes on top of "not-released-cid-ixgbe.2020.06.09.tar.gz"

Approved by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 20:13:28 -07:00
Ferruh Yigit
0b487fb454 ixgbe: remove dead code
The question around getting rid of the assignments seems lived
long enough, if they are not needed until now, we can drop them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (a6395d471e14e5a7432875dad8fb3533238c5167)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 20:06:53 -07:00
Xiaoyun Li
c85b6f2901 ixgbe: replace an operation in X550 setup
Replace "=" operation with "|=" operation to only set the intended
register bits.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (1b665ccd9cd73499e934b807bec2fd77193912ef)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 20:01:35 -07:00
Kevin Bowling
79b36ec91d ixgbe: Use C99 bool types
Approved by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 19:54:22 -07:00
Xiaoyun Li
b622bdb4eb ixgbe: add FW recovery mode check
Add FM NVM recovery mode check. Allow the software to detect this.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 19:40:59 -07:00
Guinan Sun
994dd6328c ixgbe: add typecast for type mismatch
Add typecast for type mismatch.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>

Approved by:	imp
Obtained from:	DPDK (d8e52b2cf771c31b523b46852fd86225b5a2c721)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 19:30:05 -07:00
Ashijeet Acharya
d5bbb5500c ixgbe: wait for link after copper MAC setup
After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
link does not get set up properly and as a result all the subsequent
calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.

Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
beginning to set up the external PHY link speed to ensure that the
controller can acquire the link.

Signed-off-by: Ashijeet Acharya <ashijeet.acharya@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	imp
Obtained from:	DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31621
2021-09-06 19:22:13 -07:00