Commit Graph

150446 Commits

Author SHA1 Message Date
Brooks Davis
43ede8f5fe MFC r201954:
Update the comment on printing group membership to reflect that fact
  that each group the process is a member of is printed rather than
  an entry for each group the user could be a member of.
2010-01-12 06:11:36 +00:00
Brooks Davis
0e003a57ce MFC r201953:
Correct the explination text for the kern.ngroups.  It reflects the
  number of supplemental groups, not the total number of groups.
2010-01-12 06:09:56 +00:00
Brooks Davis
9600c47d52 MFC r201443:
Add vlan(4) to all GENERIC kernels.
2010-01-12 06:00:56 +00:00
Qing Li
4cc5ccf399 MFC r201544
An existing incomplete ARP entry would expire a subsequent
statically configured entry of the same host. This bug was
due to the expiration timer was not cancelled when installing
the static entry. Since there exist a potential race condition
with respect to timer cancellation, simply check for the
LLE_STATIC bit inside the expiration function instead of
cancelling the active timer.
2010-01-12 00:04:13 +00:00
Andrew Gallatin
a5905446f8 Sync mxge(4) with head:
r197391: Add support for TX throttling
r198250: Move mxge(4)'s NIC watchdog reset handler from
	 a callout to a taskqueue
r198303: Make mxge do a better job recovering from NIC h/w faults
r200845: Don't take the driver mutex in mxge_tick()
r201758: Remove extraneous semicolons
2010-01-11 20:32:51 +00:00
Rick Macklem
6049e7fcf7 MFC: r201029
When porting the experimental nfs subsystem to the FreeBSD8 krpc,
I added 3 functions that were already in the experimental client
under different names. This patch deletes the functions in the
experimental client and renames the calls to use the other set.
(This is just removal of duplicated code and does not fix any bug.)
2010-01-11 19:30:23 +00:00
John Baldwin
5e3b84c3d2 MFC 201522:
Expose the upper 256 ptys in the default devfs rules.  I should have updated
this when expanding the old pty(4) driver to use 512 ptys by default.  This
is more important for 7.x.
2010-01-11 18:42:29 +00:00
Konstantin Belousov
2d63cbda24 MFC r200770:
Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for
vnode-backed vm objects.
2010-01-11 12:35:16 +00:00
Ruslan Ermilov
60ee8f1ae1 MFC: r200026,201801: Swap carp(4) log levels. 2010-01-11 12:32:06 +00:00
Christian Brueffer
811a80b4a4 MFC: r201538, r201539
Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
almost three years ago in r166794.

Add a missing word.
2010-01-11 05:19:51 +00:00
Xin LI
0801667fe3 MFC r201143:
Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool
to version 14, making it possible for zpools created on OpenSolaris
2009.06 be used on FreeBSD.

PR:		kern/141800
Submitted by:	mm
Reviewed by:	pjd, trasz
Obtained from:	OpenSolaris onnv-gate
2010-01-11 02:31:00 +00:00
Marcel Moolenaar
1bb65f7e64 MFC rev 201269, 201373:
o   Revamp bus_space access functions (201269).
o   Change BUS_SPACE_MAXADDR from 2^32-1 to 2^64-1 (201373).
2010-01-10 23:51:02 +00:00
Jilles Tjoelker
86892d512c MFC r210428: sh: Add a regression test that tries out all arithmetic ops.
The gaps in the numbering sequence cannot really be avoided, as HEAD changes
are not necessarily merged in the same order as they are made (if they are
merged at all).
2010-01-10 16:58:12 +00:00
Fabien Thomas
40095a24ed MFC 201151:
Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().
2010-01-10 16:08:14 +00:00
Fabien Thomas
a267011a08 MFC 201023:
* Support the L1D_CACHE_LD event on Core2 processors.
 * Correct a group of typos: for Core2 programmable events, check
   user supplied umask values against the correct event descriptor
   field.
2010-01-10 16:04:32 +00:00
Fabien Thomas
cd56dc4253 MFC 201021:
Log process mappings for existing processes at PMC start time.
2010-01-10 16:00:00 +00:00
Konstantin Belousov
28f48c5ccc MFC r201743:
Give some information on SF_MNOWAIT flag.

MFC r201759 (by brueffer):
Fix a typo and bump date for the previous commit.

MFC r201760:
Further fix grammar.
2010-01-10 11:25:34 +00:00
Xin LI
f0c3103b9a MFC r201756:
Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD
revision 200726 and 200727).

Reviewed by:  mm@
2010-01-10 07:08:11 +00:00
Pyun YongHyeon
b7cf4e03b6 MFC r200693:
Make sure to enable Next Page bit for IP1001. Otherwise the PHY
  fails to re-establishe 1000baseT link after downgrading to
  10/100Mbps link.
2010-01-09 01:17:31 +00:00
Pyun YongHyeon
18c3b93957 MFC r200641,200676
r200641:
  Document newly added loader tunable and sysctl variables.
   o hw.vge.msi_disable
   o dev.vge.%d.int_holdoff
   o dev.vge.%d.rx_coal_pkt
   o dev.vge.%d.tx_coal_pkt

r200676:
  Document more VIA Velocity family controllers to vge(4). Previously
  it mentioned only VT6122. While I'm here remove the mention of
  VT3119 which seems to be VIA's internal model name and VT3119
  wouldn't be available to end users.

  Reviewed by:  brueffer
2010-01-09 00:36:28 +00:00
Christian Brueffer
1cb2c81c14 MFC: r201397
Add one more supported controller.
2010-01-09 00:27:23 +00:00
Pyun YongHyeon
50a44b8b9b MFC r200696,200740,200756,200758-200759,200972
r200696:
  Add rudimentary WOL support. While I'm here remove enabling
  busmastering/memory address in resume path. Bus driver will handle
  that.

r200740:
  Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending
  timer for Tx queue is at 0x3E.

r200756:
  Correct fragment bit definition in comments.

r200758:
  VT6130 datasheet was wrong. If VT6130 receive a jumbo frame the
  controller will split the jumbo frame into multiple RX buffers.
  However it seems the hardware always dma the frame to 8 bytes
  boundary for the split frames. Only the first part of the fragment
  can have 4 byte alignment and subsequent buffers should be 8 bytes
  aligned. Change RX buffer the alignment requirement to 8 bytes from
  4 bytes.

r200759:
  Disable jumbo frame support for PCIe VT6130/VT6132 controllers.
  Quite contrary to VT6130 datasheet which says it supports up to 8K
  jumbo frame, VT6130 does not seem to send jumbo frame that is
  larger than 4K in length. Trying to send a frame that is larger
  than 4K cause TX MAC hang.
  Even though it's possible to allow 4K jumbo frame for VT6130, I
  think it's meaningless to allow 4K jumbo frame. I'm not sure VT6132
  also has the same limitation but I guess it uses the same MAC of
  VT6130.

r200972:
  Remove wrong assertion.
2010-01-09 00:26:57 +00:00
Pyun YongHyeon
6f311c8682 MFC r200638:
Implement interrupt moderation scheme supported by VT61xx
  controllers. TX/RX interrupt mitigation is controlled by
  VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress
  generation of interrupts until the programmed frames counter equals
  to the registers. VT61xx also supports interrupt hold off timer
  register. If this interrupt hold off timer is active all interrupts
  would be disabled until the timer reaches to 0. The timer value is
  reloaded whenever VGE_ISR register written. The timer resolution is
  about 20us.

  Previously vge(4) used single shot timer to reduce Tx completion
  interrupts. This required VGE_CRS1 register access in Tx
  start/completion handler to rearm new timeout value and it did not
  show satisfactory result(more than 50k interrupts under load). Rx
  interrupts was not moderated at all such that vge(4) used to
  generate too many interrupts which in turn made polling(4) better
  approach under high network load.

  This change activates all interrupt moderation mechanism and
  initial values were tuned to generate interrupt less than 8k per
  second. That number of interrupts wouldn't add additional packet
  latencies compared to polling(4). These interrupt parameters could
  be changed with sysctl.
  dev.vge.%d.int_holdoff
  dev.vge.%d.rx_coal_pkt
  dev.vge.%d.tx_coal_pkt
  Interface has be brought down and up again before change take
  effect.

  With interrupt moderation there is no more need to loop in
  interrupt handler. This loop always added one more register access.
  While I'm here remove dead code which tried to implement subset of
  interrupt moderation.
2010-01-09 00:17:43 +00:00
Pyun YongHyeon
babaf83d9a MFC r200616-200617,200635,200639,200644
r200616:
  Add new flag VGE_FLAG_SUSPENDED to mark suspended state and
  remove suspended member in softc.

r200617:
  Add "Velocity" to probe message which will make it clearer which
  ethernet controller was recognized. VIA consistently calls
  "Velocity" family for gigabit ethernet controllers. For fast
  ethernet controllers they uses "Rhine" family(vr(4) controllers))
  and vr(4) already shows "Rhine" in probe message.

r200635:
  Remove unused VGE_ETHER_ALIGN definition.

r200639:
  Actually clear interrupts. Writing 0 has no effect.

r200644:
  Remove unused member variable of softc.
2010-01-09 00:12:59 +00:00
Pyun YongHyeon
2e04b85932 MFC 200615:
Add hardware MAC statistics support. This statistics could be
  extracted from dev.vge.%d.stats sysctl node.
2010-01-09 00:07:03 +00:00
Pyun YongHyeon
b907792655 MFC r200551-200552,200555,200558,200609,200613
r200551:
  Whenever link state change interrupt is raised, vge_tick() is
  called and vge(4) used to drive auto-negotiation timer(mii_tick) in
  vge_tick(). Therefore the mii_tick was not called for every hz such
  that auto-negotiation complete was never handled in vge(4).
  Use mii_pollstat to extract current negotiated speed/duplex instead
  of mii_tick. The latter is valid only for auto-negotiation case.
  While I'm here change the confusing function name vge_tick() to
  vge_link_statchg().

r200552:
  Report media change result to caller instead of returning success
  without regard to the result.

r200555:
  Don't report current link status if interface is not UP.
  If interface is not UP, the current link status wouldn't
  reflect the negotiated status.

r200558:
  Tell upper layer vge(4) supports long frames. This should be done
  after ether_ifattach(), as ether_ifattach() initializes it with
  ETHER_HDR_LEN.
  While I'm here remove setting if_mtu, it's already handled in
  ether_ifattach().

r200609:
  All vge(4) controllers support RX/TX checksum offloading for VLAN
  tagged frames so add checksum offloading capabilities. Also add
  missing VLAN hardware tagging control in ioctl handler and let
  upper stack know current VLAN capabilities.

r200613:
  Rewrite RX filter setup and simplify code.
  Now promiscuous mode and multicast handling is performed in single
  function, vge_rxfilter().
2010-01-09 00:02:40 +00:00
Pyun YongHyeon
b79a3f6583 MFC r200538,200540-200541,200543,200545,200548
r200538:
  Introduce vge_flags member in softc. The vge_flags member will
  record device specific bits. Remove vge_link and use vge_flags.
  While here, move clearing link state before mii_mediachg() as
  mii_mediachg() may affect link state.

r200540:
  Save PHY address by reading VGE_MIICFG register. For PCIe
  controllers(VT613x), we assume the PHY address is 1.
  Use the saved PHY address in MII register access routines and
  remove accessing VGE_MIICFG register.
  While I'm here save PCI express capability register which will be
  used in near future.

r200541:
  Add MSI support for VT613x controllers.

r200543:
  Increase output queue size from 64 to 255.

r200545:
  We don't have to reload EEPROM in vge_reset(). Because vge_reset()
  is called in vge_init_lock(), vge(4) always used to reload EEPROM.
  Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit.
  While I'm here add missing new line in vge_reset().

r200548:
  Sort function prototyes.
2010-01-08 22:26:24 +00:00
Pyun YongHyeon
ef22705259 MFC r200526-200527,200529,200531-200533,200536
r200526:
  Use PCIR_BAR instead of hard-coded value.

r200527:
  Fix typo in register definition.

r200529:
  Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
  seems to work like a tag that indicates 'not list end' of queued
  frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So
  the last frame of multiple queued frames has no VGE_TXDESC_Q bit.
  The hardware has peculiar behavior for VGE_TXDESC_Q bit handling.
  If the VGE_TXDESC_Q bit of descriptor was set the controller would
  fetch next descriptor. However if next descriptor's OWN bit was
  cleared but VGE_TXDESC_Q was set, it could confuse controller.
  Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct
  behavior.

r200531:
  Use ANSI function definations.

r200532:
  Remove unnecessary return statement.

r200533:
  s/u_intXX_t/uintXX_t/g

r200536:
  style(9).
2010-01-08 22:08:18 +00:00
Brooks Davis
97a0b2e16c MFC r201352
If a filter has already been added, actually return EEXIST when trying
  at add it again.
2010-01-08 21:58:12 +00:00
Pyun YongHyeon
bce2400f8c MFC r200525:
Overhaul bus_dma(9) usage and fix various things.
   o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag.
   o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA
     tag has different restriction compared to TX DMA tag.
   o Add 40bit DMA address support.
   o Adjust TX/RX descriptor ring alignment to 64 bytes from 256
     bytes as documented in datasheet.
   o Added check to ensure TX/RX ring reside within a 4GB boundary.
     Since TX/RX ring shares the same high address register they
     should have the same high address.
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
   o Add lock assertion to vge_setmulti().
   o Add RX spare DMA map to recover from DMA map load failure.
   o Add optimized RX buffer handler, vge_discard_rxbuf which is
     activated when vge(4) sees bad frames.
   o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet
     says the register should be updated only when number of
     available RX descriptors are multiple of 4.
   o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which
     is only set for i386 architecture. Previously vge(4) also
     performed expensive copy operation to align IP header on amd64.
     This change should give RX performance boost on amd64
     architecture.
   o Don't reinitialize controller if driver is already running. This
     should reduce number of link state flipping.
   o Since vge(4) drops a driver lock before passing received frame
     to upper layer, make sure vge(4) is still running after
     re-acquiring driver lock.
   o Add second argument count to vge_rxeof(). The argument will
     limit number of packets could be processed in RX handler.
   o Rearrange vge_rxeof() not to allocate RX buffer if received
     frame was bad packet.
   o Removed if_printf that prints DMA map failure. This type of
     message shouldn't be used in fast path of driver.
   o Reduce number of allowed TX buffer fragments to 6 from 7. A TX
     descriptor allows 7 fragments of a frame. However the CMZ field
     of descriptor has just 3bits and the controller wants to see
     fragment + 1 in the field. So if we have 7 fragments the field
     value would be 0 which seems to cause unexpected results under
     certain conditions. This change should fix occasional TX hang
     observed on vge(4).
   o Simplify vge_stat_locked() and add number of available TX
     descriptor check.
   o vge(4) controllers lack padding short frames. Make sure to fill
     zero for the padded bytes. This closes unintended information
     disclosure.
   o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether
     this bit should be set by driver or write-back status bit after
     transmission. At least vendor's driver does not set this bit so
     remove it. Without this bit vge(4) still can send jumbo frames.
   o Don't start driver when vge(4) know there are not enough RX
     buffers.
   o Remove volatile keyword in RX descriptor structure. This should
     be handled by bus_dma(9).
   o Collapse two 16bits member of TX/RX descriptor into single 32bits
     member.
   o Reduce number of RX descriptors to 252 from 256. The
     VGE_RXDESCNUM is 16bits register but only lower 8bits are valid.
     So the maximum number of RX descriptors would be 255. However
     the number of should be multiple of 4 as controller wants to
     update 4 RX descriptors at a time. This limits the maximum
     number of RX descriptor to be 252.

PR:	kern/141276, kern/141414
2010-01-08 21:37:16 +00:00
Pyun YongHyeon
f2940816a8 MFC r200519-200522
r200519:
  Remove register keyword.

r200520:
  Prefer device_printf(9) to printf(9).

r200521:
  Fix spelling in comment.

r200522:
  Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9).
2010-01-08 21:25:52 +00:00
Pyun YongHyeon
6d2fb73028 MFC r198987,199414,199543,200422
Partial merge r198987:
  Use device_printf() and if_printf() instead of printf() with an explicit
  unit number and remove 'unit' members from softc.

Partial merge r199414:
  Use the bus_*() routines rather than bus_space_*() for register operations.

r199543:
  Several fixes to this driver:
  - Overhaul the locking to avoid recursion and add missing locking in a few
    places.
  - Don't schedule a task to call vge_start() from contexts that are safe to
    call vge_start() directly.  Just invoke the routine directly instead
    (this is what all of the other NIC drivers I am familiar with do).  Note
    that vge(4) does not use an interrupt filter handler which is the primary
    reason some other drivers use tasks.
  - Add a new private timer to drive the watchdog timer instead of using
    if_watchdog and if_timer.
  - Fixup detach by calling ether_ifdetach() before stopping the interface.

r200422:
  Remove driver lock assertion in MII register access. This change
  was made in r199543 to remove MTX_RECURSE. These routines can be
  called in device attach phase(e.g. mii_phy_probe()) so checking
  assertion here is not right as caller does not hold a driver lock.
2010-01-08 21:15:09 +00:00
Rick Macklem
d3db09cb06 MFC: r200999
Modify the experimental server so that it uses VOP_ACCESSX().
This is necessary in order to enable NFSv4 ACL support. The
argument to nfsvno_accchk() was changed to an accmode_t and
the function nfsrv_aclaccess() was no longer needed and,
therefore, deleted.

Reviewed by:	trasz
2010-01-08 20:25:59 +00:00
Jilles Tjoelker
e859c2af80 MFC r201355: sh(1): document ulimit -w (swapuse rlimit). 2010-01-08 14:33:03 +00:00
Jilles Tjoelker
716779e2ff MFC r201354: sh(1): Correct two places where "$@" lacked necessary quotes. 2010-01-08 14:30:03 +00:00
Gavin Atkinson
aab57f153b MFC r200994:
Set the locally-assigned bit in the randomly generated Ethernet address
  if we end up having to generate one.

PR:		kern/133239
Discussed with:	yongari
Approved by:	ed (mentor, implicit)
2010-01-08 10:13:27 +00:00
Alexander Leidinger
84e096effd MFC r197816:
---snip---
    Prevent paging pressure from draining arc too much
    - always drain arc if above arc_c_max - never drain arc if arc is below
      arc_c_max
---snip---
2010-01-08 09:59:13 +00:00
Antoine Brodin
f12d6d2a3f MFC r200129 to stable/8:
Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros.
2010-01-07 19:37:21 +00:00
Bjoern A. Zeeb
aecc4e1724 Bump __FreeBSD_version to 800500 which should have happened already
after r198460 but was missed.

Note: that 800108 should have been 800501 with that but as there is no
functional problem here, it'll just stay as is. [1]

This will make pkg_add -r use packages-8-stable for stable/8 rather
than packages-8.0-release.

Reported by:	Paride Legovini (pl ninthfloor.org) on stable@,
		(pluknet gmail.com), jhb
Discussed with:	rwatson [1]
2010-01-07 16:18:46 +00:00
Bruce M Simpson
d2f946c444 MFC r200871:
Use ALLOW_NEW_SOURCES and BLOCK_OLD_SOURCES to signal a join or leave
 with SSM MLDv2 by default.
 This is current practice and complies with RFC 4604, as well as being
 required by production IPv6 networks in Japan.
 The behaviour may be disabled by setting the net.inet6.mld.use_allow
 sysctl/tunable to 0.

Requested by:	Hideki Yamamoto, dikshie
2010-01-07 14:15:34 +00:00
Konstantin Belousov
e1c0f1246f MFC r201347:
Allow swap out of the kernel stack for the thread with priority greater
or equial then PSOCK, not less or equial.
2010-01-07 11:41:47 +00:00
Konstantin Belousov
c7d57a89e4 MFC r201504:
PG_NOSYNC is called VPO_NOSYNC for long time.
2010-01-07 11:33:57 +00:00
Pyun YongHyeon
02b41ac4df MFC r200088,200227-200228,200246,200264,201446
r200088:
  Add workaround to overcome hardware limitation which allows only a
  single outstanding DMA read operation. Most controllers targeted to
  client with PCIe bus interface(e.g. BCM5761) may have this
  limitation. All controllers for servers does not have this
  limitation.
  Collapsing mbuf chains to reduce number of memory reads before
  transmitting was most effective way to workaround this. I got about
  940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
  takes a lot of CPU cycles to collapse mbuf chains so add tunable to
  control the number of allowed TX buffers before collapsing. The
  default value is 0 which effectively disables the forced collapsing.
  For most cases 2 would yield best performance(about 930Mbps)
  without much sacrificing CPU cycles.
  Note the collapsing is only activated when the controller is on
  PCIe bus and the frame does not need TSO operation. TSO does not
  seem to suffer from the hardware limitation because the payload
  size is much bigger than normal IP datagram.
  Thanks to davidch@ who told me the limitation of client controllers
  and actually gave possible workarounds to mitigate the limitation.

r200227:
  Remove PHY isolate/power down code in bge_stop(). The isolation
  handler in brgphy(4) does not exist and brgphy(4) just resets the
  PHY and returns EINVAL as it has no isolation handler. I also agree
  on Marius's opinion that stop handler of every NIC driver seems to
  be the wrong place for implementing PHY isolate/power down.
  If we need PHY isolate/power down it should be implemented in
  brgphy(4) and users should administratively down the PHY.

r200228:
  Don't access jumbo frame related registers if controller lacks the
  feature. These registers are reserved on controllers that have no
  support for jumbo frame.
  Only BCM5700 has mini ring so do not poke mini ring related
  registers if controller is not BCM5700.

r200246:
  Partially revert r200228. For mini RCB case, bge(4) still have to
  disable mini ring withtout regard to mini ring support.

r200264:
  Create sysctl node(dev.bge.%d.focred_collapse) instead of
  hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4)
  controllers on system which may not desirable behavior of the
  sysctl node. Also allow the sysctl node could be modified at any
  time.

r201446:
  Fix regression introduced in r198318. BCM5754/BCM5754M uses the
  same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
  on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
  firmware to enable TSO and bge(4) does not support firmware based
  TSO.
2010-01-07 00:55:07 +00:00
Pyun YongHyeon
56ab4ace6f MFC r199670-199671,199674,199679,199761,199807-199808
r199670:
  Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
  have a DMA bug when buffer address crosses a multiple of the 4GB
  boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
  4GB address for these controllers. The second DMA bug limits DMA
  address to be within 40bit address space. This bug applies to
  BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
  actually a MAC controller bug but an issue with the embedded PCIe
  to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
  also limit the DMA address to be within 40bit address space.
  Special thanks to davidch@ who gave me detailed errata information.
  I think this change will fix long standing bge(4) instability
  issues on systems with more than 4GB memory.

r199671:
  Implement TSO for BCM5755 or newer controllers. Some controllers
  seem to require a special firmware to use TSO. But the firmware is
  not available to FreeBSD and Linux claims that the TSO performed by
  the firmware is slower than hardware based TSO. Moreover the
  firmware based TSO has one known bug which can't handle TSO if
  ethernet header + IP/TCP header is greater than 80 bytes. The
  workaround for the TSO bug exist but it seems it's too expensive
  than not using TSO at all. Some hardwares also have the TSO bug so
  limit the TSO to the controllers that are not affected TSO issues
  (e.g. 5755 or higher).
  While I'm here set VLAN tag bit to all descriptors that belengs to
  a frame instead of the first descriptor of a frame. The datasheet
  is not clear how to handle VLAN tag bit but it worked either way in
  my testing. This makes it simplify TSO configuration a little bit.

  Big thanks to davidch@ who sent me detailed TSO information.
  Without this I was not able to implement it.

r199674:
  Add missing function prototype in r199671.

r199679:
  Reduce status block size DMAed by controller. bge(4) uses single
  Tx/Rx/Rx return ring such that large part of status block was not
  used at all. All bge(4) controllers except BCM5700 AX/BX has a
  feature to control the size of status block. So use minimum status
  block size allowed in controller. This reduces number of DMAed
  status block size to 32 bytes from 80 bytes.

r199761:
  BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

r199807:
  Make sure one shot MSI is enabled.

r199808:
  Fix typo which inversed the logic which in turn disabled MSI.
2010-01-07 00:44:54 +00:00
Pyun YongHyeon
eefce03276 MFC r199667-199668
r199667:
  Cache Rx producer/Tx consumer index as soon as we know status block
  update and then clear status block. Previously it used to access
  these index without synchronization which may cause problems when
  bounce buffers are used. Also add missing bus_dmamap_sync(9) in
  polling handler. Since we now update status block in driver, adjust
  bus_dmamap_sync(9) for status block.

r199668:
  For MSI case, interrupt is not shared and we don't need to force
  PCI flush to get correct status block update. Add an optimized
  interrupt handler that is activated for MSI case. Actual interrupt
  handling is done by taskqueue such that the handler does not
  require driver lock for Rx path. The MSI capable bge(4) controllers
  automatically disables further interrupt once it enters interrupt
  state so we don't need PIO access to disable interrupt in interrupt
  handler.
2010-01-06 23:42:15 +00:00
Pyun YongHyeon
1377b76a28 MFC 199663-199666
r199663:
  Due to newly added PCIe capabilities fallback code for finding the
  PCIe capability did not work right on recent controllers. Remove
  FreeBSD 6.x support code.

r199664:
  Use capability pointer to access PCIe registers rather than
  directly access them at fixed address. While I'm here don't touch
  other bits of PCIe device control register except max payload size.

r199665:
  Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

r199666:
  Rearrange bge_start_locked to see we can send more frames by
  checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
  have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
  later. Previously bge(4) used to reserve 16 free send BDs after
  loading dma maps but hardware just need one reserved send BD. If
  prouder index has the same value of consumer index it means the Tx
  queue is empty.
  While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
  operation.
2010-01-06 23:34:53 +00:00
Pyun YongHyeon
ed797ec921 MFC r199065,199115-199116,199153,199661-199662
r199065:
  Correct disabling checksum offloading for BCM5700 B0.

r199115:
  Add missing bus_dmamap_sync(9) before issuing kick command.

r199116:
  Zero out Tx/Rx descriptors before using them. Also add missing
  bus_dmamap_sync(9) after Tx descriptor initialization.

r199153:
  Controller does not update Tx descriptors(send BDs) after sending
  frames so remove unnecessary BUS_DMASYNC_PREREAD and
  BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

r199661:
  Remove extra white space.

r199662:
  Fix typo introduced in r199011.
2010-01-06 23:26:09 +00:00
Pyun YongHyeon
1a03353586 MFC r198967,199009-199011,199014,199020,199035-199036,199054
r198967:
  Correct MSI mode register bits.

r199009:
  bge(4) already switched to use UMA backed page allocator and local
  memory allocator for jumbo frame was removed long time ago. Remove
  no more used macros.

r199010:
  Do bus_dmamap_sync call only if frame size is greater than
  standard buffer size. If controller is not capable of handling
  jumbo frame, interface MTU couldn't be larger than standard MTU
  which in turn the received should be fit in standard buffer. This
  fixes bus_dmamap_sync call for jumbo ring is called even if
  interface is configured to use standard MTU.
  Also if total frame size could be fit into standard buffer don't
  use jumbo buffers.

r199011:
  Reimplement Rx buffer allocation to handle dma map load failure.
  Introduce two spare dma maps for standard buffer and jumbo buffer
  respectively. If loading a dma map failed reuse previously loaded
  dma map. This should fix unloaded dma map is used in case of dma
  map load failure. Also don't blindly unload dma map and defer
  dma map sync and unloading operation until we know dma map for new
  buffer is successfully loaded. This change saves unnecessary dma
  load/unload operation. Previously bge(4) tried to reuse mbuf
  with unloaded dma map which is really bad thing in bus_dma(9)
  perspective.
  While I'm here update if_iqdrops if we can't allocate Rx buffers.

r199014:
  Fix I mssied in r199011. Rx ring index also should be updated.
  If we fill Rx ring full instead of half we can simplify this logic
  but this requires more experimentation.

r199020:
  Tell upper layer we support long frames. ether_ifattach()
  initializes it to ETHER_HDR_LEN so we have to override it after
  calling ether_ifattch().
  While I'm here remove setting if_mtu value, it's initialized in
  ether_ifattach().

r199035:
  Don't count input errors twice, we always read input errors from
  MAC in bge_tick. Previously it used to show more number of input
  errors. I noticed actual input errors were less than 8% even for
  64 bytes UDP frames generated by netperf.
  Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
  bge_tick, remove useless code protected by #ifdef notyet.

r199036:
  Count number of inbound packets which were chosen to be discarded
  as input errors. Also count out of receive BDs as input errors.

r199054:
  Partially revert r199035.
  Revision 1.158 says only lower ten bits of
  BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
  seems the controller maintains 16bits value for the register.
  However 16bits are still too small to count all dropped packets
  happened in a second. To get a correct counter we have to read the
  register in bge_rxeof() which would be too expensive.
2010-01-06 23:02:35 +00:00
Pyun YongHyeon
2c8f00d0c7 MFC r198923-198924,198927-198928
r198923:
  Use correct dma tag for jumbo buffer.

r198924:
  Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note,
  bge_newbuf_std still has a bug for handling dma map load failure
  under high network load. Just reusing mbuf is not enough as driver
  already unloaded the dma map of the mbuf. Graceful recovery needs
  more work.
  Ideally we can just update dma address part of a Rx descriptor
  because the controller never overwrite the Rx descriptor. This
  requires some Rx initialization code changes and it would be done
  later after fixing other incorrect bus_dma(9) usages.

r198927:
  Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag
  and Rx DMA tag separately. Previously it used a common mbuf DMA tag
  for both Tx and Rx path but Rx buffer(standard ring case) should
  have a single DMA segment and maximum buffer size of the segment
  should be less than or equal to MCLBYTES. This change also make it
  possible to add TSO with minor changes.

r198928:
  Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code
  for buffer allocation. If driver know we are out of Rx buffers let
  controller stop. This should fix panic when interface is run even
  if it had no configured Rx buffers.
2010-01-06 22:45:49 +00:00
Simon L. B. Nielsen
d14e59b97c Fix BIND named(8) cache poisoning with DNSSEC validation.
[SA-10:01]

Fix ntpd mode 7 denial of service. [SA-10:02]

Fix ZFS ZIL playback with insecure permissions. [SA-10:03]

Various FreeBSD 8.0-RELEASE improvements. [EN-10:01]

Security:	FreeBSD-SA-10:01.bind
Security:	FreeBSD-SA-10:02.ntpd
Security:	FreeBSD-SA-10:03.zfs
Errata:		FreeBSD-EN-10:01.freebsd
Approved by:	so (simon)
2010-01-06 21:45:30 +00:00