aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/de
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate a number of less used 10 and 10/100 Ethernet devices.Brooks Davis2018-10-251-0/+2
| | | | | | | | | | | | | | The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, pcn, sf, sn, tl, tx, txp, vx, wb, xe The list as refined as part of FCP-0101. Per the FCP, devices may be removed from the deprecation list if enough users are found or they are converted to iflib. FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Notes: svn path=/head/; revision=339703
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* GC never enabled support for SIOCGADDRROM and SIOCGCHIPID.Brooks Davis2018-03-292-17/+0
| | | | | | | | | | | | | | | When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Notes: svn path=/head/; revision=331737
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-0/+6
| | | | | | | | | | | | | | | 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
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-2/+2
| | | | | | | | | | | 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
* Remove dangling DE425 EISA card references in the de driver. TheyWarner Losh2017-02-021-14/+0
| | | | | | | aren't used, and this doesn't change the supported hardware. Notes: svn path=/head/; revision=313082
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-033-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Fix build when KTR is defined but not KTR_TULIP.Svatopluk Kraus2015-11-201-1/+1
| | | | | | | Approved by: kib (mentor) Notes: svn path=/head/; revision=291095
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-6/+6
| | | | Notes: svn path=/head/; revision=271849
* Don't bother clearing maps for static DMA allocations to NULL. Instead,John Baldwin2014-06-171-2/+0
| | | | | | | leave them as purely opaque values that are only set by bus_dmamem_alloc(). Notes: svn path=/head/; revision=267589
* Fix a few more drivers that were explicitly destroying the bus_dmaJohn Baldwin2014-06-111-1/+0
| | | | | | | map created by bus_dmamem_alloc(). Notes: svn path=/head/; revision=267365
* 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-4/+4
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* More conversions of drivers to use the PCI parent DMA tag.Scott Long2012-03-121-3/+4
| | | | Notes: svn path=/head/; revision=232874
* Replace `inline static' by `static inline'.Ed Schouten2011-12-131-1/+1
| | | | | | | | | If I interpret the C standard correctly, the storage specifier should be placed before the inline keyword. While at it, replace __inline by inline in the files affected. Notes: svn path=/head/; revision=228471
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-1/+1
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Use a private timer to run the statistics timer instead of (ab)usingJohn Baldwin2009-11-172-20/+15
| | | | | | | | | if_watchdog and if_timer. Tested by: WATANABE Kazuhiro CQG00620 of nifty.ne.jp Notes: svn path=/head/; revision=199378
* Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.Pyun YongHyeon2009-09-242-9/+8
| | | | | | | | | | | | | | | | | | | | | | Also align setup descriptor on 32 bytes boundary. Tx buffer have no alignment limitation so create dmamap without alignment restriction[1]. Rx buffer still seems to require 4 bytes alignment limitation but we can simply use MCLBYTES for size to map the buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated with m_getcl(9). de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers, increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES. While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore. This should fix de(4) breakage introduced after r176206. Submitted by: jhb [1] Reported by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp > Tested by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >, Takahashi Yoshihiro < nyan <> jp dot freebsd dot org > Notes: svn path=/head/; revision=197465
* Destroy dmamap in dma cleanup.Pyun YongHyeon2009-09-241-0/+1
| | | | Notes: svn path=/head/; revision=197464
* Consistently use bus_addr_t.Pyun YongHyeon2009-09-242-10/+10
| | | | Notes: svn path=/head/; revision=197463
* Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to applyPyun YongHyeon2009-09-242-5/+2
| | | | | | | | alignment fixup code for received frames on strict alignment architectures. Notes: svn path=/head/; revision=197461
* 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
* tulip_busdma_cleanup: pass correct vaddr (2nd arg) to bus_dmamem_free()Max Khon2009-02-091-1/+1
| | | | | | | | Found with: Coverity Prevent(tm) CID: 1998 Notes: svn path=/head/; revision=188396
* During attach on some de(4) adapters the driver sends out a test packet asJohn Baldwin2008-04-051-2/+6
| | | | | | | | | | | | | part of detecting the media. Explicitly ensure that we don't send it to bpf(4) as bpf(4) isn't setup yet. This worked by accident before the bpf interface stuff was reworked to avoid other races (bpf_peers_present, etc.) but now it needs an explicit check to avoid a panic. MFC after: 3 days PR: kern/120915 Notes: svn path=/head/; revision=177937
* The maxsegsz of a dma tag created in de(4) is TULIP_DATA_PER_DESC bytes.Pyun YongHyeon2007-06-071-1/+1
| | | | | | | | | | | | | In Rx path it allocates a new mbuf with m_getcl(9) so the length of the mbuf is MCLBYTES which is greater than a segment size specified by the dma tag. This segment size mismatch caused a voluntary panic. Fix the panic by settting the mbuf length to TULIP_DATA_PER_DESC. Reported by: Arne H Juul <arnej AT yahoo-inc DOT com> Tested by: Arne H Juul <arnej AT yahoo-inc DOT com> Notes: svn path=/head/; revision=170389
* Increase size of timer counter bitfield to accomodate the actual size of theMatt Jacob2007-05-201-1/+1
| | | | | | | | | | | default timer value. Discovered By: gcc 4.2 MFC after: 3 days Notes: svn path=/head/; revision=169797
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* - Consistently use if_printf() only in interface methods: if_start(),Gleb Smirnoff2006-09-152-32/+31
| | | | | | | | | | | if_watchdog, etc., or in functions used only in these methods. In all other functions in the driver use device_printf(). - Use __func__ instead of typing function name. Submitted by: Alex Lyashkov <umka sevcity.net> Notes: svn path=/head/; revision=162321
* Remove various bits of conditional Alpha code and fixup a few comments.John Baldwin2006-05-121-39/+0
| | | | Notes: svn path=/head/; revision=158471
* Repo copy de driver to dev/de, and adjust.Warner Losh2006-02-262-5/+5
| | | | Notes: svn path=/head/; revision=156034
* Use the copy of the card's MAC address saved in tulip_enaddr() in the softcJohn Baldwin2005-12-221-3/+12
| | | | | | | | | | if we need a valid MAC address (for probing the media for example) before ether_ifattach() has been called since IF_LLADDR() is NULL then. Tested by: tisco Notes: svn path=/head/; revision=153644
* Use ETHER_ADDR_LEN rather than hardcoding 6.John Baldwin2005-12-211-1/+1
| | | | Notes: svn path=/head/; revision=153617
* Fix the type of "eaddr" to guarantee the required alignment.Ruslan Ermilov2005-12-011-8/+8
| | | | | | | Suggested by: marcel Notes: svn path=/head/; revision=152992
* Byte copy IF_LLADDR() on stack to align it to be safe for typecasts.Ruslan Ermilov2005-11-302-21/+20
| | | | | | | Tested by: jhb Notes: svn path=/head/; revision=152962
* Various fixes to make de(4) not panic after ru@'s IF_LLADDR() changes:John Baldwin2005-11-212-30/+22
| | | | | | | | | | | | | | | | | | - Don't call tulip_addr_filter() to reset the RX address filter in tulip_reset() since that gets called before ether_ifattach(). Just call it in tulip_init_locked(). - Use be16dec() and le16dec() to parse MAC addresses when programming the RX filter. - Let ether_ioctl() handle SIOCSIFMTU since we were doing the exact same thing with the added bonus that we leaked the driver lock if the MTU was > ETHERMTU in the homerolled version. This part will be MFC'd. Clue from: wpaul (1) Stolen from: marcel (2 via patch for dc(4)) MFC after: 1 week Notes: svn path=/head/; revision=152666
* - Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov2005-11-111-9/+9
| | | | | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead. Notes: svn path=/head/; revision=152315
* - Use m_defrag() instead of homerolling our own variantJohn Baldwin2005-08-261-68/+55
| | | | | | | | | | | | | | | | | | tulip_mbuf_compress(). If we fail to allocate a new mbuf to copy the data into, put the mbuf back in the driver's send queue so that we can retry it later rather than throwing the packet away. - Use m_devget() instead of doing it inline ourselves in the TULIP_COPY_RXDATA case. If we fail to allocate an mbuf to copy the data into, don't forget about the original mbuf cluster. The old code would lose the pointer and leak the cluster in that case. Now it doesn't lose it but always sticks the original rx buffer back into the receive ring after trying to copy the data out and send it up the stack. Also, if we fail to allocate a new mbuf to copy the data into, log an input error. Also, don't combine the priming case with the received-a-packet case to make the code flow a bit clearer and easier to follow. Notes: svn path=/head/; revision=149497
* - Remove non-bus-dma code.John Baldwin2005-08-252-456/+134
| | | | | | | | | | | - Remove form feed characters. - Fixup style of function declarations. - Assume that an mbuf cluster is big enough to hold an ethernet frame. (This should really be using m_defrag(), but this diff is just simple changes for now.) Notes: svn path=/head/; revision=149476
* Major rototill of this driver to add FreeBSD bus-dma support:John Baldwin2005-08-252-529/+774
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allocate arrays of metadata for the descriptors in the rx and tx rings and change the ring pointers to walk the metadata array rather than the actual descriptor rings. Each metadata object contains a pointer to its descriptor, a pointer to any associated mbuf, and a pointer to the associated bus_dmamap_t in the bus_dma case. The mbuf pointers replace the tulip_txq and tulip_rxq local ifqueue's in the softc. - Add lots of KTR trace entries using a local KTR_TULIP level which defaults to 0, but can be changed to KTR_DEV at the top of the file when debugging. - Rename tulip_init(), tulip_start(), tulip_ifinit(), and tulip_ifstart() to tulip_init_locked(), tulip_start_locked(), tulip_init(), and tulip_start(), respectively, to match the convention in other drivers. - Add a TULIP_SP_MAC() macro to encode two bytes of the MAC address into the setup buffer and use that in place of lots of BYTE_ORDER #ifdef's. Also, remove an incorrect XXX comment I added earlier, the driver was correct (at least it does the same thing dc(4) does). TULIP_SP_MAC was shamelessly copied from DC_SP_MAC() in dc(4). - Remove the #ifdef'd NetBSD bus-dma code and replace it with FreeBSD bus-dma code that not only compiles but even works at runtime. - Use callout_init_mtx() instead of just callout_init(). - Correct the various wrapper macros for bus_dmamap_sync() for the rx and tx buffers to only ask for the sync ops that they actually need. - Tidy the #ifdef TULIP_COPY_RXDATA code by expanding an #ifdef a bit so it becomes easier to read at the expense of a couple of duplicated lines of code. Also, use m_getcl() to get an mbuf cluster rather than MGETHDR() followed by MCLGET(). - Maintain the ring free (ri_free) count for the rx ring metadata since we no longer have tulip_rxq.ifq_len around to indicate how many mbuf's are currently in the rx ring. - Add code to teardown bus_dma resources when attach fails and generally fixup attach to do a better job of cleaning up when it fails. This gets us a good bit closer to possibly having a detach method someday and making this driver an unloadable module. - Add some functions that can be called from ddb to dump the state of a descriptor ring and to dump the state of an individual descriptor. - Various comment grammer and spelling fixes. I have bus-dma turned on by default, but I've left the non-bus-dma code around so that it can be turned off to aid in debugging should any problems turn up later on. I'll be removing the non-bus-dma code in a subsequent commit. Notes: svn path=/head/; revision=149473
* - Use htole32() instead of using bswap32() conditional on #if BYTE_ORDER.John Baldwin2005-08-171-19/+8
| | | | | | | | | | - Don't set IFF_ALLMULTI in our ifnet's if_flags if we end up allowing all multicast due to limits in the MAC receive filters in hardware. Requested by: rwatson (2) Notes: svn path=/head/; revision=149206
* Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros.John Baldwin2005-08-171-9/+0
| | | | Notes: svn path=/head/; revision=149205
* Call tulip_start() rather than tulip_ifstart() from the interrupt handlerJohn Baldwin2005-08-091-1/+1
| | | | | | | | | | to avoid recursing on the driver lock. Not sure why my test box didn't catch this earlier. MFC after: 3 days Notes: svn path=/head/; revision=148906
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-15/+16
| | | | | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days Notes: svn path=/head/; revision=148887
* Modify device drivers supporting multicast addresses to lock if_addr_mtxRobert Watson2005-08-031-0/+2
| | | | | | | | | | | over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week Notes: svn path=/head/; revision=148654
* - Use callout_*() rather than timeout() to periodically poll the media.John Baldwin2005-07-272-40/+156
| | | | | | | | | | | | - Add locking to protect the softc and mark this driver as MP safe. There are still some edge cases with multiport cards that need more locking work. MFC after: 1 week Tested on: alpha Notes: svn path=/head/; revision=148445
* - Use the PCIR_BAR() macro rather than hardcoding rids.John Baldwin2005-07-211-8/+4
| | | | | | | | - Use pci_enable_busmaster() rather than fiddling with the PCI command register directly. Notes: svn path=/head/; revision=148256
* Don't set if_start to tulip_ifstart all over the place. It is alreadyJohn Baldwin2005-07-211-6/+0
| | | | | | | | | set in tulip_attach() and its value is never changed, so all the extra sets are redundant. I'm guessing that at some point in time de(4) had an alternate start routine, but that hasn't been true in recent history. Notes: svn path=/head/; revision=148255
* Remove conditional code that has largely rotted that is also not on byJohn Baldwin2005-07-212-233/+13
| | | | | | | | | | | | default: - TULIP_NEED_FASTTIMEOUT - tulip_fasttimeout() wasn't called anywhere - BIG_PACKET - only worked on i386 anyway - TULIP_USE_SOFTINTR - doesn't compile and was never updated to handle new netisr registration - non-FreeBSD code Notes: svn path=/head/; revision=148252
* Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386John Baldwin2005-07-211-20/+2
| | | | | | | and alpha, respectively. Notes: svn path=/head/; revision=148249