History log of /freebsd-current/sys/dev/bce/if_bcereg.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 0292389a 19-Aug-2022 Justin Hibbits <jhibbits@FreeBSD.org>

Mechanically convert bce(4) to IfAPI

Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37841


# ddf38e02 03-Sep-2022 Gordon Bergling <gbe@FreeBSD.org>

bce(4): Fix a typo in a source code comment

- s/overriden/overridden/

MFC after: 3 days


# eef5873f 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

bce: clean up empty lines in .c and .h files


# 55e306cb 01-Mar-2020 Warner Losh <imp@FreeBSD.org>

Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of
these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...


# 7282444b 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 453130d9 02-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.


# 9e251ed6 23-Feb-2015 Pyun YongHyeon <yongari@FreeBSD.org>

Correct a typo.

Reported by: jmg


# 5af69470 25-Sep-2014 Gleb Smirnoff <glebius@FreeBSD.org>

- Provide bce_get_counter() to return counters that are not collected,
but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
- While here fix 3 instances of the same bug, when error counter was ++
in one place and then assigned in other place, losing the increment.
Achieve that storing soft errors counters in softc.


# ed062a30 08-May-2014 David C Somayajulu <davidcs@FreeBSD.org>

Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business.
Added clean option to Makefile

Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation
MFC after:5 days


# 52ee8ac0 30-Mar-2014 Pyun YongHyeon <yongari@FreeBSD.org>

Increase the number of TX DMA segments from 32 to 35. It turned
out 32 is not enough to support a full sized TSO packet.
While I'm here fix a long standing bug introduced in r169632 in
bce(4) where it didn't include L2 header length of TSO packet in
the maximum DMA segment size calculation.

In collaboration with: rmacklem
MFC after: 2 weeks


# f706f926 26-Oct-2013 Gleb Smirnoff <glebius@FreeBSD.org>

Move includes from if_bcereg.h to .c files.


# d925c58c 29-Jun-2013 Pyun YongHyeon <yongari@FreeBSD.org>

Fix triggering false watchdog timeout when controller is in PAUSE
state. Previously it used to check if controller has sent a
PAUSE frame to the remote peer.

Reported by: David Imhoff via Brad Smith <brad@OpenBSD.org>
Submitted by: davidch (initial version)
Reviewed by: davidch, David Imhoff <dimhoff_devel@xs4all.nl>


# 4c39437f 30-May-2013 Marius Strobl <marius@FreeBSD.org>

- As a follow-up to r247565, make firmware images that do not require
patching at runtime actually const.
- Remove pointless softc members by employing the corresponding constants
directly.
- Remove pointless returns.
- Remove unnecessary inclusion of opt_device_polling.h.
- Replace an outdated and now bogus comment in bce_tick() with the
appropriate one.

MFC after: 1 week


# 499e5886 01-Mar-2013 Marius Strobl <marius@FreeBSD.org>

- Make tables, device ID strings etc const.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Remove redundant/unused softc members.
- Don't allocate MSI/MSI-X as RF_SHAREABLE.
- Re-use bus accessor macros instead of duplicating them.
- In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY
address (missed in r213893).

MFC after: 1 week


# df0adc13 30-Oct-2012 Andrey Zonov <zont@FreeBSD.org>

- Remove BCE_JUMBO_HDRSPLIT kernel option which was forgotten in r218423.

Approved by: davidch
Approved by: kib (mentor)


# d0483514 08-May-2012 Pyun YongHyeon <yongari@FreeBSD.org>

Implement basic remote PHY support. Remote PHY allows the
controller to perform MDIO type accesses to a remote transceiver
using message pages defined through MRBE(multirate backplane
ethernet). It's used in blade systems(e.g Dell Blade m610) which
are connected to pass-through blades rather than traditional
switches.
This change directly manipulates firmware's mailboxes to control
remote PHY such that it does not use mii(4). Alternatively, as
David said, it could be implemented in brgphy(4) by creating a fake
PHY and let brgphy(4) do necessary mii accesses and bce(4) can
implement mailbox accesses based on the type of brgphy(4)'s mii
accesses. Personally, I think it would make brgphy(4) hard to
maintain since it would have to access many bce(4) registers in
brgphy(4). Given that there are users who are suffering from lack
of remote PHY support, it would be better to get working system
rather than waiting for complete/perfect implementation.

Tested by: Jan Winter ( jan.winter <> kantarmedia dot de )
Reviewed by: davidch (initial version)
MFC after: 2 weeks


# 7e0fa140 11-Apr-2012 Pyun YongHyeon <yongari@FreeBSD.org>

Back out r228476.
r228476 fixed superfluous link UP/DOWN messages but broke IPMI
access during boot. It's not clear why r228476 breaks IPMI and
should be revisited.

Reported by: Paul Guyot <paulguyot <> ieee dot org >
MFC after: 1 week


# 59aab5d2 13-Dec-2011 Pyun YongHyeon <yongari@FreeBSD.org>

Rework link state tracking and remove superfluous link UP/DOWN
messages.
o Add check for actually resolved speed in miibus_statchg callback
instead of blindly reprogramming BCE_EMAC_MODE register. The
callback may be called multiple times(e.g. link UP, link
transition, auto-negotiate complete etc) while auto-negotiation
is in progress. All unresolved link state changes are ignored
now and setting BCE_EMAC_MODE after link establishment is done
once.
o bce(4) is careful enough not to drive MII_TICK if driver got a
valid link. To detect lost link, bce(4) relied on link state
change interrupt and if driver see the interrupt, it forced to
drive MII_TICK by calling bce_tick() in interrupt handler.
Because bce(4) generates multiple link state change interrupts
while auto-negotiation is in progress, bce_tick() would be
called multiple times and this resulted in generating multiple
link UP/DOWN messages.
With this change, bce_tick() is not called in interrupt handler
anymore such that miibus_statchg callback handles link state
changes with consistent manner.

Reviewed by: davidch


# 50fb4497 07-Oct-2011 Pyun YongHyeon <yongari@FreeBSD.org>

BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
remove explicit checks for BCM5716.
The BCM5709 and BCM5716 chips are virtually indistinguishable by
software except for the PCI device ID. The two chips differ in
that BCM5709 supports TCP/IP and iSCSI offload in Windows while
the BCM5716 doesn't.
While I'm here remove now unused definition of BCE_CHIP_NUM_5716
and BCE_CHIP_ID_5716_C0.

Reported by: sbruno
Reviewed by: davidch
Tested by: davidch


# 08266a07 10-Feb-2011 David Christensen <davidch@FreeBSD.org>

- Added error checking to nvram read functions.
- Minor style updates.

Submitted by: gcooper@freebsd.org
MFC after: 2 weeks


# 2306fc3f 07-Feb-2011 David Christensen <davidch@FreeBSD.org>

- Added systcls for header splitting, RX/TX buffer count, interrupt
coalescing, strict RX MTU, verbose output, and shared memory debug.
- Added additional debug counters (VLAN tags and split header frames).
- Updated debug counters to 64 bit definitions.
- Updated l2fhdr bit definitions.
- Combined RX buffer sizing into a single function.
- Added buffer size and interrupt coalescing settings to adapter info
printout.

Submitted by: davidch
MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 584d21f6 06-Oct-2010 Doug Ambrisko <ambrisko@FreeBSD.org>

Add the capability to read the complete contents of the NVRAM via sysctl
dev.bce.<unit>.nvram_dump
Add the capability to write the complete contents of the NVRAM via sysctl
dev.bce.<unit>.nvram_write
These are only available if the kernel option BCE_DEBUG is enabled.
The nvram_write sysctl also requires the kernel option
BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your
own caution. Since the MAC addresses are stored in the NVRAM, if you
dump one NIC and restore it on another NIC the destination NIC's
MAC addresses will not be preserved. A tool can be made using these
sysctl's to manage the on-chip firmware.

Reviewed by: davidch, yongari


# ad09ad06 19-Jul-2010 Pyun YongHyeon <yongari@FreeBSD.org>

Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.

Reviewed by: davidch


# 7c409214 29-Apr-2010 David Christensen <davidch@FreeBSD.org>

- Enable flow control.
- Print device details only when verbose boot is enabled.
- Add debug output for shared memory access.
- Add debug statistics (checksum offload & VLAN frame counters).
- Modify TX path to update consumer index for each frame completed
rather than updating the consumer index only once for a group of
frames to improve small packet performance.
- Print driver/firmware pulse messages only when verbose boot
is enabled.
- Add debug sysctl to clear statistics.
- Fix more style(9) violations.

MFC after: 2 weeks


# fa7ad760 15-Apr-2010 Pyun YongHyeon <yongari@FreeBSD.org>

MFC r206268
- Fixed 5708S 2.5G support broken in last commit.
- Added some new debug helper routines to systcl.
- Fixed many of the style(9) violations that have crept into the code
due to my use of a "smart" editor.


# 9c89e977 15-Apr-2010 Pyun YongHyeon <yongari@FreeBSD.org>

MFC r205300:
- Added support for 5709S/5716S PHYs.
- Update copyright to 2010.
- Add new debug code for RV2P block.
- Improve output formatting for various debug functions.

PR: kern/134658, kern/136417, kern/139761, kern/140970


# e1188c28 05-Apr-2010 David Christensen <davidch@FreeBSD.org>

- Fixed 5708S 2.5G support broken in last commit.
- Added some new debug helper routines to systcl.
- Fixed many of the style(9) violations that have crept into the code
due to my use of a "smart" editor.

MFC after: 2 weeks


# 4f7bf104 18-Mar-2010 Pyun YongHyeon <yongari@FreeBSD.org>

MFC r202717:
- Added a workaround for NC-SI management firmware that would allow
frames to be accepted while the driver is resetting the hardware.
This failure is generally observed when broadcast frames are received
during driver load and will generate "Unable to write CTX memory"
errors.
- Small changes to driver flags display.

PR: kern/135836, kern/140684


# c8331f5c 18-Mar-2010 David Christensen <davidch@FreeBSD.org>

- Added support for 5709S/5716S PHYs.
- Update copyright to 2010.
- Add new debug code for RV2P block.
- Improve output formatting for various debug functions.

MFC after: 2 weeks


# bff0eb4e 20-Jan-2010 David Christensen <davidch@FreeBSD.org>

- Added a workaround for NC-SI management firmware that would allow
frames to be accepted while the driver is resetting the hardware.
This failure is generally observed when broadcast frames are received
during driver load and will generate "Unable to write CTX memory"
errors.
- Small changes to driver flags display.


# 5b7c4503 15-Nov-2009 Stanislav Sedov <stas@FreeBSD.org>

- MFC r198320:
Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
into if_bce.c anyway. It is disabled by default.


# a0d60084 20-Oct-2009 Stanislav Sedov <stas@FreeBSD.org>

- Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header
splitting in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not
propagated into if_bce.c anyway. It is disabled by default.

Approved by: davidch
MFC after: 3 days


# d037d7ae 23-Jun-2009 David Christensen <davidch@FreeBSD.org>

- Added code to read bootcode firwmare version.
- Created dedicated shared memory access routines.

MFC after: One week


# 8ef3f835 08-May-2009 David Christensen <davidch@FreeBSD.org>

- Fixed incorrect packet length problem caused be earlier change to
support ZERO_COPY_SOCKETS.
- Created #define for context initialization retry count.

MFC after: 1 week


# 725e9bc7 03-Mar-2009 David Christensen <davidch@FreeBSD.org>

- Updated firmware to latest 4.6.X release.
- Added missing firmware for 5709 A1 controllers.
- Changed some debug statistic variable names to be more consistent.

Submitted by: davidch
MFC after: Two weeks


# 0e38e31f 27-Feb-2009 David Christensen <davidch@FreeBSD.org>

- Update copyright to 2009.
- Only enable split header operation when ZERO_COPY_SOCKETS is enabled in
the kernel.

Submitted by: davidch
MFC after: 1 week


# db7f0b97 21-Nov-2008 Kip Macy <kmacy@FreeBSD.org>

- bump __FreeBSD version to reflect added buf_ring, memory barriers,
and ifnet functions

- add memory barriers to <machine/atomic.h>
- update drivers to only conditionally define their own

- add lockless producer / consumer ring buffer
- remove ring buffer implementation from cxgb and update its callers

- add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to
allow drivers to efficiently manage multiple hardware queues
(i.e. not serialize all packets through one ifq)
- expose if_qflush to allow drivers to flush any driver managed queues

This work was supported by Bitgravity Inc. and Chelsio Inc.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# b6d57579 27-Aug-2008 David Christensen <davidch@FreeBSD.org>

- Updated support for 5716.
- Added some additional code for debug builds.
- Fixed a problem printing physical memory on 64bit system during debugging.
- Modified some of the context memory and mailbox register names to more
clearly distinguish their use.
- Added memory barriers for Intel CPUs when accessing host memory data
structures which are written by hardware.

MFC after: Two weeks.


# 7752e34d 12-Jun-2008 David Christensen <davidch@FreeBSD.org>

- Added support for BCM5709 and BCM5716 controllers.

MFC after: 2 weeks


# 680ece59 09-Jun-2008 David Christensen <davidch@FreeBSD.org>

- Fixed kern/123696 by increasing firmware timeout value from 100 to 1000.
- Fixed a problem on i386 architecture when using split header/jumbo frame
firmware caused by hardware alignment requirements.
- Added #define BCE_USE_SPLIT_HEADER to allow the feature to be enabled/
disabled. Enabled by default.

PR: kern/123696
MFC after: 2 weeks


# 46c3c836 11-Apr-2008 David Christensen <davidch@FreeBSD.org>

- Fixed a problem with the send chain consumer index which would cause
TX traffic to sit in the send chain until a received packet kick
started the interrupt handler. This would cause extremely slow
performance when used with NFS over UDP.
- Removed untested polling code.
- Updated copyright year in the file header.
- Removed inadvertent ^M's created by DOS text editor.

MFC after: 2 weeks


# 8ec2795f 21-Feb-2008 David Christensen <davidch@FreeBSD.org>

MFC after: 4 weeks

- Added loose RX MTU functionality to allow frames larger than 1500 bytes
to be accepted even though the interface MTU is set to 1500.
- Implemented new TCP header splitting/jumbo frame support which uses
two chains for receive traffic rather than the original single recevie
chain.
- Added additional debug support code.


# 990a2aa5 30-Jul-2007 David Christensen <davidch@FreeBSD.org>

- Fixed a problem that would cause kernel panics and "bce0: discard frame .."
errors (especially when jumbo frames are enabled or in low memory systems)
because the RX chain was corrupted when an mbuf was mapped to an unexpected
number of buffers.
- Fixed a problem that would cause kernel panics when an excessively
fragmented TX mbuf couldn't be defragmented and was released by
bce_tx_encap().

Approved by: re(hrs)
MFC after: 7 days


# ca4c7b3b 15-Jun-2007 David Christensen <davidch@FreeBSD.org>

- Migrated IPMI fix from RELENG_6.
- Added additional debug code.


# 133ac1f5 06-Jun-2007 David Christensen <davidch@FreeBSD.org>

New Features:
- Added 2.5G support for BCM5708S.

MFC after: 4 weeks


# 56759046 16-May-2007 David Christensen <davidch@FreeBSD.org>

- Added TSO support
- Updated firmware to latest release (v3.4.8) to fix TSO + jumbo frame lockup
- Added MSI (hw.bce.msi_enable) and TSO (hw.bce.tso_enable) sysctls
- Fixed kernel panic when MSI is used and module is unloaded
- Added several new debug routines
- Removed slack space for RX/TX chains since it only covers sloppy coding
- Fixed a potential problem when programming jumbo MTU size in hardware
- Various other comment changes

MFC after: 4 weeks


# d2b9bc42 04-May-2007 David Christensen <davidch@FreeBSD.org>

MFC after: 2 weeks

Updated copyright date to 2007.

Tested with BCM5706 A3.

Added ID for BCM5708 B2.

Removed unused driver version string.

Modified BCE_PRINTF macro to automatically fill-in the sc pointer.

Fixed a kernel panic when the driver was loaded as a module from the
command-line because the MII bus pointer was null (i.e. the MII bus
hadn't been enumerated yet).

Added fix proposed by Vladimir Ivanov <wawa@yandex-team.ru> to prevent
driver state corruption when releasing the lock during the ISR in
bce_rx_intr() to send packets up the stack.

Added new TX chain and register read sysctl interfaces for debugging.

Cleaned up formatting for various other debug routines.

Added a new statistic maintained by firmware which tracks the number
of received packets dropped because no receive buffers are available.


# 5411f544 10-Jan-2007 Xin LI <delphij@FreeBSD.org>

- Instead of if_watchdog/if_timer interface use our own timer
that piggybacks on bce_tick() callout.
- Instead of unconditionally resetting the controller, try to
skip the reset in case we got a pause frame, like em(4) did.
- Lock bce_tick() using callout_init_mtx().

Discussed with/Reviewed by: glebius, scottl, davidch


# 46222d08 15-Nov-2006 Scott Long <scottl@FreeBSD.org>

Due to an incorrect macro, it appears that this driver has always been
accidentally truncating off the VLAN tag field in the TX descriptor. Fix
this by splitting up the vlan_tag and flags fields into separate fields,
and handling them appropriately.

Sponsored by: Ironport
MFC After: 3 days


# 4eaefb81 24-Oct-2006 Scott Long <scottl@FreeBSD.org>

Refine the checksum hack a little. It appears that the chip can handle UDP
and TCP checksum offloading fine, it only has a problem with IP checksums on
IP fragments.. Barring a fix or workaround available from the hardware, the
real solution would be to have finer grained control in the stack over what
can and cannot be assisted in hardware.


# 49caa8a9 21-Oct-2006 Scott Long <scottl@FreeBSD.org>

There seems to be a problem with txcsum and UDP. Turn it off until it is
understood better. This fixes timeout problems with NFS.


# c5a01a41 15-Oct-2006 Scott Long <scottl@FreeBSD.org>

Overhaul the transmit and dma paths:
- Use bus_dmamap_load_mbuf_sg() to eliminate the need for the callback and
all of the extra bookkeeping associated with it.
- Eliminate the bce_dmamap_arg structure and streamline the memory allocation
routines to not need it. This does change some of the debugging messages.
- Refactor the loop that fills the buffer descriptor so that it can be done
with a single set of logic in a single loop instead of two sets of logic.
- Eliminate the need to cache and pass descriptor indexes between the start
loop and the encap function.
- Change the start loop to always check the ifnet sendq for more work.

This significantly helps the driver withstand large UDP workloads, though
it's still not perfect. I suspect the remaining work lies with handling
the OACTIVE flag, and also in possibly streamlining the interrupt handler
some. It is, however, nearly on par with the other popular gigabit drivers
in terms of stability now.


# ec6887f8 13-Oct-2006 Scott Long <scottl@FreeBSD.org>

Don't copy the bd_chain head pointers into temporary objects, they are
available globally.


# c40da00c 16-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


# 179162e8 03-May-2006 Matt Jacob <mjacob@FreeBSD.org>

Gratuitous tag alignment. It bugged me.


# 262af1c8 26-Apr-2006 Paul Saab <ps@FreeBSD.org>

Only use the low address for stats collection.


# 75231ae3 25-Apr-2006 John Baldwin <jhb@FreeBSD.org>

Fix half of the current i386 tinderbox failure. max_bus_addr should be a
bus_addr_t rather than a bus_size_t.


# 6caf734f 10-Apr-2006 Paul Saab <ps@FreeBSD.org>

Add a driver for the Broadcom NetXtreme II (BCM5706/BCM5708)
PCI/PCIe Gigabit Ethernet adapeter.

Submitted by: David Christensen