Commit Graph

32 Commits

Author SHA1 Message Date
Warner Losh
eb40e3e757 bnxt: Only filter out i386
Only i386 is missing bus_read_8. The other 32-bit platforms can be fixed
with a cast to a printf.

Suggested by:	kevans
Sponsored by:	Netflix
2022-11-04 22:40:00 -06:00
Sumit Saxena
58d84ef870 if_bnxt: Added support for mgmt interface for passthrough hwrms
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
2022-11-04 16:40:29 -06:00
Sumit Saxena
2ed061f08d if_bnxt: Add support for smaller backing_store_cfg message size
Add compat logic to fallback to the older/smaller backing_store_cfg
message size.

Reviewed by: imp
Differentil Revision: https://reviews.freebsd.org/D36447
2022-11-04 16:33:21 -06:00
Sumit Saxena
19a57f85ba if_bnxt: Fix the PORT_PHY_CFG HWRM requests while setting Pause
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36446
2022-11-04 16:31:24 -06:00
Sumit Saxena
91fcacc355 if_bnxt: Add support for VLAN on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36443
2022-11-04 16:24:32 -06:00
Sumit Saxena
cfdca95f78 if_bnxt: Add support for RSS on Thor
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36442
2022-11-04 16:21:20 -06:00
Sumit Saxena
6033382aab if_bnxt: Display firmware version along with SIT package version
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36441
2022-11-04 16:18:38 -06:00
Sumit Saxena
fb4b7e02d2 if_bnxt: Add support for async link status update
Reivewed by: imp
Differential Revision: https://reviews.freebsd.org/D36440
2022-11-04 16:14:49 -06:00
Sumit Saxena
055196a7d7 if_bnxt: Add support for admin down/up and jumbo
Make ifconfig up/down work, as well as adding support for jumbo frames.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36439
2022-11-04 16:11:10 -06:00
Sumit Saxena
8945584f93 if_bnxt: add support for Thor controller
Added support for Thor controller.
Below are the supported operations:

1. IPv4 ping (ICMP)
2. iperf / netperf (IPv4 TCP)
3. Promiscuous (tcpdump)
4. Can achieve 20 Gbps on a 25 G link (Uni-Di)
5. Can achieve 60 Gbps on a 100 G link (Uni-Di)
6. Port level and queue level driver stats.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36438
2022-11-04 16:05:57 -06:00
Sumit Saxena
97315f68fe if_bnxt: update hsi_struct_def.h headers
Updates the drivers to Broadcom's latest:
	HWRM Version 1.10.2.34 using HSI definition version 1.8.4

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36436
2022-11-04 15:58:43 -06:00
Warner Losh
44b4f0370f bnxt: Remove dead write to cp_ring_id
Since this is read from memory, reading it and then ignoring it is dead
code...

Sponsored by:		Netflix
2022-02-28 10:14:34 -07:00
Mateusz Guzik
38fc6c1443 bnxt: clean up empty lines in .c and .h files 2020-09-01 21:43:23 +00:00
Ed Maste
aeb665b538 remove extraneous double ;s in sys/ 2020-03-30 16:04:25 +00:00
Conrad Meyer
9106fb165b bnxt(4): Eliminate wrong sizeof() expression in memset()
While here, clean up magic numbers.

The memset(,0,) (and M_ZERO!) can just be removed; the bit_alloc() API already
zeros the allocation.

No functional change.

Reported by:	Coverity
CID:		1378286
2020-01-29 05:42:24 +00:00
Matt Macy
24a7d6d3a6 netmap and iflib drivers, silence unused var warnings 2018-05-19 05:57:26 +00:00
Sean Bruno
f097a19eab bnxt(4)
- Fix HWRM warning message during HW LRO configuration.

Submitted by:	bhargava.marreddy@broadcom.com
MFC after:	1 week
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D15466
2018-05-18 13:49:12 +00:00
Stephen Hurd
980da9f2f0 Support short HWRM commands
New Stratus bnxt devices require support for short HWRM commands for VFs
to function.  Enable their use, but only use them if it's both supported
and required... prefer the long HWRM commands when possible.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D13269?id=36180
2017-12-19 21:07:30 +00:00
Stephen Hurd
78fcf2de93 Add byte swapping in bnxt_cfg_async_cr() request
The firmware is always in little endian, use htole*() for all request fields
larger than one byte.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Broadcom Limited
2017-12-19 18:12:18 +00:00
Stephen Hurd
7b79d6d61a bnxt: add support for Flow control setting using sysctl
Created sysctl node dev.bnxt.0.fc with following options.

A. dev.bnxt.0.fc.autoneg
B. dev.bnxt.0.fc.rx
C. dev.bnxt.0.fc.tx

Description:-
dev.bnxt.0.fc: flow ctrl
dev.bnxt.0.fc.autoneg: Enable or Disable Autoneg Flow Ctrl: 0 / 1
dev.bnxt.0.fc.rx: Enable or Disable Rx Flow Ctrl: 0 / 1
dev.bnxt.0.fc.tx: Enable or Disable Tx Flow Ctrl: 0 / 1

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D12599
2017-10-24 21:18:50 +00:00
Stephen Hurd
59059cda6a bnxt: Choose better HW LRO defaults for performance
1) Choose correct Firmware options for HW LRO for best performance
2) Delete TBD and other comments which are not required.
3) Added sysctl interface to enable / disable / modify different factors
   of HW LRO.
4) Disabled HW LRO by default to avoid issues with packet forwarding

This allows much better control over the LRO configuration via sysctls, and
uses much better defaults.  Hardware LRO can now be enabled/disabled
independantly from the software LRO, and the tuning parameters are exposed.

manpage updates coming soon.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D12223
2017-09-23 16:59:37 +00:00
Stephen Hurd
23e90483ec bnxt: Fix driver when attached to a VF
- Use HWRM_FUNC_VF_CFG instead of HWRM_FUNC_CFG on VFs
- Fix NPAR/VF detection
- Clean up flag definitions
- Don't allow WoL on VFs

Although the bnxt driver doesn't support SR-IOV so can create VFs yet,
the PF could be running Linux or ESCi with a VF passed through to a
FreeBSD guest.  This fixes the driver for that use case.

Submitted by:	Siva Kallam <siva.kallam@@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D12410
2017-09-21 20:27:43 +00:00
Stephen Hurd
47516844a3 Added support for displaying HW port stats using sysctl.
This provides port stats (updated once per second) in
dev.bnxt.X.port_stats for PFs.  VFs do not have access to the port stats.

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D11914
2017-09-08 18:03:34 +00:00
Stephen Hurd
8705464353 bnxt: Update firmware header file with the latest one
hsi_struct_def.h file contains all firmware (HWRM) data struct's, updated
that with the latest one which was released on 30'th Aug.

After this upgrade, HWRM version will be 1.8.1.5 (earlier it was 1.4.0).

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D12203
2017-09-06 20:19:30 +00:00
Stephen Hurd
96b2e63f10 bnxt: Use correct firmware call for number of queues supported
1) Based on the suggestion from firmware team, derive
   scctx->isc_ntxqsets_max & scctx->isc_nrxqsets_max based on FUNC_QCFG
   (instead of FUNC_QCAPS).
2) Bump-up driver version to "1.0.0.2".

Submitted by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by:	shurd, sbruno
Approved by:	sbruno (mentor)
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D12128
2017-09-06 20:14:34 +00:00
Sean Bruno
5a1813ecc1 bnxt: Implement interrupt coalescing options using sysctl.
Submitted by:	 bhargava.marreddy@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D11702
2017-07-25 15:33:34 +00:00
Sean Bruno
87890dbaf6 bnxt(4) Enable LRO support, redux
iflib - reset fl-ifl_fragidx to 0 on iflib_fl_bufs_free().  This caused the
panic in em/igb when adding it to a bridge device.

iflib - Handle out of order packet delivery from hardware in support of LRO

Out of order updates to rxd's is fixed in r315217. However, it is not
completely fixed.  While refilling the buffers, iflib is not considering
the out of order descriptors. Hence, it is refilling sequentially.
"idx" variable in _iflib_fl_refill routine is incremented sequentially.
By doing refilling sequentially, it will override the SGEs that
are *IN USE* by other connections.  Fix is to maintain a bitmap of
rx descriptors and differentiate the used one with unused one and
refill only at the unused indices.  This patch also fixes a
few bugs in bnxt, related to the same feature.

Submitted by:	bhargava.marreddy@broadcom.com
Reviewed by:	venkatkumar.duvvuru@broadcom.com shurd
Differential Revision:	https://reviews.freebsd.org/D10681
2017-07-03 18:23:35 +00:00
Sean Bruno
fa5416a819 Revert r319989 "bnxt(4) Enable LRO support"
This generates startup LORs and panics when adding elements to bridge
devices. I will document further in https://reviews.freebsd.org/D10681

PR:	220073
Submitted by:	dchagin
Reported by:	db
2017-06-17 17:42:52 +00:00
Sean Bruno
51a621f7c0 bnxt(4) Enable LRO support
iflib - Handle out of order packet delivery from hardware in support of LRO

Out of order updates to rxd's is fixed in r315217. However, it is not
completely fixed.  While refilling the buffers, iflib is not considering
the out of order descriptors. Hence, it is refilling sequentially.
"idx" variable in _iflib_fl_refill routine is incremented sequentially.
By doing refilling sequentially, it will override the SGEs that
are *IN USE* by other connections.  Fix is to maintain a bitmap of
rx descriptors and differentiate the used one with unused one and
refill only at the unused indices.  This patch also fixes a
few bugs in bnxt, related to the same feature.

Submitted by:	bhargava.marreddy@broadcom.com
Reviewed by:	shurd@
Differential Revision:	https://reviews.freebsd.org/D10681
2017-06-15 21:06:03 +00:00
Sean Bruno
64c9d60dad bnxt(4): add support for WOL Magic.
Submitted by:	venkatkumar.duvvuru@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D10124
2017-04-07 16:15:50 +00:00
Stephen Hurd
00c468348f Add missing newline in error mesage
Approved by:	davidch
MFC after:	13 days
Sponsored by:	Broadcom Corporation
2016-11-17 23:05:34 +00:00
Stephen Hurd
d933e97f9d New driver for Broadcom NetXtreme-C and NetXtreme-E devices.
This driver uses the iflib framework supporting Broadcom
25/50Gbps devices.

Reviewed by:	gallatin, wblock
Approved by:	davidch
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D7551
2016-11-15 20:35:29 +00:00