This was broken in c63d67e137f3, the early returns prevent building the
media lists as expected.
The BASE-T parts of the patch were suggested by "cyric@mm.st", while I
am adding the additional 40G AOC, 1CX, autoneg and unknown PHY fixes
based on code inspection. There may be additional work left here for
Broadcom but this is certainly better than the returns.
PR: 287395
Reported by: mickael.maillot@gmail.com, cyric@mm.st
Tested by: Einar Bjarni Halldórsson <einar@isnic.is>
(cherry picked from commit 5e6e4f752833acc96f1efc893318d3f6b74b9689)
The header file might be included after linux/stddef.h or others are
included and the macros would be re-defined.
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50156
(cherry picked from commit 152e6197615570e7a2f5f1c6c2ed00ecee9dd10c)
In order to be able to use MODULE_DEVICE_TABLE() with multiple bus
attachments, factor out the bus-specfic MODULE_PNP_INFO() and place
it next to the structure defining the table.
As it turns out bnxt(4) has been using the MODULE_DEVICE_TABLE() with
PCI attachments for the "auxillary" bus so far. That makes little sense.
Define the MODULE_PNP_INFO() to nothing for that. We may consider
pulling these LinucKPI bits in semi-native drivers into LinuxKPI
one day as that route is not really sustainabke.
Sponsored by: The FreeBSD Foundation
Reviewed by: imp, dumbbell
Differential Revision: https://reviews.freebsd.org/D51049
(cherry picked from commit 2f5666c1727c949491f73e6c3277b7b542131714)
The ctx_hw_stats_ext DMA address was not correctly passed to the
firmware during the HWRM_STAT_CTX_ALLOC allocation, causing stats to not
populate for Thor2. Passing the correct DMA length resolved the issue
MFC-After: 3 days
Differential-Revision: https://reviews.freebsd.org/D49732
(cherry picked from commit fec0e2064818f991867c9851a837012ea31774da)
The completion event type 76 is not supported by the driver. Instead of
flooding the dmesg with "Unknown event type" messages when this event
occurs, move the print under debug level.
MFC-After: 3 days
Differential-Revision: https://reviews.freebsd.org/D49731
(cherry picked from commit 6450d937955fcd1ab9034c49d53306e882c4a281)
Doorbell offset :
For Thor controllers doorbell offset was always hardcoded to 0x10000 for
PF devices where as for Thor2 controllers doorbell offset will be
legacy_l2_db_size_kb value provided by firmware through hwrm_func_qcfg
command.
CQ Toggle & Epoch bits support :
In order to handle out of order doorbell handling as part of Dropped
Doorbell Recovery, HW expects two changes in the driver in data path.
- First change is the epoch bit changes while updating the producer
indexes of Tx. This epoch bit is toggled by the driver, each time the
queue is wrapped for that specific doorbell.
- The second change is to add a toggle bit pair to each ARM type
doorbell. This includes the CQ_ARMALL, CQ_ARMSE, CQ_ARMENA
doorbells. The toggle bit pair in context is incremented by the chip
each time a new NQE completion is generated by the chip. To keep the
driver in-sync, the toggle bit pair will be passed in the NQE to the
host completion. This will be the toggle bit pair value that the host
must use to setup the next NQE operation. The driver will pass that
latest toggle bit pair value into the ARM type doorbells it generates to
the chip. The doorbell clients will compare the toggle bit pair in each
doorbell with the value in context. If the values match, the doorbell
will be honored. If the values do not match, the doorbell will be
discarded.
MFC-After: 3 days
Differential-Revision: https://reviews.freebsd.org/D49730
(cherry picked from commit 39c0b8b7994b0d339bffb0b17291c4a2b14cae3a)
Added support for RX V3 completion record types-
CMPL_BASE_TYPE_RX_TPA_START_V3 and CMPL_BASE_TYPE_RX_L2_V3.
MFC-After: 3 days
Differential-Revision: https://reviews.freebsd.org/D49728
(cherry picked from commit 526d74f6ca55c7a4b9c0c745d13e94c7a7bb6e0b)
Add backing store V2 support.
Thor2 controllers supports only the V2 support.
MFC-After: 3 days
Reviewed-by: Warner Losh <imp@FreeBSD.org>
Differential-Revision: https://reviews.freebsd.org/D49727
(cherry picked from commit d5ce906da7c55085f93fce096ebb8bc44a3cffe5)
Update HSI header to support Thor2 controllers.
MFC-After: 3 days
Differential-Revision: https://reviews.freebsd.org/D49726
(cherry picked from commit bb90baed6c275495b03adc5569346a59fce2a3c8)
Using one taskqueue group with single thread to execute all admin
tasks may lead to unexpected timeouts when long running task (e.g.
handling a reset after FW update) for one interface prevents
tasks from other interfaces being executed. Taskqueue group API
doesn't let to dynamically add threads, and pre-allocating thread
for each CPU as it's done for traffic queues would be a waste
of resources on systems with small number of interfaces. Replace
global taskqueue group for admin tasks with taskqueue allocated
for each interface to allow independent execution.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1336
(cherry picked from commit 3ad01642fe9e241124553f2f18fd365ffea5d20b)
Those sysctl handlers have been guaranteed to have non-null softc. No
need for NULL check within sysctl handlers.
No functional change intended.
Reviewed by: markj
Tested by: Daniel Porsch <daniel.porsch@loopia.se>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48495
(cherry picked from commit 747fd2db538a85df84ae6ac1e58494295b4a65ee)
While here, update the description of dev.bnxt.X.dcb to more informative
words "Data Center Bridging".
Reviewed by: markj
Fixes: 35b53f8c989f bnxt_en: Add PFC, ETS & App TLVs protocols support
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48993
(cherry picked from commit 0bc672b38f1b224d5eaed35533cb6f6bfb3a5fa3)
It appears that the maximum number of APP TLVs supported by the hardware
is 128 according to D45005. Well Daniel Porsch reported an issue PR284073
which shows that the number can exceed the limit, causing out of bound
write to on-stack allocated variable app[128] and the kernel panics.
Limit to 128 while retrieving APP TLVs.
PR: 284073
Reviewed by: markj
Tested by: Daniel Porsch <daniel.porsch@loopia.se>
Fixes: 35b53f8c989f bnxt_en: Add PFC, ETS & App TLVs protocols support
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48589
(cherry picked from commit 3de231b4d956f7b9c22e31f75805030a417f7bf3)
It returns the minimum that is not zero, except both equals to zero.
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: bz, emaste, ssaxena
Differential Revision: https://reviews.freebsd.org/D45450
Differential Revision: https://reviews.freebsd.org/D45451
(cherry picked from commit 07c7c41ca1e31c20c2e2d8fb68c148f521831e4d)
This patch introduces the RoCE driver for the
Broadcom NetXtreme-E 10/25/50/100/200G RoCE HCAs.
The RoCE driver is a two part driver that relies
on the bnxt_en NIC driver to operate. The changes
needed in the bnxt_en driver is included through
another patch "L2-RoCE driver communication interface"
in this set.
Presently, There is no user space support, Hence
recommendation to use the krping kernel module for
testing. User space support will be incorporated in
subsequent patch submissions.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45011
(cherry picked from commit acd884dec99adcf8c4cdd0aa8a50be79c216f8e8)
This file is automatically generated from the firmware code to
export the driver interfaces.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45009
(cherry picked from commit 3d8bbe001115f3e9742c128716335e654729ce1a)
Implement firmware error recovery support for Thor adapters.
This entails enabling the capability for the firmware to initiate
error recovery. Specifically, the firmware will send the reset notify
asynchronous event to notify the driver of an error and impending reset.
Subsequently, the driver will queue a task to execute the following steps.
1. Deactivate the allocated resources.
2. Await completion of the firmware's recovery process.
3. Configure the resources and reactivate the network interface.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45008
(cherry picked from commit c9965974a52b5dfad1737706b7f2623d999fb569)
- Added Aux bus support for RoCE.
- Implemented the ulp ops that are required by RoCE driver.
- Restructure context memory data structures
- DBR pacing support
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45006
(cherry picked from commit 050d28e13cdede7528944c0abf8d0455729c63fd)
Created new directory "bnxt_en" in /dev/bnxt and /modules/bnxt
and moved source files and Makefile into respective directory.
ETS support:
- Added new files bnxt_dcb.c & bnxt_dcb.h
- Added sysctl node 'dcb' and created handlers 'ets' and
'dcbx_cap'
- Add logic to validate user input and configure ETS in
the firmware
- Updated makefile to include bnxt_dcb.c & bnxt_dcb.h
PFC support:
- Created sysctl handlers 'pfc' under node 'dcb'
- Added logic to validate user input and configure PFC in
the firmware.
App TLV support:
- Created 3 new sysctl handlers under node 'dcb'
- set_apptlv (write only): Sets a specified TLV
- del_apptlv (write only): Deletes a specified TLV
- list_apptlv (read only): Lists all APP TLVs configured
- Added logic to validate user input and configure APP TLVs
in the firmware.
Added Below DCB ops for management interface:
- Set PFC, Get PFC, Set ETS, Get ETS, Add App_TLV, Del App_TLV
Lst App_TLV
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D45005
(cherry picked from commit 35b53f8c989f62286aad075ef2e97bba358144f8)
The firmware lacks support for manually setting 1G and 10G baseT speeds.
However, the driver can enable auto speed masks to achieve automatic configuration
at these speeds.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42960
(cherry picked from commit 770e7ba3ebe87ba7ffc872c87de72707757b4e25)
Add support for 50G, 100G and 200G PAM4 support
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42959
(cherry picked from commit c63d67e137f353f4bc4d0d56bd793f83204a3e1e)
This update enables the display of pluggable module information
to users via the ifconfig utility.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42958
(cherry picked from commit 3320f0f69f06df5c36daa8ff71e0c07908ff0f1a)
The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42957
(cherry picked from commit d36b36621a9c0f785ebea495c57e975b8a526b67)
Increasing the maximum configurable MTU from 9000 to 9600 to
align with the firmware's capability of handling an MTU up to 9600.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42954
(cherry picked from commit 8a3aab53e335dadb3c95c0eb0664143a955f1ab7)
Enabled User Configuration of 1G Speed on Wh+ SFP28 Port with AOC
cable.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42953
(cherry picked from commit 0f8d1a9e0cd26bf4dd0b2fe2d28c1ab15d03cce4)
The 1G speed on DAC medium is incorrectly labeled as 1000baseT, it
should be 1000baseCX. Updated the label accordingly.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42952
(cherry picked from commit c5108e37fbf93a538c76325766b8a3d76a72f119)
Currently, if a media type (e.g., DAC) is hot-plugged out and another type
(e.g., optical cable) is hot-plugged in, the new speed is not reflected in
ifconfig. This occurs when the driver fails to update speeds with unchanged
tx and rx flow control.
To fix, a phy_type check ensures update of phy speeds upon detecting the new
phy.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42951
(cherry picked from commit 7cbffbfcd9a5185be61bec65790674159bb7c0a8)
The firmware package version currently appears as "Unknown" through
the sysctl interface. The parsing logic for extracting the firmware
package version from the package log has been modified to ensure
compatibility with all controllers.
Reviewed by: imp
Approved by: imp
Differential revision: https://reviews.freebsd.org/D42950
(cherry picked from commit e436cb79666db3c8bb167d47ca9803c36013e32c)
This is in preparation for annotating copyin() and related functions
with __result_use_check.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43178
(cherry picked from commit 243e3ab3d34ada9da4f202f8cab90da2d6c49e5e)
In rS360398, a new iflib device method was added with default of opt out
for VLAN events needing an interface reset.
This is unintentional for bnxt(4) and is causing another bug in its VLAN
initialization code to affect the common case of adding and removing
VLANs on an existing interface.
PR: 269133
Tested by: kp
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.
Added support for application management interface. There are two types of commands supported:
1. Firmware IOCTLs: These ioctls are meant for firmware
consumption. Driver acts as a transport for these.
2. Driver only IOCTLs: These ioctls are meant for driver
consumption. Driver will serve these ioctls without sending them down
to firmware.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36448