summaryrefslogtreecommitdiff
path: root/sys/dev/xe
AgeCommit message (Collapse)Author
2019-05-17FCP-101: Remove xe(4)Brooks Davis
Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Notes: svn path=/head/; revision=347923
2018-10-25Deprecate a number of less used 10 and 10/100 Ethernet devices.Brooks Davis
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
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
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
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
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-03-18Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.Justin Hibbits
On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544 Notes: svn path=/head/; revision=297000
2016-02-27Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
2016-02-01These files were getting sys/malloc.h and vm/uma.h with header pollutionGleb Smirnoff
via sys/mbuf.h Notes: svn path=/head/; revision=295126
2015-12-11Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingWarner Losh
block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Notes: svn path=/head/; revision=292079
2015-01-06In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson
socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276750
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2013-10-26Provide includes that are needed in these files, and before were readGleb Smirnoff
in implicitly via if.h -> if_var.h pollution. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257179
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
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
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2011-11-07Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten
The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
2010-05-03Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev
queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month Notes: svn path=/head/; revision=207554
2009-06-26Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson
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
2008-06-04Style(9) xe(4). The MD5 sums are different, but comparing the dissassembliesJohn Baldwin
the only changes are from gcc moving some global variables around slightly. Notes: svn path=/head/; revision=179551
2008-06-04Gah, always reset the timer for the watchdog check.John Baldwin
Notes: svn path=/head/; revision=179548
2008-06-04- Split the interrupt handler up into separate subroutines for rx, tx, andJohn Baldwin
MAC events. - Use bus_*() rather than bus_space_*() and remove the bus space tag and handle from the softc. - Retire unused macros for examining CIS tuples. Notes: svn path=/head/; revision=179543
2008-06-03- Change the watchdog timer logic to match other drivers that use their ownJohn Baldwin
timer by keeping a once-a-second timer running that decrements a counter similar to if_timer and reset the chip if it gets down to zero via the decrement. - Use IFQ_SET_MAXLEN(). Notes: svn path=/head/; revision=179527
2008-06-02Add locking and make xe(4) MPSAFE:John Baldwin
- Add a mutex to protect the softc and device hardware. - Use a callout rather than a callout_handle for the media timer. - Use a dedicated timer for managing the tx watchdog rather than if_timer. - Fix some resource leaks if xe_attach() fails. - Shutdown the device before detaching the driver. - Setup the interrupt handler after ether_ifattach(). Tested by: Ian FREISLICH ianf of clue.co.za Notes: svn path=/head/; revision=179492
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
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
2006-04-15o Fix printf(9) formatting: do not use hardcode "0x" and "#" flagsMaxim Konovalov
simultaneously. Remove "#' flag to match a style of the rest of file. PR: kern/85477 Submitted by: Oliver Fromme Notes: svn path=/head/; revision=157772
2005-11-11- Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov
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
2005-11-11Catch up with IFP2ENADDR() type change (array -> pointer).Ruslan Ermilov
Notes: svn path=/head/; revision=152311
2005-10-06Fix a nasty typo. Change:Pawel Jakub Dawidek
if (foo); bar(); to: if (foo) bar(); Really, really nasty bug and a very nice catch of mine. Unfortunately, I'll not become a hero of the day, because the code is commented out. Notes: svn path=/head/; revision=150989
2005-09-19Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh
could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Notes: svn path=/head/; revision=150306
2005-09-13MFp4:Warner Losh
o Use pccard_cis_scan o use pccard_attr_write_1 o Update comments Notes: svn path=/head/; revision=150109
2005-08-09Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson
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
2005-08-07Other changes to this driver preclude its use on 4.x, so remove 4.x compatWarner Losh
code elsewhere in the driver. Notes: svn path=/head/; revision=148838
2005-08-03Modify device drivers supporting multicast addresses to lock if_addr_mtxRobert Watson
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
2005-07-15Use the new cis scanning code to look for the proper MAC address. TheWarner Losh
offset varies between models of these cards. # this gets the MAC address right for my CEM-2, but it doesn't detect # the media attached correctly. Notes: svn path=/head/; revision=148031
2005-07-15Fix a couple of leaking situations when errors happen.Warner Losh
Notes: svn path=/head/; revision=148030
2005-07-15Fix the xircom match routine. In it we were always return a matchWarner Losh
when the base vendor/id didn't match. Some cards woudl bogusly match and would cause other downstream problems. Notes: svn path=/head/; revision=148029
2005-07-13Stop using OLDCARD shims. rename xe_pccard_match to xe_pccard_probeWarner Losh
and combine the old xe_pccard_{probe,attach} into one routine _attach. Create a lookup function to lookup items in the table. Eliminate the check for network cards, since many modems were eliminated by it. Tweak a few printfs as well. This gets many of my older cards working again CEM2, CEM28, CEM36, etc. Notes: svn path=/head/; revision=147961
2005-07-10Add a boatload of new device ids, gleaned from the pcmcia-cs-3.2.8Warner Losh
distribution. Add the appropriate devices to the man pages. Obtained from: pcmcia-cs Approved by: re (scottl) Notes: svn path=/head/; revision=147872
2005-06-24Eliminate unused argument in PCMCIA_CARD macro.Warner Losh
Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite) Notes: svn path=/head/; revision=147580
2005-06-14Remove a duplicate assignment.Brooks Davis
Reported by: delphij Approved by: re (ifnet blanket) Notes: svn path=/head/; revision=147382
2005-06-10Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis
struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam Notes: svn path=/head/; revision=147256
2005-01-20u_intXX_t -> uintXX_tWarner Losh
Fix a comment Notes: svn path=/head/; revision=140521
2005-01-06Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh
Notes: svn path=/head/; revision=139749
2004-08-14Since if_xe doesn't contain locking or run with INTR_MPSAFE, markRobert Watson
the interface as IFF_NEEDSGIANT so if_start is run holding Giant. Notes: svn path=/head/; revision=133703
2004-06-27MFp4:Warner Losh
Add Intel Pro100Lan56 card. Also integrate changes from Carlos Velasco. Only attch if we're a network device (to filter out the serial devices). Also, increment vpmatch if we match to conform to the pccard match function api. Notes: svn path=/head/; revision=131193
2004-06-09Replace convoluted and broken CRC calcuation with ether_crc32_le().Christian Weisgerber
This should fix multicast reception. Notes: svn path=/head/; revision=130255
2004-05-30Add missing <sys/module.h> includesPoul-Henning Kamp
Notes: svn path=/head/; revision=129879
2004-05-27Fix disordering of pccarddevs.h noticed by bde. Also remove a fewWarner Losh
redundant includes and fix some of the include disordering. Submitted by: bde Notes: svn path=/head/; revision=129764
2004-05-26Move to generating pccarddevs.h on the fly, both for the kernel andWarner Losh
the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment. Notes: svn path=/head/; revision=129740
2004-05-23We don't need to initialize if_output, ether_ifattach() does itMaxime Henrion
for us. Notes: svn path=/head/; revision=129616
2004-04-15Remove improper use of if_addrhead in device drivers to checkLuigi Rizzo
if the link-level address has been initialized already. The majority of modern drivers never does this and works fine, which makes me think that the check is totally unnecessary and a residue of cut&paste from other drivers. This change is done to simplify locking because now almost none of the drivers uses this field. The exceptions are "ct" "ctau" and "cx" where i am not sure if i can remove that part. Notes: svn path=/head/; revision=128293