Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 20:35:23 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/pci if_rlreg.h src/sys/dev/re if_re.c
Message-ID:  <200701162035.l0GKZOON015991@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
marius      2007-01-16 20:35:23 UTC

  FreeBSD src repository

  Modified files:
    sys/pci              if_rlreg.h 
    sys/dev/re           if_re.c 
  Log:
  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.
  
  With these changes re(4) now survives one day (until stopped) of
  hammering out packets here.
  
  Reviewed by:    yongari
  MFC after:      2 weeks
  
  Revision  Changes    Path
  1.82      +43 -47    src/sys/dev/re/if_re.c
  1.64      +1 -1      src/sys/pci/if_rlreg.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701162035.l0GKZOON015991>