Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 1999 07:56:57 -0700 (PDT)
From:      Bill Paul <wpaul@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/pci if_ti.c
Message-ID:  <199905241456.HAA56050@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
wpaul       1999/05/24 07:56:57 PDT

  Modified files:
    sys/pci              if_ti.c 
  Log:
  Fix bug that can cause transmit corruption. There are actually two 'rings'
  in the transmit code: the TX descriptor ring, and a 'shadow' ring of mbuf
  pointers, one for each TX descriptor. When transmitting a packet that
  consists of several fragments in an mbuf chain, we link each fragment
  to a descriptor in the TX ring, but we only save a pointer to the mbuf
  chain. This pointer is saved in the shadow ring entry which corresponds
  to the first fragment in the packet. Later, ti_txeof() can release the
  whole chain with a single m_freem() call. (We need the second ring to
  keep track of the virtual addresses of the mbuf chains.)
  
  The problem with this is that the Tigon isn't actually through with the
  mbuf chain until it reaches the last fragment (which has the TI_BDFLAG_END
  bit set), however the current scheme releases the mbuf chain as soon as
  the first fragment is consumed. This is wrong, since the mbufs can then
  be yanked out from under the Tigon and modified before the other fragments
  can be transmitted.
  
  The fix is to make a one line change to ti_encap() so that it saves the
  mbuf chain pointer in the shadow ring entry that corresponds to the last
  fragment in TX ring instead of the first. This prevents the mbufs from
  being released until the last fragment is transmitted.
  
  Painstakingly diagnosed and fixed by: Robert Picco <picco@mail.wevinc.com>
  Brought to my attention by: dg
  
  Revision  Changes    Path
  1.6       +3 -3      src/sys/pci/if_ti.c


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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