cvs commit: src/sys/dev/re if_re.c src/sys/pci if_rlreg.h

Marius Strobl marius at
Tue Jan 30 14:16:25 UTC 2007

marius      2007-01-30 14:16:24 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_6)
    sys/dev/re           if_re.c 
    sys/pci              if_rlreg.h 
  MFC: if_re.c 1.82, if_rlreg.h 1.64
  o In re_newbuf() and re_encap() if re_dma_map_desc() aborts the mapping
    operation as it ran out of free descriptors or if there are too many
    segments in the first place, call bus_dmamap_unload() in order to
    unload the already loaded segments.
    For trying to map the defragmented mbuf (chain) in re_encap() this
    introduces re_dma_map_desc() setting arg.rl_maxsegs to 0 as a new
    failure mode. Previously we just ignored this case, corrupting our
    view of the TX ring.
  o In re_txeof():
    - Don't clear IFF_DRV_OACTIVE unless there are at least 4 free TX
      descriptors. Further down the road re_encap() will bail if there
      aren't at least 4 free TX descriptors, causing re_start() to
      abort and prepend the dequeued mbuf again so it makes no sense
      to pretend we could process mbufs again when in fact we won't.
      While at it replace this magic 4 with a macro RL_TX_DESC_THLD
      throughout this driver.
    - Don't cancel the watchdog timeout as soon as there's at least one
      free TX descriptor but instead only if all descriptors have been
      handled. It's perfectly normal, especially in the DEVICE_POLLING
      case, that re_txeof() is called when only a part of the enqueued
      TX descriptors have been handled, causing the watchdog to be
      disarmed prematurely.
  o In re_encap():
    - If m_defrag() fails just drop the packet like other NIC drivers
      do. This should only happen when there's a mbuf shortage, in which
      case it was possible to end up with an IFQ full of packets which
      couldn't be processed as they couldn't be defragmented as they
      were taking up all the mbufs themselves. This includes adjusting
      re_start() to not trying to prepend the mbuf (chain) if re_encap()
      has freed it.
    - Remove dupe initialization of members of struct rl_dmaload_arg to
      values that didn't change since trying to process the fragmented
      mbuf chain.
      While at it remove an unused member from struct rl_dmaload_arg.
  o In re_start() remove a abandoned, banal comment. The corresponding
    code was moved to re_attach() some time ago.
  Revision   Changes    Path  +43 -47    src/sys/dev/re/if_re.c   +1 -1      src/sys/pci/if_rlreg.h

More information about the cvs-src mailing list