summaryrefslogtreecommitdiff
path: root/sys/dev/bce
AgeCommit message (Collapse)Author
2025-08-25bce(4): Fix a typo in a source code commentGordon Bergling
- s/firwmare/firmware/ MFC after: 3 days
2025-02-02bce: make compile with BCE_DEBUGWarner Losh
Builds now with BCE_DEBUG defined. All bets are of as to whether or not it works though. This is not the default, and likely quite a rare config given (a) it's been broken for years and (b) this is an old card people aren't actively debugging anymore. I don't have the hardware to test it, though I've not changed anything in the BCE_DEBUG undefined case. Sponsored by: Netflix
2025-02-02bce: Fix register dumping to skip blank areaWarner Losh
When compiling with debug enabled, this produces an always false warning. It's clear that this was to skip ranges that aren't used when dumping the registers, so change the && to || to skip things properly. PR: 200984 Sponsored by: Netflix
2025-01-02bus_generic_detach: Delete children after detaching themJohn Baldwin
This provides better semantics as a standalone DEVMETHOD for device_attach as bus drivers should remove child devices they created as part of detach cleanup. The implementation calls bus_detach_children() first to permit child devices an opportunity to veto the detach operation. If that succeeds, device_delete_children() is used to delete the child devices. This requires fixing various drivers that were deleting devices explicitly (via a device_t pointer cached in the softc) after calling bus_generic_detach to stop doing that and just rely on bus_generic_detach to remove child devices. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47959
2024-06-28net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang
Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
2024-06-16bce: Use device_set_descf()Mark Johnston
No functional change intended. MFC after: 1 week
2024-01-20bce(4): Fix a typo in a kernel messageGordon Bergling
- s/adddress/address/ MFC after: 5 days
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-02-06Mechanically convert bce(4) to IfAPIJustin Hibbits
Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37841
2022-09-03bce(4): Fix a typo in a source code commentGordon Bergling
- s/overriden/overridden/ MFC after: 3 days
2022-08-06bce(4): Fix two typos in kernel messagesGordon Bergling
- s/bufferred/buffered/ MFC after: 3 days
2022-05-06bce: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-05-06Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin
2022-04-05bce: Mark a few debugging variables as unused.Warner Losh
Sponsored by: Netflix
2022-04-02bce(4): Fix a typo in a source code commentGordon Bergling
- s/exisitng/existing/ MFC after: 3 days
2021-12-02Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"Cy Schubert
This reverts commit 266f97b5e9a7958e365e78288616a459b40d924a, reversing changes made to a10253cffea84c0c980a36ba6776b00ed96c3e3b. A mismerge of a merge to catch up to main resulted in files being committed which should not have been.
2021-12-02wpa: Import wpa_supplicant/hostapd commit 14ab4a816Cy Schubert
This is the November update to vendor/wpa committed upstream 2021-11-26. MFC after: 1 month
2021-12-02bce(4): Fix a typo in a sysctl descriptionGordon Bergling
- s/duirng/during/ MFC after: 3 days
2021-08-14Fix some common typos in source code commentsGordon Bergling
- s/struture/structure/ - s/structre/structure/ MFC after: 5 days
2020-09-01bce: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365119
2020-03-01Remove all the compatibility hacks for systems that predate FreeBSD 8. Some ofWarner Losh
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... Notes: svn path=/head/; revision=358486
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2019-10-21Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff
Notes: svn path=/head/; revision=353810
2018-09-26Reapply, with minor tweaks, r338025, from the original commit:Warner Losh
Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
2018-08-19Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer
I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
2018-08-19Remove unused and easy to misuse PNP macro parameterConrad Meyer
Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
2018-05-18ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy
Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
2018-04-17Add PNP info to the bce driver.Warner Losh
Submitted by: Lakhan Shiva Kamireddy Pull Request: https://github.com/freebsd/freebsd/pull/136 Notes: svn path=/head/; revision=332651
2017-11-20sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
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. Notes: svn path=/head/; revision=326022
2017-02-20sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni
Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-04-21sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni
rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
2015-02-24Correct a typo.Pyun YongHyeon
Reported by: jmg Notes: svn path=/head/; revision=279223
2014-12-27Const'ify a firmware image missed in r251142.Marius Strobl
MFC after: 3 days Notes: svn path=/head/; revision=276313
2014-09-25- Provide bce_get_counter() to return counters that are not collected,Gleb Smirnoff
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. Notes: svn path=/head/; revision=272096
2014-09-03Use CSUM_BITS instead of incorrect copy.Gleb Smirnoff
Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271005
2014-06-28Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky
Notes: svn path=/head/; revision=267992
2014-06-27Revert r267961, r267973:Glen Barber
These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
2014-06-27Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky
there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
2014-06-11- Unmap static DMA buffers allocated via bus_dmemem_alloc() beforeJohn Baldwin
freeing them instead of after. - Check the bus address of a static DMA buffer to decide if the associated map should be unloaded. - Don't try to destroy bus dma maps for static DMA buffers. Reviewed by: davidcs Notes: svn path=/head/; revision=267377
2014-05-08Modify Copyright information and other strings to reflect Qlogic ↵David C Somayajulu
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 Notes: svn path=/head/; revision=265703
2014-03-31Increase the number of TX DMA segments from 32 to 35. It turnedPyun YongHyeon
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 Notes: svn path=/head/; revision=263957
2013-10-29Fix regression introduced in r235816.Pyun YongHyeon
r235816 triggered kernel panic or hang after warm boot. Don't blindly restore BCE_EMAC_MODE media configuration in bce_reset(). If driver is about to shutdown it will invoke bce_reset() which in turn results in restoring BCE_EMAC_MODE media configuration. This operation seems to confuse controller firmware. Reported by: Paul Herman (herman <> cleverbridge dot com) Tested by: sbruno, Paul Herman (herman <> cleverbridge dot com) Notes: svn path=/head/; revision=257307
2013-10-26Move includes from if_bcereg.h to .c files.Gleb Smirnoff
Notes: svn path=/head/; revision=257173
2013-08-19Remove unused and incomplete support for delayed fragment checksumsAndre Oppermann
from bce(4), bxe(4), mge(4) and ti(4) drivers. Notes: svn path=/head/; revision=254516
2013-06-30Fix triggering false watchdog timeout when controller is in PAUSEPyun YongHyeon
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> Notes: svn path=/head/; revision=252402
2013-05-30- Checking for spurious interrupts is only necessary when using INTx.Marius Strobl
Actually, this may be further optimized for controller variants supporting one-shot MSIs but I'm lacking the necessary hardware for testing. - Add some missing synchronization of the statistics and status DMA maps. MFC after: 1 week Notes: svn path=/head/; revision=251159
2013-05-30- Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are notMarius Strobl
altered or actually needed there any longer. - Honor errors passed to the DMA mapping callbacks. - In bce_get_rx_buf(), do not reserve stack space for more DMA segments than actually necessary. - In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9). - In bce_rx_intr(), remove a pointless check for an empty mbuf pointer which can only happen in case of a severe programming error. Moreover, recovering from that situation would require way more actions with header splitting enabled (which it is by default). - Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the firmware has been told to keep it. [1] Obtained from: OpenBSD [1] MFC after: 1 week Notes: svn path=/head/; revision=251146
2013-05-30- As a follow-up to r247565, make firmware images that do not requireMarius Strobl
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 Notes: svn path=/head/; revision=251142