aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bnxt
Commit message (Collapse)AuthorAgeFilesLines
* RDMA: Fix link active_speed sizeSlava Shwartsman2026-06-171-2/+3
| | | | | | | | | | | | | | According to the IB spec active_speed size should be u16 and not u8 as before. Changing it to allow further extensions in offered speeds. Linux commit: 376ceb31ff87 RDMA: Fix link active_speed size Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57084
* if_bnxt: add few source files to version controlSumit Saxena2026-06-156-0/+790
| | | | | | | | | | | | | | | | | | | Commits- f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump") and 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support") missed to add few files under version control, those files are added now: sys/dev/bnxt/bnxt_en/bnxt_log.c sys/dev/bnxt/bnxt_en/bnxt_log.h sys/dev/bnxt/bnxt_en/bnxt_log_data.c sys/dev/bnxt/bnxt_en/bnxt_log_data.h sys/dev/bnxt/bnxt_en/bnxt_coredump.c sys/dev/bnxt/bnxt_en/bnxt_coredump.h bnxt_coredump.c entry is added in sys/conf/files as well. Fixes: f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump") Fixes: 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
* if_bnxt: Add support for HWRM passthrough with multiple DMA buffersSreekanth Reddy2026-06-152-39/+60
| | | | | | | | | | Added support for HWRM passthrough commands with multiple DMA buffers. Also, changed the mgmt_lock to sleepable exclusive lock. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56686
* if_bnxt: Fix the Unknown command 0x80000000 ioctl command errorSreekanth Reddy2026-06-151-5/+5
| | | | | | | | | | | | | | | | | | With the latest niccli version, user will observe below Unknown command command error when try to list the devices. if_bnxt: Unknown command 0x80000000 Here, niccli is issuing command opcode as 0x80000000 but driver is expecting 0x20000000 command opcode. So, replaced _IOW(0,0,0) with the _IOC(IOC_IN,0,0,0). Fixes: d53d7b4 ("bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN") MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56685
* if_bnxt: Add Firmware crashdump collection supportSreekanth Reddy2026-06-155-7/+361
| | | | | | | | | | | | | | | | This patch adds support for DDR-based firmware coredump memory handling. It detects firmware coredump capability, allocates host DDR (DMA) memory for crash dumps, and programs the firmware with the allocated memory during attach. The allocated memory is released during driver detach. Also, This patch adds functions to retrieve crash dump data from host DDR memory. The implementation handles data copying from page tables and checks dump availability. Main function bnxt_get_coredump() copies stored crash dump data from DDR memory to the application buffer. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56684
* if_bnxt/bnxt_re: Update hsi headersSreekanth Reddy2026-06-153-442/+9133
| | | | | | | | Update hsi headers MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56683
* if_bnxt/bnxt_re: add support for driver snapdumpSreekanth Reddy2026-06-157-48/+591
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a logging module which helps to log and collect the driver`s various events and state of device data structures. APIs help modules like l2, RoCE etc. to register and add logs into thg buffers. A segment header is added to the data available in buffers. The final log messages are arranged in following fashion |SegHeader0|Data0|SegHeader1|Data1| Logging module provides two different kinds of buffers: a) A large contiguous memory chunk is used to form circular buffers. Module need to provide a number of buffers while registering to the logging module.Please note that, since memory for the buffers remains with the module as long as it is registered, memory footprints of the driver could be higher so the modules should allocate an appropriate number of buffers. Also, due to limited space, modules should only log important events/messages into the buffer. Modules must use bnxt_log_add_mssg() to add the message into the list. b) Live buffer - They are allocated during coredump retrieval and freed after the coredump data is returned to the user. This helps to collect live data from the driver. Modules must use the bnxt_log_live() function to add the log messages. When coredump is retrieved all the messages available in above buffers are copied into the coredump buffer. Test Plan: Generate the coredump using below niccli command ./niccli.freebsd -i 1 debug --coredump and then verify the coredump contents using the Broadcom's Coredump decoder. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56682
* bnxt: Fix build / load error for bnxt(4) in kernels without PCI_IOVAndrew Gallatin2026-05-293-6/+39
| | | | | | | | | | | This change removes the hard-forcing of PCI_IOV and adds shims to allow the driver to compile and work when the kernel is missing PCI_IOV support. Fixes: 7c450d1127c7 Reviewed by: sumit.saxena_broadcom.com Differential Revision: https://reviews.freebsd.org/D57300 Sponsored by: Netflix
* bnxt_en: Address review comments for core SR-IOV supportChandrakanth Patil2026-04-284-19/+19
| | | | | | | | | | | | | | | | | | | This patch addresses the code review comments provided for: https://reviews.freebsd.org/D56197 * P7 VF PCI ID: rename NETXTREME_E_P7_VF to E_P7_VF (P7/Thor2 line drops the Netxtreme name in product strings; other VF device IDs are unchanged). * Use the return value of bnxt_vf_parse_schema() in bnxt_iov_vf_add() to decide when to call bnxt_set_vf_admin_mac(); make parse_schema() return bool and remove the has_admin_mac field. * In bnxt_free_vf_resources(), fix indentation after dma_free_coherent() so the NULL assignment is clearly separate from the call. * In bnxt_hwrm_func_vf_resource_free(), use first_vf_id/last_vf_id in the HWRM_FUNC_VF_RESC_FREE loop. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56644
* bnxt_en: VF ring reservation, HWRM registration, and PF-only operation guardsChandrakanth Patil2026-04-286-21/+121
| | | | | | | | | | | | | | | | | | | VFs require separate HWRM commands for ring reservation and async completion ring setup, so a common PF/VF dispatcher is introduced and the async CR path is extended to handle both. The PF must populate the VF request forwarding bitmap during driver registration so the firmware correctly forwards VF-originated HWRM commands. VF reservation strategy and min-guaranteed capability flags are now parsed for correct resource partitioning, and PF-only operations (DCB, NVM, package version sysctl) are guarded against VF invocation. The short command buffer allocation is also reordered before the function reset to ensure extended HWRM messages are available when needed, a prerequisite uncovered during VF bring-up. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56232
* bnxt_en: Re-enable SR-IOV after firmware resetChandrakanth Patil2026-04-282-0/+13
| | | | | | | | | | | | | | | | When the firmware undergoes a hot-reset and the driver re-opens the device, previously active Virtual Functions lose their resource configuration. bnxt_reenable_sriov() restores that configuration by replaying bnxt_cfg_hw_sriov() with the saved resource parameters. The function is called from bnxt_fw_reset_task() in the BNXT_FW_RESET_STATE_OPENING state, guarded by #ifdef PCI_IOV. Because bnxt_cfg_hw_sriov() is a no-op when active_vfs is zero the call is safe on any PF regardless of whether VFs were ever created. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56201
* bnxt_en: Add per-VF trust, spoof-check and promiscuous controlsChandrakanth Patil2026-04-282-3/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose per-VF policy knobs via the FreeBSD sysctl tree and enforce them at the data-path level. Trust (dev.bnxt.<unit>.vfN.trusted): bnxt_set_vf_trust() sets/clears BNXT_VF_TRUST and sends HWRM_FUNC_CFG with FLAGS_TRUSTED_VF_ENABLE/DISABLE. bnxt_create_trusted_vf_sysctls() / bnxt_destroy_trusted_vf_sysctls() manage the sysctl lifetime with VF creation/teardown. Spoof-check (dev.bnxt.<unit>.vfN.spoofchk): bnxt_set_vf_spoofchk() issues HWRM_FUNC_CFG with SRC_MAC_ADDR_CHECK_ENABLE/DISABLE. Promiscuous gating: bnxt_is_trusted_vf() queries firmware via HWRM_FUNC_QCFG. bnxt_promisc_ok() returns false for untrusted VFs, preventing them from entering promiscuous mode. bnxt_promisc_set() is updated to gate the PROMISCUOUS and ANYVLAN_NONVLAN mask bits on bnxt_promisc_ok(). bnxt_iov_vf_add() applies the initial trust/spoof-check policy from the nvlist schema. bnxt_iov_init() creates the sysctl trees after bnxt_cfg_hw_sriov() succeeds. bnxt_iov_uninit() tears them down. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56200
* bnxt_en: Add VF forwarded HWRM request handlingChandrakanth Patil2026-04-282-0/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the Physical Function to proxy HWRM commands issued by Virtual Functions through the firmware forwarded-request mechanism. When a VF issues a command that requires PF arbitration, the firmware delivers a CMPL_BASE_TYPE_HWRM_FWD_REQ completion to the PF async ring. * bnxt_process_async_msg() recognises CMPL_BASE_TYPE_HWRM_FWD_REQ, identifies the originating VF by its firmware function ID, sets the corresponding bit in pf.vf_event_bmap, and raises BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT to schedule deferred processing. * bnxt_sp_task() dispatches to bnxt_hwrm_exec_fwd_req(), which iterates over all pending VF bits and calls bnxt_vf_req_validate_snd() for each. * bnxt_vf_req_validate_snd() inspects the encapsulated request type: HWRM_FUNC_VF_CFG (MAC change) is handled by bnxt_vf_configure_mac() which enforces trust/existing-MAC rules; HWRM_CFA_L2_FILTER_ALLOC is handled by bnxt_vf_validate_set_mac(); HWRM_FUNC_CFG is forwarded as-is; all other commands are rejected. All forwarded-request code is guarded by #ifdef PCI_IOV. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56199
* bnxt_en: Add VF load path and PF/VF context differentiationChandrakanth Patil2026-04-284-70/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach the driver to distinguish a Physical Function from a Virtual Function at probe time and configure each appropriately. * Introduce bnxt_is_vf_device() to identify all known VF device IDs (NetXtreme-C/E Gen1-3, Thor1/2, Hyper-V variants). Add corresponding PVID entries to bnxt_vendor_info_array. * Refactor the iflib shared context: rename bnxt_sctx_init to bnxt_sctx_template, add a Thor2-specific bnxt_sctx_template_p7, and build per-call PF/VF instances via bnxt_init_sctx_variants(); the VF instance carries IFLIB_IS_VF. bnxt_register() selects the correct sctx. * bnxt_attach_pre(): replace the hard-coded NPAR/VF switch with bnxt_set_flags_by_devid(); on a VF call bnxt_approve_mac() to request PF approval for the firmware-assigned MAC address. * bnxt_hwrm_func_qcaps(): populate fw_fid and MAC for PF and VF contexts separately; for PF call iflib_set_mac() and record max_msix_vfs; for VF handle the case where the PF has not yet assigned a MAC. * bnxt_hwrm_func_qcfg(): populate the new alloc_* counters used by the VF resource configuration path; record registered_vfs for PF and VLAN/trust state for VF. * bnxt_init(): call bnxt_update_vf_mac() on VFs after each bring-up. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56198
* bnxt_en: Add core SR-IOV infrastructureChandrakanth Patil2026-04-284-28/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the foundational building blocks for SR-IOV Virtual Function support on Broadcom NetXtreme-C/E adapters. * Add bnxt_sriov.h: defines the extended bnxt_vf_info structure (per-VF firmware FID, MAC addresses, VLAN, flags, DMA command buffers, resource counts), the bnxt_resc_map helper, flag macros (BNXT_VF_TRUST, BNXT_VF_SPOOFCHK, etc.), and prototypes for all SR-IOV functions. * Add bnxt_sriov.c: implements the SR-IOV attachment sequence (bnxt_sriov_attach), the iflib IOV callbacks (bnxt_iov_init, bnxt_iov_uninit, bnxt_iov_vf_add), VF resource allocation and firmware configuration helpers (bnxt_alloc_vf_resources, bnxt_cfg_hw_sriov, bnxt_hwrm_func_vf_resc_cfg, bnxt_hwrm_func_buf_rgtr, bnxt_hwrm_func_vf_resource_free), and the per-VF parameter helper. * Extend bnxt.h: include bnxt_sriov.h; extend bnxt_pf_info with VF- tracking fields (vf array, firmware FID/MAC, resource-reservation strategy, DMA page management, sysctl context); replace the upstream bnxt_vf_info stub with the full definition from bnxt_sriov.h; extend bnxt_func_qcfg with allocation counters required by the VF resource configuration path; add vf_resc_cfg_input and sriov_lock to bnxt_softc. * Update Makefile to build bnxt_sriov.c and include bnxt_sriov.h. * Wire up PCI-IOV device methods (pci_iov_init / pci_iov_uninit / pci_iov_add_vf) and iflib IOV callbacks (ifdi_iov_init / ifdi_iov_uninit / ifdi_iov_vf_add) in if_bnxt.c; call bnxt_sriov_attach() from bnxt_attach_post() on P5+ Physical Functions. MFC after: 1 month Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D56197
* bnxt: set hardware checksum only if requiredacazuc2026-02-051-6/+16
| | | | | | | | | | | The test condition in the bnxt driver for TCP/UDP transmit hardware checksum offload is invalid: only the TCP / UDP csum bits should be tested Only the relevant ipi_csum_flags bits are now tested Reviewed by: tuexen Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D53941
* bnxt_re/libbnxtre: Add support for Variable WQE on BCM576xx controllersSreekanth Reddy2026-01-279-85/+194
| | | | | | | | | | | | | | | Variable size WQE means that each send Work Queue Entry to HW can use different WQE sizes as opposed to the static WQE size on the current devices. Set variable WQE mode for BCM576xx devices. Depth of the Queue will be a multiple of slot which is 16 bytes. The number of slots should be a multiple of 256 as per the HW requirement. Initialize the Software shadow queue to hold requests equal to the number of slots. Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54525 MFC after: 3 days
* bnxt_re: Add support to display board_id in ibv_devinfo outputSreekanth Reddy2026-01-275-1/+31
| | | | | | | | | | | | Added support to display board_id in ibv_devinfo output. ibv_devinfo util reads the board_id from below sysctl attribute, so added this sysctl attribute. sys.class.infiniband.bnxt_reX.board_id Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54524 MFC after: 3 days
* bnxt_re: Fix active_speed value when two ports are aggregatedSreekanth Reddy2026-01-278-30/+103
| | | | | | | | | | | | | Currently driver is not considering the active_lanes while displaying the speed & width of port and hence it showing invalid active_speed and active_width values in the ibv_devinfo command output when two ports are aggregated at hardware level. Fixed the driver to consider the active_lanes while determining the active_speed & active_width values. Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54523 MFC after: 3 days
* bnxt_en/re: Use FW defined resource limit for RoCESreekanth Reddy2026-01-277-16/+42
| | | | | | | | | | | | | | | | | | | | | | | | | Check FW flags for status of Resource Limits. If bit FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED is set, that means FW set the resource limit for L2 and RoCE. We'll then do the following: L2 driver would allocate context memory based on what FW reported. RoCE driver uses FW reported values without capping. These values are the total FW reported value minus L2 and other components shares. For example: FW reported max_qps = 137217 in L2 query, this includes: 5120 for L2 1025 for QP1 131072 for RoCE L2 will allocate backing store memory for the total. In RoCE query, we'll get max_qp = 131072 and use it without further capping. Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54522 MFC after: 3 days
* bnxt_re/libbnxtre: Add RoCE support for BCM576xx controllersSreekanth Reddy2026-01-2713-39/+93
| | | | | | | | | | | | | | | | | | | Added RoCE support for BCM576xx controllers with below changes, 1. Update the BAR offsets for handling BCM576xx controllers. Use the values populated by the L2 driver for getting the Doorbell offsets. 2. Use msn index instead of tail to pull psn table entry. 3. Temporarily disable dbr pacing feature untill it is fully implemented. 4. Add support for 400G speed. Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54521 MFC after: 3 days
* bnxt: don't set media status if link is downAnaëlle CAZUC2026-01-261-4/+3
| | | | | | | | | | | When the link is down don't set flags other than IFM_AVALID & IFM_ETHER This avoids `media: Ethernet autoselect (Unknown <full-duplex>)` on ifconfig Reviewed by: zlei, pouria Approved by: glebius (mentor) MFC after: 1 week Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D54573
* bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_INSumit Saxena2026-01-092-6/+14
| | | | | | | | | | | | | | | | | | The driver and applications currently use hard-coded numeric ioctl command opcodes. These opcodes are interpreted as having the IOC_IN direction (data copied from the user application to the driver), regardless of the actual packet size. Consequently, when the packet size is zero and the direction is set to IOC_IN, the kernel fails these ioctls if COMPAT is disabled. While the driver and applications should ideally set the direction correctly— for example, using IOC_VOID when the packet size is zero—the driver will now be updated to define ioctl opcodes using the _IOC macro to support both IOC_VOID and IOC_IN. This change ensures backward compatibility with older applications that exclusively use IOC_IN. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D54601 MFC after: 3 days
* bnxt: fix i2c read to allow access to different addressesAndrew Gallatin2026-01-081-1/+1
| | | | | | | | | | | Allow reading of i2c addresses other than A0. A0 does provide most information, but doesn't provide things like module temps, and optical signal levels. Sponsored by: Netflix Reviewed by: sumit.saxena_broadcom.com Differential Revision: https://reviews.freebsd.org/D54590 MFC after: 3 days
* LinuxKPI: pci: implementation of [lkpi_]pci_get_slot()Bjoern A. Zeeb2025-09-291-0/+1
| | | | | | | | | | | | | | | | | Like lkpi_pci_get_domain_bus_and_slot() implement lkpi_pci_get_slot() using pci_find_bsf() instead of pci_find_dbsf() (no domain). This is needed for a wireless driver. Unfortunately the name [pci_get_slot()] collides with the native PCI function. Add a guard around it and disable the use when the native version is required (in lkpifill_pci_dev() and in bnxt/bnxt_en; if the latter gets fixed we can probably also fix work around it in the former; further conflicts in drm-kmod 6.1-lts, 6.6-lts, and master were resolved). Sponsored by: The FreeBSD Foundation (initially) MFC aftre: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52065
* bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg()Mark Johnston2025-09-111-1/+1
| | | | | | | PR: 286720 Reviewed by: zlei MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50491
* bnxt(4): Fix typos in a comment and a kernel messageGordon Bergling2025-08-171-2/+2
| | | | | | - s/priviledged/privileged/ MFC after: 5 days
* LinuxKPI: MODULE_DEVICE_TABLE() factor out the bus specific MODULE_PNP_INFO()Bjoern A. Zeeb2025-07-041-0/+1
| | | | | | | | | | | | | | | | | 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 MFC after: 3 days Reviewed by: imp, dumbbell Differential Revision: https://reviews.freebsd.org/D51049
* bnxt: Fix BASE-T, 40G AOC, 1G-CX, autoneg and unknown media listsKevin Bowling2025-06-141-7/+7
| | | | | | | | | | | | | | | | 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> MFC after: 1 week
* bnxt: add guards around struct_group macrosBjoern A. Zeeb2025-05-051-0/+4
| | | | | | | | | | 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 MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50156
* bnxt_en: Thor2 Ring counters not incrementing during trafficSreekanth Reddy2025-04-231-1/+4
| | | | | | | | | 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
* bnxt_en: Unhandled async event type 76Sreekanth Reddy2025-04-231-6/+6
| | | | | | | | | 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
* bnxt_en: Thor2 Specific Doorbell related changesSreekanth Reddy2025-04-233-32/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* bnxt_en: 400G speed supportSreekanth Reddy2025-04-233-135/+441
| | | | | | | Added 400G speed module support. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49729
* if_bnxt: add support for RX completion record type V3Sreekanth Reddy2025-04-232-0/+5
| | | | | | | | 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
* bnxt_en: Add backing store V2 supportSreekanth Reddy2025-04-233-18/+153
| | | | | | | | | 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
* bnxt_en: Update HSI headerSreekanth Reddy2025-04-232-169/+2082
| | | | | | | Update HSI header to support Thor2 controllers. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49726
* bnxt_en: Add 5760X (Thor2) PCI IDs supportSreekanth Reddy2025-04-235-60/+93
| | | | | | | | | Add Thor2 PCI IDs. Reviewed-by: Warner Losh <imp@FreeBSD.org> Reviewed-by: Sumit Saxena <sumit.saxena@broadcom.com> MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49725
* bnxt_en: Improve sysctl handler bnxt_dcb_list_app()Zhenlei Huang2025-02-141-27/+17
| | | | | | | | | | | Prefer sbuf_new_for_sysctl() over error-prone manually managed buffer. 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/D48496
* bnxt_en: Remove pointless NULL check for sysctl arg1Zhenlei Huang2025-02-141-18/+0
| | | | | | | | | | | | 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
* bnxt_en: Fix the description of sysctl knob dev.bnxt.X.dcb.dcbx_capZhenlei Huang2025-02-141-2/+2
| | | | | | | | | | 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
* bnxt_en: Retrieve maximum of 128 APP TLVsZhenlei Huang2025-02-144-9/+14
| | | | | | | | | | | | | | | | 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
* iflib(4): Replace admin taskqueue group with per-interface taskqueuesKrzysztof Galazka2025-01-242-7/+5
| | | | | | | | | | | | | | | | 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
* bnxt: Use IfAPI accessors where ableJustin Hibbits2024-11-133-7/+7
| | | | | | | | Summary: Don't directly access ifnet members, it's a private structure. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D47353
* bnxt(4): Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang2024-09-031-18/+0
| | | | | MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
* /sys/dev/bnxt: Enable NPAR support on BCM57504Vinícius Ferrão2024-07-072-0/+5
| | | | | | | | This commit enables NPAR support for Broadcom 57504 10/25GbE NICs Signed-off-by: Vinícius Ferrão <vinicius@ferrao.net.br> Reviewed by: imp,ssaxena,nightquick@proton.me Pull Request: https://github.com/freebsd/freebsd-src/pull/1306
* LinuxKPI: Add min_not_zero() to linux/minmax.hVladimir Kondratyev2024-06-061-0/+2
| | | | | | | | | | 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
* bnxt_re: Explicitly cast pointer-to-integer conversionsMark Johnston2024-05-282-2/+2
| | | | | Reported by: Jenkins Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
* RDMA/bnxt_re: Add bnxt_re RoCE driverSumit Saxena2024-05-2816-0/+22768
| | | | | | | | | | | | | | | | | | | | 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
* bnxt_en: Driver version update to 230.0.133.0Chandrakanth patil2024-05-281-1/+1
| | | | | | Reviewed by: imp Approved by: imp Differential revision: https://reviews.freebsd.org/D45010