Commit graph

385 commits

Author SHA1 Message Date
Bhosale, Yogeshnull
def59b6038 ix/ixv: Add support for new Intel Ethernet E610 family devices
This is part 1 of the support for the new Intel Ethernet E610 family of devices.

Introduce new PCI device IDs:
• 57AE: Intel(R) E610 (Backplane)
• 57AF: Intel(R) E610 (SFP)
• 57B0: Intel(R) E610 (10 GbE)
• 57B1: Intel(R) E610 (2.5 GbE)
• 57B2: Intel(R) E610 (SGMII)

Key updates for E610 family:
• Firmware manages Link and PHY
• Implement new CSR-based Admin Command Interface (ACI) for SW-FW interaction
• Tested exclusively for x64 operating systems on E610-XT2/XT4 (10G) and E610-IT4 (2.5G)
• Enable link speeds above 1G: 2.5G, 5G and 10G
• NVM Recovery Mode and Rollback support

Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com
Co-developed-by: Krzysztof Galazka krzysztof.galazka@intel.com

Approved by:	kbowling (mentor), erj (mentor)
Tested by:	gowtham.kumar.ks_intel.com
Sponsored by:   Intel Corporation
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D50067

(cherry picked from commit dea5f973d0c8d29a79b433283d0a2de8f4615957)
2025-11-20 12:27:43 -05:00
Kevin Bowling
7e2e14fc22 ixgbe: Correct ixgbe_link_speed_to_str comment
PR:		288960
Reported by:	michaelo

(cherry picked from commit c1532f74e4684f4b4227e873bae05b16ccc0a17c)
2025-10-07 12:10:05 +02:00
Yogesh Bhosale
a870283afd ixgbe: Fix incomplete speed coverage in link status logging
Originally ixgbe_if_update_admin_status() only handled 1G and 10G speeds,
causing any other speeds to display as "1 Gbps" in link status logs.

This issue is fixed by adding link speed to string conversion logic through
the introduction of a helper function, ixgbe_link_speed_to_str(), which
corrects the misleading logs to reflect accurate link speeds.

Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com

PR:		288960
Reported by:	Mike Belanger - QNX
Differential Revision:	https://reviews.freebsd.org/D52442

(cherry picked from commit 46347b3619757e3d683a87ca03efaf2ae242335f)
2025-10-07 12:10:04 +02:00
Ad Schellevis
bc99862101 ixgbe: workaround to prevent an i2c bus read to keep trying to read an empty slot
When executing `ifconfig -v` this will lead to stalls for a second per
interface due to the timeout being set to a static 10 without a module
placed, this patch makes sure this is only allowed once per insertion.
2025-07-09 10:05:47 +02:00
Norbert Ciosek
6e510d8fba ixgbe: fix mailbox ack handling
Check if CTS bit is set in the mailbox message before waiting for ACK.
Otherwise ACK will never be received causing the function to timeout. Add
a note for ixgbe_write_mbx that it should be called while holding a lock.

Fixes: 6d243d2 ("net/ixgbe/base: introduce new mailbox API")
Cc: stable@dpdk.org

Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Obtained from:	DPDK (1f119e4)

(cherry picked from commit 1580f8d9c1740e0c54554e6c185573d34f2dcf76)
2025-04-04 20:43:39 -07:00
Kevin Lo
8ac7c651db ixgbe: Fix a logic error in ixgbe_read_mailbox_vf()
Reviewed by:	kbowling
Differential Revision:	https://reviews.freebsd.org/D49156

(cherry picked from commit 5c7087c349fc1d826807aa1a11912c9e774e3321)
2025-03-01 10:28:58 +08:00
Kevin Bowling
24491b4acc ixgbe: x550 support for 1000BASE-BX SFP modules
Add support for 1Gbit BiDi modules to x550 derivatives

(cherry picked from commit 183621655613bcc97e4ec7d22adbc829347ed426)
2025-02-17 20:02:49 -07:00
Tore Amundsen
c34817d9ae ixgbe: Add support for 1000BASE-BX SFP modules
Add support for 1Gbit BiDi modules

Signed-off-by:	Tore Amundsen <tore@amundsen.org>
Relnotes:	yes
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1518

(cherry picked from commit 89d4096950c4db748e39758c941cfb708c2ff808)
2025-02-15 17:25:04 -07:00
Kevin Bowling
0d1eed3701 ixgbe: Add ixgbe_dev_from_hw() back
This got lost many years ago in 8eb6488ebb

It is used by the driver's DBG printfs.

(cherry picked from commit bf6f0db8a762966b08430692c92ae34e667948db)
2025-02-13 18:24:31 -07:00
Kevin Bowling
55ddb8f7f4 ixgbe: Style pass on FreeBSD part of driver
Fix up some indentation and reflow long lines

Sponsored by:	BBOX.io

(cherry picked from commit c58d34dd67a419866ee50f152044e49cecbae261)
2024-11-26 17:28:08 -07:00
Michael Tuexen
52ff9ccb5b ixgbe: sysctl for TCP flag handling during TSO
Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to fix the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Michael notes emperically 82599 has an unexpected middle mask:
Chip  First Middle Last
82599 0xFF6 0xFF6  0xF7F

which should be fixed up to 0xF76 (RFC 3168) in a future commit.

Reviewed by:	rrs, rscheff
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D44258

(cherry picked from commit eea2e089f8dadf850a30ed837edd7a386427a9ed)
2024-11-23 20:21:03 -07:00
Kevin Bowling
6739fd94aa ixgbe: Add support for 1Gbit Active DAC links
1Gbit also emperically works on Active DACs.

Sponsored by:	BBOX.io

(cherry picked from commit e38f9257c3fac5cb5a62f62c424a976446ae1220)
2024-11-22 23:19:44 -07:00
Kevin Bowling
4de746ee98 ixgbe: Add support for 1Gbit DAC links
This is a relatively well known trick for the X520 (82599), can be
useful for testing and lab settings.  It's not an official standard or
particularly common but ubiquitous Broadcom switch ASICs deal with it.

We'll call it 1000Base-KX because it's SerDes on the passive cable and
I don't think it's worth adding another media type for this.

Reviewed by:	emaste
Sponsored by:	BBOX.io
Differential Revision:	https://reviews.freebsd.org/D47352

(cherry picked from commit 48ddd1b9f88753c6875566fbb67bc622453e4993)
2024-11-20 22:53:15 -07:00
Jeremiah Lott
86efff5491 ixv: Check cap return before MSI-X enable write
In the QEMU workaround code in if_ixv.c, the ixv driver calls
pci_find_cap(dev, PCIY_MSIX, &rid). It is not checking the return code
from that function and the function appears to always be failing. This
then causes the driver to use the rid variable uninitialized, which
will mean setting a bit at an arbitrary offset in pci config space. For
now, this seems to have no adverse impact, but it could easily cause
very subtle problems.

PR:		207037
Sponsored by:	BBOX.io

(cherry picked from commit b87b3696c973ef0a9df70143cd89f6b488531e93)
2024-10-29 18:01:04 -07:00
Konstantin Belousov
3aedf015d1 if_ixv: fix build without NETMAP
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b0993e3bcaec60701f3ae56df255433eb4bcd091)
2024-10-28 22:03:00 -07:00
Kevin Bowling
9679df8eea ixv: Dynamically size the receive packet size
If MTU of the if_ixv VF driver is configured between 1501 and 2030, and
if a peer box have bigger MTU and sends a packet bigger than MTU into
this guest, kernel could crash.

Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4)
does.

PR:		268092
Reported by:	Kumara Babu <nkumarababu@gmail.com>
Sponsored by:	BBOX.io

(cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1)
2024-10-28 17:29:03 -07:00
Kevin Bowling
941833b9bb ixgbe: Switch if_sriov read/write back to ixgbe_mbx APIs
These are more succinct than jumping through the function pointers
directly and add some additional error handling.

(cherry picked from commit 1e3b1870ad2a426de6e3f5445211b698f20f7f1f)
2024-10-05 20:48:42 -07:00
Kevin Bowling
0c730611ed ixgbe: fix misleading indentation in ixgbe_phy
(cherry picked from commit e3a6e916dbbade2d4047e127c371ee0d0a25a294)
2024-09-28 20:56:34 -07:00
Kevin Bowling
edf4f6a6ec ixgbe: fix fw_recovery_mode callout
Need to pass the softc in with the callout arg

(cherry picked from commit a924b5ee6a1b4456b5bde979bb9e15d18726de4f)
2024-09-28 02:22:42 -07:00
Kevin Bowling
e9e57ee70b ixgbe: update if_sriov with ix-3.3.38 changes
There are some critical fixes here. The PF must communicate with each VF
slot (vf->pool), only VFs shall use 0 for everything.

IXGBE_FEATURE_SRIOV needs to be set before calling ixgbe_if_init().

With these changes, ixv(4) now attaches to VFs, but after bringing up
VFs, the PF and VF still are not correctly passing traffic.

(cherry picked from commit b6cd053e6da9bb8f77d2c6069260e52bbd53fa4a)
2024-09-28 02:22:27 -07:00
Kevin Bowling
b8c2ff930b ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes
(cherry picked from commit f72de14ea13259db78b06c50da6c864dea698668)
2024-09-28 02:22:15 -07:00
Kevin Bowling
09c658172a ixgbe: update ixgbe_mbx with ix-3.3.38 changes
(cherry picked from commit 0acea458f82d95b75193bf6ce6321906032abf40)
2024-09-28 02:22:01 -07:00
Kevin Bowling
af9d02f4da ixgbe: update ixgbe_phy with ix-3.3.38 changes
(cherry picked from commit e06918b94ac44448272a9d6747dcdba142e18b58)
2024-09-28 02:21:46 -07:00
Kevin Bowling
1091dcca0e ixgbe: update if_bypass to ix-3.3.38
Bring if_bypass up to date with changes in the out of tree driver

Drop NEEDGIANT as the sysctl handlers have internal mutex for state
changes.

(cherry picked from commit c41a0eeea0d69264317401dd3fac46be160081b5)
2024-09-28 02:21:39 -07:00
Kevin Bowling
6828020a6b ixgbe: update if_sriov to use the new mailbox apis
This fixes a page fault when creating VFs and updates to the new mailbox
API and naming conventions.

The functionality works to the same level that it did before my recent
changes. In particular on my 82599 it creates both passthru and ixv
interfaces. In either case, the PF seems to lose the ability to pass
traffic. The ixv driver fails to attach. These issues are present with
or without my updates.

If you use SR-IOV on ixgbe I would be interested in hearing what does
or does not work for you.

(cherry picked from commit 36c516b31136f645472c12d8597534656272acd6)
2024-09-26 20:35:24 -07:00
Doug Moore
dcf7b92d48 ixgbe: fix compilation for VF
The mailbox API changed in version 15 and these array ops were left out
of the recent code import as applicable to FreeBSD.

Reported by:	vishwin, yasu
Differential Revision:	https://reviews.freebsd.org/D46708

(cherry picked from commit 267f223f622fdbf779cc43b5a564bb02e2b59ecd)
2024-09-26 20:35:06 -07:00
Chinh Cao
744014e62d ixgbe: remove unused function prototypes
DPDK commit message

net/ixgbe/base: remove unused function prototypes
There are some function prototypes that were introduced at some point
but were never implemented, so remove them.

Signed-off-by: Chinh Cao <chinh.t.cao@intel.com>

Obtained from:	DPDK (e9cc1b4)

(cherry picked from commit 420c984470270e0f7200124d8015236584aef243)
2024-09-26 20:34:51 -07:00
Dawid Zielinski
0ea3d1ca5e ixgbe: prevent PBA read over eeprom word size
DPDK commit message

net/ixgbe/base: prevent untrusted loop bound
Added length check against EEPROM size in words to prevent untrusted
loop bound reported by static code analysis.

Signed-off-by: Dawid Zielinski <dawid.zielinski@intel.com>

Obtained from:	DPDK (6b58617)

(cherry picked from commit 25771c8c1ae606436823854de01fc2b23178e353)
2024-09-26 20:34:39 -07:00
Barbara Skobiej
2bff788d32 ixgbe: improve Atom C3000 SWFW semaphore acq
DPDK commit message

net/ixgbe/base: improve SWFW semaphore acquisition
HWSW semaphore acquisition in Atom C3000 NIC is a two stage process.
Each time two semaphore acquisitions are required. Each second semaphore
failure requires re-acquisition of first semaphore. This patch decouples
the two acquisitions preventing potentially hundreds of thousands
of unnecessary loop iterations.

Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>

Obtained from:	DPDK (99f960c)

(cherry picked from commit cc9944183187308a71489651b11342d293aac7d1)
2024-09-26 20:34:27 -07:00
Barbara Skobiej
64945a6b4b ixgbe: add missing QV defines
DPDK commit message

net/ixgbe/base: add missing QV defines
This patch adds missing QV defines:
- offset of ANVM data
- Immediate Field module pointer offset
- 2.5GBASE-T and 5GBASE-T physical layer types for X550

Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>

Obtained from:	DPDK (a730b83)

(cherry picked from commit bfa48c32bc4099cb58b9fe7efab7f376475539ef)
2024-09-26 20:34:14 -07:00
Barbara Skobiej
a160f29c69 ixgbe: remove circular dependency in ixgbe_mbx.h
DPDK commit message

net/ixgbe/base: remove circular header dependency
Including one header file in second header file should be avoided, so
fix it by forward declaring the struct instead.

Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>

Obtained from:	DPDK (0bc2af5)

(cherry picked from commit 3167854b9d2188c4039239f741870e044b7507ac)
2024-09-26 20:34:00 -07:00
Marcin Jurczak
ccd2656109 ixgbe: use primary and block terminology
DPDK commit message

net/ixgbe/base: replace non-inclusive language
This patch removes non-inclusive language from code, user interface
and comments.

Signed-off-by: Marcin Jurczak <marcin.jurczak@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (f12a4bd)

(cherry picked from commit 4530d49e68d331e9168d3a216d8a4b8e0d547578)
2024-09-26 20:33:47 -07:00
Piotr Skajewski
fc143df912 ixgbe: replace implicit fall-through comments
DPDK commit message

Convert all "fall-through" comments to actual code. This aligns the code
with the kernel which no longer allows implicit fallthrough.

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (ae8211f)

(cherry picked from commit 50455f73c28114c665551cba267ec964491ccf21)
2024-09-26 20:33:33 -07:00
Marek Mical
c7bdf0c5e1 ixgbe: Remove Atom C3000 HIC FW access
DPDK commit message

net/ixgbe/base: replace HIC with direct register access
Unify FW access method to direct register read/writes across all
Atom(R) C3000 products.

Atom(R) C3000 fiber exhibited an issue with the Host Interface Command
execution being locked when another LAN function attempted to acquire
the SWFW sync on Manageability Host. This resulted in HIC atomicity
break and bogus data being read since the other LAN function cleared
all semaphores on timeout whereas HIC execution continued after
unlock.  Direct register IOSF access showed higher stability and
reliability.

Signed-off-by: Marek Mical <marekx.mical@intel.com>
Reviewed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed-by: Eryk Rybak <eryk.roch.rybak@intel.com>
Reviewed-by: Francis Racicot <Francis.Racicot@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (e947f1e)

(cherry picked from commit f56311e37d4c39b1deab6aa8523f3332c29e1ad3)
2024-09-26 20:33:17 -07:00
Radoslaw Tyl
3e34560b17 ixgbe: add reset count field to HW struct
DPDK commit message

net/ixgbe/base: add reset count field to HW struct
Add fw_rst_cnt to store the number of resets after fw update.
This value is required to detect if the EICR.MNG event occurred
after firmware update reset.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (9ab0e9c)

(cherry picked from commit 224f7ab8b4706653c7d3f78e624bc36c97679f30)
2024-09-26 20:32:53 -07:00
Radoslaw Tyl
dc3f0089b1 ixgbe: improve function comments
Some function comments have mismatches between actual function names and
function name in comments, which causes warnings with kernel-doc. Fix
comments to match function names.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (7b5bc85)

(cherry picked from commit edef2769483b29457f028a508ea96fc1099a0a21)
2024-09-26 20:32:39 -07:00
Radoslaw Tyl
004a73f51d ixgbe: increase DCB BW calculation for MTU
Change max credit and credit refill to a maximum possible value, 9128.
Too small values cause the incorrect calculation of the bandwidth limits
to each traffic class for frames larger than 4088 bytes.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
Tested-by: Piotr Skajewski <piotrx.skajewski@intel.com>

Obtained from:	DPDK (440823f)

(cherry picked from commit 1b80ac6fa64eaa575b99521cbd71a3780bf5139b)
2024-09-26 20:32:25 -07:00
Jakub Chylkowski
8abae0be0f ixgbe: introduce new mailbox API
DPDK commit message

Current mailbox API does not work as described in documentation and
is prone to errors (for example, it is doing locks on read). Introduce
new mailbox API and provide compatibility functions with old API.

New error codes have been introduced:
- IXGBE_ERR_CONFIG - ixgbe_mbx_operations is not correctly set
- IXGBE_ERR_TIMEOUT - mailbox operation, e.g. poll for message, timedout
- IXGBE_ERR_MBX_NOMSG - no message available on read

In addition, some refactoring has been done: mailbox structures were
defined twice: in ixgbe_type.h and ixgbe_vf.h. Move them into
ixgbe_mbx.h as this header is dedicated for mailbox.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
Reviewed-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Tested-by: Alice Michael <alice.michael@intel.com>
Tested-by: Piotr Skajewski <piotrx.skajewski@intel.com>

Obtained from:	DPDK (6d243d2)

Reapply message

This reverts commit d80c12ba682a6f23791f3d6e657f9e603b152aa2.

(cherry picked from commit 7234c3099947d202702e98d844ecd2d649c834d2)
2024-09-26 20:32:06 -07:00
Jakub Chylkowski
89011d8c4d ixgbe: correct register names to match datasheet
DPDK commit message

net/ixgbe/base: correct registers names to match datasheet
Some of mailbox-related registers have different names than it is
specified in datasheet. Correct these names to correspond to their
datasheet counterparts. Additionally, several calculations are changed
to no longer use magic numbers but dedicated macros instead.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Reviewed-by: Marek Zalfresso-jundzillo <marekx.zalfresso-jundzillo@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Tested-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Tested-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (10fd55e)

(cherry picked from commit b3c7fde6fe9113f849232604523878b4b68df0cc)
2024-09-25 20:29:18 -07:00
Jakub Chylkowski
d7364cb43f ixgbe: rename VF message type macros
DPDK commit message

There is name similarity within IXGBE_VT_MSGTYPE_ACK and
PFMAILBOX.ACK / VFMAILBOX.ACK which may cause confusion. Rename MSGTYPE
macros to SUCCESS and FAILURE as they are not specified in datasheet and
now will be easily distinguishable.

Signed-off-by: Jakub Chylkowski <jakubx.chylkowski@intel.com>
Reviewed-by: Marek Zalfresso-jundzillo <marekx.zalfresso-jundzillo@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Tested-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Tested-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (4f675c9)

(cherry picked from commit 10746040820ee5186caf4d4d61cf88196ec213ba)
2024-09-25 20:29:02 -07:00
Radoslaw Tyl
a23401dd1a ixgbe: fix PHY ID for X550
DPDK commit message

net/ixgbe/base: fix PHY ID for X550
Function ixgbe_get_phy_type_from_id() for X550_PHY_ID2 and
X550_PHY_ID3 always return ixgbe_phy_unknown instead of ixgbe_phy_aq
because phy ID's last 4 bits are always masked, and should not be
taken into account when selecting phy type.

This patch adds default PHY ID for X550 devices with mask on last 4
bits (0xFFFFFFF0), and fixes the switch statement to use it.

Fixes: 58ddc80 ("ixgbe/base: add new X550 PHY ids")
Cc: stable@dpdk.org

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (a9f5a3b)

(cherry picked from commit 9b56dfd27c64fcaf2dfbaa1eb3e2bd2b163fa56c)
2024-09-25 20:28:47 -07:00
Piotr Skajewski
cced5c2030 ixv: fix x550 VF link speed reported
DPDK commit message

net/ixgbe/base: fix 5G link speed reported on VF
When 5000 Base-T was set on PF the VF reported 100 Base-T. This patch
changes ixgbe_check_mac_link_vf function where there was an incorrect
conditional which checks using PF mac types, now it is correctly
using VF mac types.

Fixes: 12e2090 ("net/ixgbe/base: include new speeds in VFLINK interpretation")
Cc: stable@dpdk.org

Signed-off-by: Piotr Skajewski <piotrx.skajewski@intel.com>
Reviewed-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Reviewed-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-by: Alice Michael <alice.michael@intel.com>

Obtained from:	DPDK (9eb7fdb)

(cherry picked from commit ab92cab02633580f763a38a329a5b25050bb4fbf)
2024-09-25 20:28:30 -07:00
Kevin Traynor
7f89ee2c30 ixgbe: increase VF reset timeout
DPDK commit meesage

When VF issues a reset to PF there is a 50 msec wait plus an additional
max of 1 msec (200 * 5us) for the PF to indicate the reset is complete
before timeout.

In some cases, it is seen that the reset is timing out, in which case
the reset does not complete and an error is returned.

In order to account for this, continue to wait an initial 50 msecs, but
then allow a max of an additional 50 msecs (10,000 * 5us) for the
command to complete.

Fixes: af75078 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Obtained from:	DPDK (64e714f)

(cherry picked from commit 28fdb212adc0431fff683749a1307038e25ff58e)
2024-09-25 20:28:13 -07:00
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