freebsd-nq/sys
Marius Strobl 1ed3fed743 o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop()
to gem_attach() as the former access softc members not yet initialized
  at that time and gem_reset() actually is enough to stop the chip. [1]
o Revise the use of gem_bitwait(); add bus_barrier() calls before calling
  gem_bitwait() to ensure the respective bit has been written before we
  starting polling on it and poll for the right bits to change, f.e. even
  though we only reset RX we have to actually wait for both GEM_RESET_RX
  and GEM_RESET_TX to clear. Add some additional gem_bitwait() calls in
  places we've been missing them according to the GEM documentation.
  Along with this some excessive DELAYs, which probably only were added
  because of bugs in gem_bitwait() and its use in the first place, as
  well as as have of an gem_bitwait() reimplementation in gem_reset_tx()
  were removed.
o Add gem_reset_rxdma() and use it to deal with GEM_MAC_RX_OVERFLOW errors
  more gracefully as unlike gem_init_locked() it resets the RX DMA engine
  only, causing no link loss and the FIFOs not to be cleared. Also use it
  deal with GEM_INTR_RX_TAG_ERR errors, with previously were unhandled.
  This was based on information obtained from the Linux GEM and OpenSolaris
  ERI drivers.
o Turn on workarounds for silicon bugs in the Apple GMAC variants.
  This was based on information obtained from the Darwin GMAC and Linux GEM
  drivers.
o Turn on "infinite" (i.e. maximum 31 * 64 bytes in length) DMA bursts.
  This greatly improves especially RX performance.
o Optimize the RX path, this consists of:
  - kicking the receiver as soon as we've a spare descriptor in gem_rint()
    again instead of just once after all the ready ones have been handled;
  - kicking the receiver the right way, i.e. as outlined in the GEM
    documentation in batches of 4 and by pointing it to the descriptor
    after the last valid one;
  - calling gem_rint() before gem_tint() in gem_intr() as gem_tint() may
    take quite a while;
  - doubling the size of the RX ring to 256 descriptors.
  Overall the RX performance of a GEM in a 1GHz Sun Fire V210 was improved
  from ~100Mbit/s to ~850Mbit/s.
o In gem_add_rxbuf() don't assign the newly allocated mbuf to rxs_mbuf
  before calling bus_dmamap_load_mbuf_sg(), if bus_dmamap_load_mbuf_sg()
  fails we'll free the newly allocated mbuf, unable to recycle the
  previous one but a NULL pointer dereference instead.
o In gem_init_locked() honor the return value of gem_meminit().
o Simplify gem_ringsize() and dont' return garbage in the default case.
  Based on OpenBSD.
o Don't turn on MAC control, MIF and PCS interrupts unless GEM_DEBUG is
  defined as we don't need/use these interrupts for operation.
o In gem_start_locked() sync the DMA maps of the descriptor rings before
  every kick of the transmitter and not just once after enqueuing all
  packets as the NIC might instantly start transmitting after we kicked
  it the first time.
o Keep state of the link state and use it to enable or disable the MAC
  in gem_mii_statchg() accordingly as well as to return early from
  gem_start_locked() in case the link is down. [3]
o Initialize the maximum frame size to a sane value.
o In gem_mii_statchg() enable carrier extension if appropriate.
o Increment if_ierrors in case of an GEM_MAC_RX_OVERFLOW error and in
  gem_eint(). [3]
o Handle IFF_ALLMULTI correctly; don't set it if we've turned promiscuous
  group mode on and don't clear the flag if we've disabled promiscuous
  group mode (these were mostly NOPs though). [2]
o Let gem_eint() also report GEM_INTR_PERR errors.
o Move setting sc_variant from gem_pci_probe() to gem_pci_attach() as
  device probe methods are not supposed to touch the softc.
o Collapse sc_inited and sc_pci into bits for sc_flags.
o Add CTASSERTs ensuring that GEM_NRXDESC and GEM_NTXDESC are set to
  legal values.
o Correctly set up for 802.3x flow control, though #ifdef out the code
  that actually enables it as this needs more testing and mainly a proper
  framework to support it.
o Correct and add some conversions from hard-coded functions names to
  __func__ which were borked or forgotten in if_gem.c rev. 1.42.
o Use PCIR_BAR instead of a homegrown macro.
o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN].
o In gem_pci_attach() in case attaching fails release the resources in
  the opposite order they were allocated.
o Make gem_reset() static to if_gem.c as it's not needed outside that
  module.
o Remove the GEM_GIGABIT flag and the associated code; GEM_GIGABIT was
  never set and the associated code was in the wrong place.
o Remove sc_mif_config; it was only used to cache the contents of the
  respective register within gem_attach().
o Remove the #ifdef'ed out NetBSD/OpenBSD code for establishing a suspend
  hook as it will never be used on FreeBSD.
o Also probe Apple Intrepid 2 GMAC and Apple Shasta GMAC, add support for
  Apple K2 GMAC. Based on OpenBSD.
o Add support for Sun GBE/P cards, or in other words actually add support
  for cards based on GEM to gem(4). This mainly consists of adding support
  for the TBI of these chips. Along with this the PHY selection code was
  rewritten to hardcode the PHY number for certain configurations as for
  example the PHY of the on-board ERI of Blade 1000 shows up twice causing
  no link as the second incarnation is isolated.
  These changes were ported from OpenBSD with some additional improvements
  and modulo some bugs.
o Add code to if_gem_pci.c allowing to read the MAC-address from the VPD on
  systems without Open Firmware.
  This is an improved version of my variant of the respective code in
  if_hme_pci.c
o Now that gem(4) is MI enable it for all archs.

Pointed out by:	yongari [1]
Suggested by:	rwatson [2], yongari [3]
Tested on:	i386 (GEM), powerpc (GMACs by marcel and yongari),
		sparc64 (ERI and GEM)
Reviewed by:	yongari
Approved by:	re (kensmith)
2007-09-26 21:14:18 +00:00
..
amd64 Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
arm Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
boot Mention that autoboot_delay also accepts the "NO" value. 2007-09-26 08:38:25 +00:00
bsm Merge OpenBSM 1.0 alpha 15 changes to src/sys/bsm: 2007-07-22 12:28:13 +00:00
cam Do not forget to cam_periph_unhold the peripheral before exiting 2007-07-21 18:07:45 +00:00
cddl Now that we have CDDLed code in the tree, add CDDL license. 2007-09-23 07:04:50 +00:00
compat Allow the ia32 resource limits (compat.ia32.max{dsiz,ssiz,vmem} to be 2007-09-24 20:49:39 +00:00
conf o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop() 2007-09-26 21:14:18 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r172314, 2007-09-24 17:12:36 +00:00
crypto
ddb - Move all of the PS_ flags into either p_flag or td_flags. 2007-09-17 05:31:39 +00:00
dev o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop() 2007-09-26 21:14:18 +00:00
fs Remove some of the pessimizations involving writing the fsi sector. 2007-09-23 14:49:32 +00:00
gdb
geom LINT compiled just fine for me, but it seems it breaks tinerbox way of 2007-09-23 15:10:48 +00:00
gnu Some times ago, vfs_getopts() was changed, so that it would set error to 2007-08-20 15:33:22 +00:00
i4b I4B header files were repo-copied from sys/i386/include/ to 2007-07-06 07:17:22 +00:00
i386 Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
ia64 Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
isa It seems that some i386 mothermoards either do not implement the 2007-07-27 09:34:42 +00:00
kern Fix the description of the formula used to autosize the number of 2007-09-26 11:22:23 +00:00
libkern
modules o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop() 2007-09-26 21:14:18 +00:00
net Certain consumers of rtalloc like gif(4) and if_stf(4) lookup the 2007-09-23 17:50:17 +00:00
net80211 invalidate ic_prevchan when constructing a new channel list 2007-09-18 21:54:27 +00:00
netatalk
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph Dead code removal. 2007-09-21 08:25:55 +00:00
netinet Revert rev. 1.94. After recent tcp backouts, tcp_close() may return NULL. 2007-09-24 14:46:27 +00:00
netinet6 - Incorrect error EAGAIN returned for invalid send on a locked 2007-09-13 10:36:43 +00:00
netipsec Fix for an infinite loop in processing ESP, IPv6 packets. 2007-09-12 05:54:53 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm
netncp
netsmb Fixing the mount_smbfs(8) hanging by utilising the destroy_dev_sched() KPI. 2007-07-10 09:23:10 +00:00
nfs
nfs4client
nfsclient Fix for a very rare race, caused by the nfsiod wakeup and nfsiod idle 2007-09-25 21:08:49 +00:00
nfsserver Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
opencrypto Quiet warnings. These do not appear to be actually used uninitialized, 2007-07-05 06:59:14 +00:00
pc98 Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
pccard
pci - Add the device ID for the VIA VT3324 (CX700) chipset. 2007-09-21 02:10:13 +00:00
powerpc o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop() 2007-09-26 21:14:18 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security - Move all of the PS_ flags into either p_flag or td_flags. 2007-09-17 05:31:39 +00:00
sparc64 - Use the actual clock frequency of the PCI bus instead of assuming 2007-09-26 20:10:36 +00:00
sun4v Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
sys Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
tools
ufs Fix a DIV0 in case a large value for fs_avgfilesize or fs_avgfpdir 2007-09-10 14:12:29 +00:00
vm Correct an error in the previous revision, specifically, 2007-09-25 21:01:10 +00:00
Makefile Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/coda 2007-07-12 21:04:58 +00:00