<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/dev/vge, branch stable/7</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=stable%2F7</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=stable%2F7'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2012-01-05T00:01:49Z</updated>
<entry>
<title>MFC r227828,227835,227837:</title>
<updated>2012-01-05T00:01:49Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2012-01-05T00:01:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=ef767bf7e09501aec1253592641c44e27a7ed64a'/>
<id>urn:sha1:ef767bf7e09501aec1253592641c44e27a7ed64a</id>
<content type='text'>
r227828:
  Always start MII auto polling before accessing any MII registers.

r227835:
  Rework link establishment and link state detection logic.
   - Remove MIIBUS statchg callback and program VGE_DIAGCTL before
     initiating link establishment.  Previously driver used to
     program VGE_DIAGCTL after getting a link in statchg callback.
     It seems the VGE_DIAGCTL register works like a kind of MII
     register such that it requires setting a 'to be' mode in advance
     rather than relying on resolved speed/duplex of established link.
     This means the statchg callback is not needed in driver.  In
     addition, if there was no link at the time of media change, this
     was not called at all.
   - Introduce vge_ifmedia_upd_locked() to change current media to
     configured one.  Actual media change is performed only after PHY
     reset and VGE_DIAGCTL setup.
   - In WOL configuration, make sure to clear forced mode such that
     controller can rely on auto-negotiation.
   - Unlike most other drivers that use miibus(4), vge(4) used
     controller's auto-polling feature for link state tracking via
     interrupt.  This came from controller's inefficient mechanism to
     access MII registers.  On link state change interrupt, vge(4)
     used to get current link state with series of MII register
     accesses.  Because vge(4) already enabled auto polling, read PHY
     status register to resolved speed/duplex/flow control parameters.

  vge(4) still does not drive MII_TICK to reduce number of MII
  register accesses which in turn means the driver does not know the
  status of auto-negotiation.  This was a one of long standing
  issue of vge(4).  Probably driver may be able to implement a timer
  that keeps track of auto-negotiation state and restart
  auto-negotiation when driver couldn't establish a link within a
  specified period.  However the controller does not provide a
  reliable way to detect auto-negotiation failure so I'm not sure
  whether it's worth to implement it in driver.

  Alternatively driver can completely disable MII auto-polling and
  let miibus(4) poll link state by driving MII_TICK.  This may reduce
  unnecessary overhead of stopping/restarting MII auto-polling of
  controller.  Unfortunately it was known that some variants of
  controller does not work correctly if MII auto-polling is disabled.

r227837:
  Announce flow control capability to underlying PHY driver.
  Pause timer value is initialized to 0xFFFF. Controller allows just
  4 different TX pause thresholds. The lowest possible threshold
  value looks too aggressive so use next available threshold value.
</content>
</entry>
<entry>
<title>MFC r226478:</title>
<updated>2011-12-31T01:10:29Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2011-12-31T01:10:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=b1edb1d47a06cc90022e55051658ccde362a10d8'/>
<id>urn:sha1:b1edb1d47a06cc90022e55051658ccde362a10d8</id>
<content type='text'>
  Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
  Because driver is accessing a common MII structure in
  mii_pollstat(), updating user supplied structure should be done
  before dropping a driver lock.

  Reported by:	Karim (fodillemlinkarimi &lt;&gt; gmail dot com)
</content>
</entry>
<entry>
<title>MFC r225440:</title>
<updated>2011-09-15T17:22:38Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2011-09-15T17:22:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=653cabf5e4664c077a6375045f2416d948f32f6a'/>
<id>urn:sha1:653cabf5e4664c077a6375045f2416d948f32f6a</id>
<content type='text'>
  vge(4) hardwares poll media status and generates an interrupt
  whenever the link state is changed.  Using software based polling
  for media status tracking is known to cause MII access failure
  under certain conditions once link is established so vge(4) used to
  rely on link status change interrupt.
  However DEVICE_POLLING completely disables generation of all kind
  of interrupts on vge(4) such that this resulted in not detecting
  link state change event.  This means vge(4) does not correctly
  detect established/lost link with DEVICE_POLLING.  Losing the
  interrupt made vge(4) not to send any packets to peer since vge(4)
  does not try to send any packets when there is no established link.

  Work around the issue by generating link state change interrupt
  with DEVICE_POLLING.

  PR:		kern/160442
</content>
</entry>
<entry>
<title>MFC r222142:</title>
<updated>2011-05-27T18:40:31Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2011-05-27T18:40:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=806c1c491be5db3a267510ab09d41c2b4f538f58'/>
<id>urn:sha1:806c1c491be5db3a267510ab09d41c2b4f538f58</id>
<content type='text'>
  Datasheet says vge(4) controllers support DAC but it seems that's
  not true on old PCI based controllers.  DAC configuration is read
  from EEPROM in device reset phase and driver can override DAC
  configuration.  However I guess there is an undocumented reason why
  EEPROM configuration does not enable DAC so do not blindly override
  DAC configuration.  Recent PCIe based controllers are supposed to
  support 64bit DMA so allow 64bit DMA only on PCIe based controllers.

  PR:	kern/157184
</content>
</entry>
<entry>
<title>MFC: r213893, r213908, r214566, r214605, r214846</title>
<updated>2010-11-07T11:12:30Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2010-11-07T11:12:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=4aec3028843cf6e3074fa61de9a91bd59471724a'/>
<id>urn:sha1:4aec3028843cf6e3074fa61de9a91bd59471724a</id>
<content type='text'>
Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) 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
</content>
</entry>
<entry>
<title>MFC r200696,200740,200756,200758-200759,200972</title>
<updated>2010-01-09T00:29:04Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2010-01-09T00:29:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=09b95924d213220d7968a86b4714eef373dc8611'/>
<id>urn:sha1:09b95924d213220d7968a86b4714eef373dc8611</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>MFC r200638:</title>
<updated>2010-01-09T00:20:33Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2010-01-09T00:20:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=34da75d79b76c7ae537d4f445b31b3307cb01901'/>
<id>urn:sha1:34da75d79b76c7ae537d4f445b31b3307cb01901</id>
<content type='text'>
  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.
</content>
</entry>
<entry>
<title>MFC r200616-200617,200635,200639,200644</title>
<updated>2010-01-09T00:14:50Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2010-01-09T00:14:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=46b893a63383d00dc35cb636c0b346cbdfacc323'/>
<id>urn:sha1:46b893a63383d00dc35cb636c0b346cbdfacc323</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>MFC 200615:</title>
<updated>2010-01-09T00:08:15Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2010-01-09T00:08:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=27785c7520accc321d14616e0c10446a778595d3'/>
<id>urn:sha1:27785c7520accc321d14616e0c10446a778595d3</id>
<content type='text'>
  Add hardware MAC statistics support. This statistics could be
  extracted from dev.vge.%d.stats sysctl node.
</content>
</entry>
<entry>
<title>MFC r200551-200552,200555,200558,200609,200613</title>
<updated>2010-01-09T00:05:02Z</updated>
<author>
<name>Pyun YongHyeon</name>
<email>yongari@FreeBSD.org</email>
</author>
<published>2010-01-09T00:05:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=3a6096d63978997f8937ca37baf333126ebaef8c'/>
<id>urn:sha1:3a6096d63978997f8937ca37baf333126ebaef8c</id>
<content type='text'>
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().
</content>
</entry>
</feed>
