aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/tsec
Commit message (Collapse)AuthorAgeFilesLines
* tsec: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-10/+5
| | | | Notes: svn path=/head/; revision=365143
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-9/+9
| | | | | | | | | | | | | | | | | | | 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
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-211-14/+12
| | | | Notes: svn path=/head/; revision=353859
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-274-0/+8
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. Notes: svn path=/head/; revision=326255
* Clean up MD pollution of bus_dma.h:Jason A. Harmening2017-07-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inline mapping functions by defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>. This is currently useful for sparc64, x86, and arm64, which all implement non-load dmamap operations as simple wrappers around map objects which may be bus- or device-specific. --Remove NULL-checked bus_dmamap macros. Implement the equivalent NULL checks in the inlined x86 implementation. For non-x86 platforms, these checks are a minor pessimization as those platforms do not currently allow NULL maps. NULL maps were originally allowed on arm64, which appears to have been the motivation behind adding arm[64]-specific barriers to bus_dma.h, but that support was removed in r299463. --Simplify the internal interface used by the bus_dmamap_load* variants and move it to bus_dma_internal.h --Fix some drivers that directly include sys/bus_dma.h despite the recommendations of bus_dma(9) Reviewed by: kib (previous revision), marius Differential Revision: https://reviews.freebsd.org/D10729 Notes: svn path=/head/; revision=320528
* Don't calltsec_receive_intr_locked() from the error interrupt handler.Justin Hibbits2017-04-041-3/+0
| | | | | | | | | | | | | The tsec_error_intr_locked() is called with the global lock owned (e.g. the transmit and the receive lock are both owned). We must not call tsec_receive_intr_locked() while owning the transmit lock. The normal receive interrupt takes care that frames are received, this is none of the business of the error interrupt. Submitted by: Sebastian Huber <sebastian.huber_AT_embedded-brains.de> Notes: svn path=/head/; revision=316482
* Defragment the transmit mbuf chain only if necessary.Justin Hibbits2017-04-042-220/+137
| | | | | | | | | | | | | | | Use a method similar to the if_dwc driver. Use a wmb() before the flags of the first transmit buffer of a frame are written. Group transmit/receive structure members for better cache efficiency. Tested on P1020RDB. TCP transmit throughput increases from 60MiB/s to 90MiB/s. Submitted by: Sebastian Huber <sebastian.huber_AT_embedded-brains.de> Notes: svn path=/head/; revision=316481
* Fix mis-manual merge.Justin Hibbits2017-04-041-2/+2
| | | | | | | | | Timeout is now effectively a boolean rather than a time-remaining. This was missed in r316478, but included in the original patch (mis-merged with a manual merge). Notes: svn path=/head/; revision=316480
* Fix set-but-not-used warningsJustin Hibbits2017-04-041-6/+1
| | | | | | | Submitted by: Sebastian Huber <sebastian_DOT_huber_AT_embedded-brains_DOT_de> Notes: svn path=/head/; revision=316479
* Use a common tsec_mii_wait() function to busy wait for status changes.Justin Hibbits2017-04-041-21/+31
| | | | | | | | | | | | | | The status indicators are not set immediatly after a command. Discard the first value. Unlock the PHY mutex after a timeout in tsec_init_locked(). Tested on the P1020RDB. Submitted by: Sebastian Huber <sebastian_DOT_huber_AT_embedded-brains_DOT_de> Notes: svn path=/head/; revision=316478
* Add support for NXP/Freescale etsec2 ethernet controllerJustin Hibbits2016-08-302-19/+56
| | | | | | | | | | | | | | | Adding the compatible property check isn't enough. Device trees for eTSEC2 devices are missing a 'reg' property on the eTSEC node itself, relegating it to the queue group child nodes. Still left to do: add Multigroup mode support (see QorIQ reference manuals s for SoCs with eTSEC2). MFC after: 2 weeks Relnotes: Yes Notes: svn path=/head/; revision=305040
* Add an alternate compatible string for eTSEC devices.Justin Hibbits2016-05-191-1/+2
| | | | | | | | Newer device trees now use fsl,etsec2 to denote eTSEC nodes. Same device, new name. Notes: svn path=/head/; revision=300176
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Allow callers of OF_decode_addr to get the size of the found mapping. ThisAndrew Turner2016-02-161-1/+1
| | | | | | | | | | | | | | | | | will allow for code that uses the old fdt_get_range and fdt_regsize functions to find a range, map it, access, then unmap to replace this, up to and including the map, with a call to OF_decode_addr. As this function should only be used in the early boot code the unmap is mostly do document we no longer need the mapping as it's a no-op, at least on arm. Reviewed by: jhibbits Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5258 Notes: svn path=/head/; revision=295662
* Fix a couple printf formats.Justin Hibbits2016-01-011-1/+1
| | | | | | | This was found when working on 64-bit PowerPC book-e support. Notes: svn path=/head/; revision=293039
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-10/+10
| | | | Notes: svn path=/head/; revision=271849
* Rename OF_xref_phandle() to OF_node_from_xref() and add a new functionIan Lepore2014-09-011-1/+1
| | | | | | | | | that provides the inverse translation, OF_xref_from_node(). Discussed with: nwhitehorn Notes: svn path=/head/; revision=270945
* Remove bogus module dependencies.Marcel Moolenaar2014-07-261-2/+0
| | | | Notes: svn path=/head/; revision=269132
* Follow r261352 by updating all drivers which are children of simplebusIan Lepore2014-02-021-0/+3
| | | | | | | | | | | | | | | | to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Notes: svn path=/head/; revision=261410
* Make tsec work with the device tree present on the RB800. The previous codeNathan Whitehorn2013-11-114-20/+63
| | | | | | | | | | | assumed that the MDIO bus was a direct child of the Ethernet interface. It may not be and indeed on many device trees is not. While here, add proper locking for MII transactions, which may be on a bus shared by several MACs. Hardware donated by: Benjamin Perrault Notes: svn path=/head/; revision=257993
* - Provide necessary includes.Gleb Smirnoff2013-10-291-2/+2
| | | | | | | | | | - Remove unnecessary includes. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257324
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* Do not reinitialise the interface if it is already running, this prevents theAndrew Thompson2012-05-091-0/+3
| | | | | | | | bootp+nfs code from working as it calls init on each dhcp send and rx fails to start in time. Notes: svn path=/head/; revision=235147
* The DEVICE_POLLING dereference of sc->tsec_ifp needs to be checked for nullAndrew Thompson2012-05-081-7/+7
| | | | | | | | first or this will panic. Condense three blocks that check sc->tsec_ifp into one while I am here. Notes: svn path=/head/; revision=235144
* Respect phy-handle property in Ethernet nodes of the device tree.Rafal Jaworowski2012-03-043-22/+16
| | | | | | | | | | | This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from: Semihalf MFC after: 1 week Notes: svn path=/head/; revision=232518
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo2012-01-071-1/+0
| | | | | | | Reviewed by: yongari Notes: svn path=/head/; revision=229767
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-5/+2
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Don't use the MAC address in the device tree if it's all zeroesMarcel Moolenaar2011-01-281-19/+10
| | | | | | | | | | (i.e. 00-00-00-00-00-00). Use the currently programmed address instead. While here, simplify the function. Notes: svn path=/head/; revision=218050
* Convert the PHY drivers to honor the mii_flags passed down and convertMarius Strobl2010-10-151-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Notes: svn path=/head/; revision=213893
* Convert Freescale PowerPC platforms to FDT convention.Rafal Jaworowski2010-07-113-56/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following systems are affected: - MPC8555CDS - MPC8572DS This overhaul covers the following major changes: - All integrated peripherals drivers for Freescale MPC85XX SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values). - This includes: LBC, PCI / PCI-Express, I2C, DS1553, OpenPIC, TSEC, SEC, QUICC, UART, CFI. - Thanks to the common FDT infrastrucutre (fdtbus, simplebus) we retire ocpbus(4) driver, which was based on hard-coded config data. Note that world for these platforms has to be built WITH_FDT. Reviewed by: imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=209908
* tsec: Use IFQ_DRV macros for managing interface packet queue.Rafal Jaworowski2009-11-201-3/+3
| | | | | | | | | | This lets tsec(4) work with ALTQ. Submitted by: Marcin Ligenza MFC after: 1 week Notes: svn path=/head/; revision=199580
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-2/+2
| | | | | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Notes: svn path=/head/; revision=195049
* Fix Book-E/MPC85XX build. Some prototypes were wrong and got revealed withRafal Jaworowski2009-06-132-4/+7
| | | | | | | the recent kobj signature checking. Notes: svn path=/head/; revision=194101
* When user_frac in the polling subsystem is low it is going to busy theAttilio Rao2009-05-301-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible. In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped). Bump __FreeBSD_version in order to signal such situation. Reviewed by: emaste Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=193096
* tsec(4) cosmetics.Rafal Jaworowski2009-02-171-2/+1
| | | | Notes: svn path=/head/; revision=188719
* tsec(4): Always try to resume the receiver.Rafal Jaworowski2009-02-171-3/+10
| | | | | | | | | This helps recover from RX stall under heavy loads. Submitted by: Piotr Ziecik kosmo ! semihalf dot com Notes: svn path=/head/; revision=188718
* tsec(4): do not clear interrupt events register before use.Rafal Jaworowski2009-02-171-2/+2
| | | | | | | | | | | | Prior to this fix, IEVENT register was always cleared before calling tsec_error_intr_locked(), which prevented error recovery actions from happening with polling enabled (and could lead to serious problems, including controller hang). Submitted by: Marcin Ligenza marcinl ! pacomp dot com dot pl Notes: svn path=/head/; revision=188715
* Handle mbuf exhaustion scenario in tsec(4).Rafal Jaworowski2009-02-171-1/+6
| | | | | | | | | Without this fix the system would hang under heavy networking load. Submitted by: Leon Theunissen leon ! parsec dot co dot za Notes: svn path=/head/; revision=188713
* tsec(4) style improvements and clean-up.Rafal Jaworowski2009-02-173-73/+80
| | | | Notes: svn path=/head/; revision=188712
* Additional features for the tsec(4) Ethernet driver.Rafal Jaworowski2009-02-174-133/+774
| | | | | | | | | | | | | | | | | - interrupt coalescing - polling - jumbo frames - multicast - VLAN tagging The enhanced version of the chip (eTSEC) can also take advantage of: - TCP/IP checksum calculation h/w offloading Obtained from: Freescale, Semihalf Notes: svn path=/head/; revision=188711
* tsec: Refactor driver's structure.Rafal Jaworowski2008-08-263-553/+628
| | | | | | | | | | | | | | | Split the driver into the core functionality part (sys/dev/tsec/if_tsec.c) and the bus attachment (sys/dev/tsec/if_tsec_ocp.c). This lets better integrate and maintain the driver in other environments with different attachment abstractions (there is at least one other FreeBSD port -- MPC83xx -- which uses this TSEC driver, but with different local bus model i.e. some OF derivative). While there, clean up and fix minor cosmetics. Obtained from: Semihalf Notes: svn path=/head/; revision=182189
* tsec: Improve and clean up callouts.Rafal Jaworowski2008-08-262-19/+15
| | | | | | | | | | | - eliminate the unused tsec_tick_ch callout - adjust and fix the main tsec callout handling - minor naming improvements Obtained from: Semihalf Notes: svn path=/head/; revision=182187
* Convert TSEC watchdog to the new scheme.Rafal Jaworowski2008-03-122-18/+29
| | | | | | | | Reviewed by: imp, marcel Approved by: cognet (mentor) Notes: svn path=/head/; revision=177111
* Obtain TSEC h/w address from the parent bus (OCP) and not rely blindly on whatRafal Jaworowski2008-03-121-10/+14
| | | | | | | | | | | | | | | might be currently programmed into the registers. Underlying firmware (U-Boot) would typically program MAC address into the first unit only, and others are left uninitialized. It is now possible to retrieve and program MAC address for all units properly, provided they were passed on in the bootinfo metadata. Reviewed by: imp, marcel Approved by: cognet (mentor) Notes: svn path=/head/; revision=177110
* Support for Freescale integrated Three-Speed Ethernet Controller (TSEC).Rafal Jaworowski2008-03-033-0/+2287
TSEC is the MAC engine offering 10, 100 or 1000 Mbps speed and is found on different Freescale parts (MPC83xx, MPC85xx). Depending on the silicon version there are up to four TSEC units integrated on the chip. This driver also works with the enhanced version of the controller (eTSEC), which is backwards compatible, but doesn't take advantage of its additional features (various off-loading mechanisms) at the moment. Approved by: cognet (mentor) Obtained from: Semihalf MFp4: e500 Notes: svn path=/head/; revision=176774