Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 2008 02:36:08 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/pci if_rl.c if_rlreg.h
Message-ID:  <200810251818.m9PII2RD001472@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
yongari     2008-10-25 02:36:08 UTC

  FreeBSD src repository

  Modified files:
    sys/pci              if_rl.c if_rlreg.h 
  Log:
  SVN rev 184240 on 2008-10-25 02:36:08Z by yongari
  
  Various bus_dma(9) fixes.
   - The hardware does not support DAC so limit DMA address space to
     4GB.
   - Removed BUS_DMA_ALLOC_NOW flag.
   - Created separated Tx buffer and Rx buffer DMA tags. Previously
     it used to single DMA tag and it was not possible to specify
     different DMA restrictions.
   - Apply 4 bytes alignment limitation of Tx buffer.
   - Apply 8 bytes alignment limitation of Rx buffer.
   - Tx side bus_dmamap_load_mbuf_sg(9) support.
   - Preallocate Tx DMA maps as creating DMA maps take very long time
     on architectures that require real DMA maps.
   - Adjust guard buffer size to 1522 + 8 as it should include VLAN
     and additional reserved bytes in Rx buffer.
   - Plug memory leak in device detach. Previously wrong buffer
     address was used to free allocated memory.
   - Added rl_list_rx_init() to clear Rx buffer and cleared the
     buffer.
   - Don't destroy DMA maps in rl_txeof() as the DMA map should be
     reused. There is no reason to destroy/recreate the DMA maps in
     this driver.
   - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks.
   - The hardware does not support descriptor based DMA on Tx side
     and the Tx buffer address should be aligned on 4 bytes boundary
     as well as manual padding for short frames. Because of this
     hardware limitation rl(4) always used to invoke m_defrag(9) to
     get a 4 bytes aligned single buffer. However m_defrag(9) takes
     a lot of CPU cycles on slow machines and not all packets need
     the help of m_defrag(9). Armed with the information, don't
     invoke m_defrag(9) if the following conditions are true.
        1. Buffer is not fragmented.
        2. Buffer is aligned on 4 bytes boundary.
        3. Manual padding is not necessary.
        4. Or padding is necessary but upper stack passed a writable
           buffer and the space needed for padding is satisfied.
     This change combined with preallocated DMA maps greatly
     increased Tx performance of driver on sparc64.
   - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and
     corrected memory synchronization operation specifier of
     bus_dmamap_sync(9).
   - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to
     reload/unload Rx buffer as rl(4) always have to copy from the
     buffer. It just needs proper bus_dmamap_sync(9) calls before
     copying the received frame.
  
  With this change rl(4) should work on systems with more than 4GB
  memory.
  
  PR:     kern/128143
  
  Revision  Changes    Path
  1.176     +247 -118  src/sys/pci/if_rl.c
  1.82      +9 -2      src/sys/pci/if_rlreg.h



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