MFC r347365, r347703r347365:Update dme(4) to reflect that it will not be removed due to FCP-101.dme(4) is the built-in NIC on a couple non-expandable mips platforms andthus should remain. The
MFC r347365, r347703r347365:Update dme(4) to reflect that it will not be removed due to FCP-101.dme(4) is the built-in NIC on a couple non-expandable mips platforms andthus should remain. The FCP has been updated to reflect this fact.Discussed with: impr347703:FCP-101: ae(4) is sufficently popular to be moved to the keep list.
show more ...
MFC r339703:Deprecate a number of less used 10 and 10/100 Ethernet devices.The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,pcn, sf, sn, tl, tx, txp, vx, wb, xeThe list was
MFC r339703:Deprecate a number of less used 10 and 10/100 Ethernet devices.The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe,pcn, sf, sn, tl, tx, txp, vx, wb, xeThe list was defined as part of FCP-0101. Per the FCP, devices may beremoved from the deprecation list if enough users are found or they areconverted to iflib.FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.mdApproved by: re (gjb)Reviewed by: rgrimesDifferential Revision: https://reviews.freebsd.org/D17654
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INF
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement 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 totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).Approved by: re (glen)
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's ea
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's easy to apply/reapply when churn dies down.
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement 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 totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).
Add PNP info to PCI attachment of ae driverReviewed by: imp, chuckSubmitted by: Lakhan Shiva Kamireddy <[email protected]>Sponsored by: Google, Inc. (GSoC 2018)
ifnet: Replace if_addr_lock rwlock with epoch + mutexRun on LLNW canaries and tested by pho@gallatin:Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5based ConnectX 4-LX NIC, I
ifnet: Replace if_addr_lock rwlock with epoch + mutexRun on LLNW canaries and tested by pho@gallatin:Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5based ConnectX 4-LX NIC, I see an almost 12% improvement in receivedpacket rate, and a larger improvement in bytes delivered all the wayto 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 GBfree4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.324.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.324.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.324.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.324.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.324.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.324.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32After the patchInMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.515.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.515.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.515.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.515.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.525.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patchReviewed by: gallatinSponsored by: Limelight NetworksDifferential Revision: https://reviews.freebsd.org/D15366
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Fix a potentially forever loop.Found by: PVS-Studio
Yet more redundant parenthesis from r298431.Mea culpa.
sys: use our nitems() macro when param.h is available.This should cover all the remaining cases in the kernel.Discussed in: freebsd-current
Fix a potentially "forever" loop.Found by: PVS-Studio
Mechanically convert to if_inc_counter().
Use define from if_var.h to access a field inside struct if_data,that resides in struct ifnet.Sponsored by: Nginx, Inc.
Fix various NIC drivers to properly cleanup static DMA resources.In particular, don't check the value of the bus_dma map against NULLto determine if either bus_dmamem_alloc() or bus_dmamap_load() s
Fix various NIC drivers to properly cleanup static DMA resources.In particular, don't check the value of the bus_dma map against NULLto determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded.Instead, assume that bus_dmamap_load() succeeeded (and thus thatbus_dmamap_unload() should be called) if the bus address for a resourceis non-zero, and assume that bus_dmamem_alloc() succeeded (and thusthat bus_dmamem_free() should be called) if the virtual address for aresource is not NULL.In many cases these bugs could result in leaks when a driver was detached.Reviewed by: yongariMFC after: 2 weeks
Failed m_devget(9) indicates lack of free mbuf cluster. Updateif_iqdrops counter for that case since the received frame is ok.While here, simplify updating counter logic.
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareto this event, adding if_var.h to files that do need it. Also, includeall includes that now are included due to implicit po
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareto this event, adding if_var.h to files that do need it. Also, includeall includes that now are included due to implicit pollution via if_var.hSponsored by: NetflixSponsored by: Nginx, Inc.
Avoid magic constant.No functional change.
o TxD ring requires 8 bytes alignment to work so change alignment constraint to 8. Previously it may have triggered watchdog timeouts. o Check whether interrupt is ours or not. o Enable inter
o TxD ring requires 8 bytes alignment to work so change alignment constraint to 8. Previously it may have triggered watchdog timeouts. o Check whether interrupt is ours or not. o Enable interrupts before attemping to transmit queued packets. This will slightly improve TX performance. o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is used to know whether there are enough available TxD ring space. o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged code to avoid unncessary register access. o Make sure to clear TxD, TxS, RxD rings in driver initialization. Otherwise some data in these rings could be interpreted as 'updated' which in turn will advance internally maintained pointers and can trigger watchdog timeouts.PR: kern/180382
Fix the build.
Check the return value of pci_find_cap()
To send a frame, controller requires a prepended TX header andthe length of frame should be treated as multiple of 4. Actualframe length is set in the TX header. The TX header positionshould be al
To send a frame, controller requires a prepended TX header andthe length of frame should be treated as multiple of 4. Actualframe length is set in the TX header. The TX header positionshould be aligned on 4 byte boundary and actual frame startposition should be aligned on 4 byte boundary as well. This meanswe need 4(TX header length) + 3(frame length fixup) additional freespace in TX buffer in addition to actual frame length.Make sure TX handler check these additional bytes.ae_tx_avail_size() returns actual free space in TX buffer to easethe calculation of available TX buffer space in caller. While I'mhere, replace magic number to appropriate sizeof operator toenhance readability.This change should fix controller lockup issue happened undercertain conditions but it still does not fix watchdog timeout. Itseems the watchdog timeout is side-effect of TxS and TxDmismatches. The root cause of TxD/TxD mismatch is not known yet butit looks like silicon bug. I guess driver may have to reinitializecontroller whenever it sees TxS and TxD mismatches but leave it asit was at this moment.PR: kern/145918
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers i
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago.- Let mii_phy_add_media() also announce the support of IFM_NONE.- Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS.- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway.- Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD.- Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate.- Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD.- According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible.- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE.Obtained from: NetBSD (partially)Reviewed by: yongari (earlier version), silence on arch@ and net@
Do a sweep of the tree replacing calls to pci_find_extcap() with calls topci_find_cap() instead.
sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.Commit the rest of the devices.
12