Date: Wed, 6 Jan 2010 23:15:07 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/dev/bge if_bge.c if_bgereg.h Message-ID: <201001062315.o06NFLIv050129@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
yongari 2010-01-06 23:15:07 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/dev/bge if_bge.c if_bgereg.h Log: SVN rev 201691 on 2010-01-06 23:15:07Z by yongari MFC r198967,199009-199011,199014,199020,199035-199036,199054 r198967: Correct MSI mode register bits. r199009: bge(4) already switched to use UMA backed page allocator and local memory allocator for jumbo frame was removed long time ago. Remove no more used macros. r199010: Do bus_dmamap_sync call only if frame size is greater than standard buffer size. If controller is not capable of handling jumbo frame, interface MTU couldn't be larger than standard MTU which in turn the received should be fit in standard buffer. This fixes bus_dmamap_sync call for jumbo ring is called even if interface is configured to use standard MTU. Also if total frame size could be fit into standard buffer don't use jumbo buffers. r199011: Reimplement Rx buffer allocation to handle dma map load failure. Introduce two spare dma maps for standard buffer and jumbo buffer respectively. If loading a dma map failed reuse previously loaded dma map. This should fix unloaded dma map is used in case of dma map load failure. Also don't blindly unload dma map and defer dma map sync and unloading operation until we know dma map for new buffer is successfully loaded. This change saves unnecessary dma load/unload operation. Previously bge(4) tried to reuse mbuf with unloaded dma map which is really bad thing in bus_dma(9) perspective. While I'm here update if_iqdrops if we can't allocate Rx buffers. r199014: Fix I mssied in r199011. Rx ring index also should be updated. If we fill Rx ring full instead of half we can simplify this logic but this requires more experimentation. r199020: Tell upper layer we support long frames. ether_ifattach() initializes it to ETHER_HDR_LEN so we have to override it after calling ether_ifattch(). While I'm here remove setting if_mtu value, it's initialized in ether_ifattach(). r199035: Don't count input errors twice, we always read input errors from MAC in bge_tick. Previously it used to show more number of input errors. I noticed actual input errors were less than 8% even for 64 bytes UDP frames generated by netperf. Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in bge_tick, remove useless code protected by #ifdef notyet. r199036: Count number of inbound packets which were chosen to be discarded as input errors. Also count out of receive BDs as input errors. r199054: Partially revert r199035. Revision 1.158 says only lower ten bits of BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it seems the controller maintains 16bits value for the register. However 16bits are still too small to count all dropped packets happened in a second. To get a correct counter we have to read the register in bge_rxeof() which would be too expensive. Revision Changes Path 1.198.2.23 +102 -86 src/sys/dev/bge/if_bge.c 1.73.2.10 +4 -12 src/sys/dev/bge/if_bgereg.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001062315.o06NFLIv050129>