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)
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)
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.
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)
This got lost many years ago in 8eb6488ebb
It is used by the driver's DBG printfs.
(cherry picked from commit bf6f0db8a762966b08430692c92ae34e667948db)
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)
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)
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)
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)
These are more succinct than jumping through the function pointers
directly and add some additional error handling.
(cherry picked from commit 1e3b1870ad2a426de6e3f5445211b698f20f7f1f)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
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.
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
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
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