svn commit: r199010 - head/sys/dev/bge

[ Available lists | Index of svn-src-all | Month of Nov 2009 | Week of 6 Nov 2009 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Pyun YongHyeon <yongari@FreeBSD.org>
Date
6 Nov 2009 23:49:20
Subject
svn commit: r199010 - head/sys/dev/bge
Message-ID
200911062349.nA6NnKMM032015@svn.freebsd.org


[ Hide this part ]
Author: yongari
Date: Fri Nov 6 23:49:20 2009
New Revision: 199010
URL: http://svn.freebsd.org/changeset/base/199010

Log:
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.

Modified:
head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c Fri Nov 6 22:37:29 2009 (r199009)
+++ head/sys/dev/bge/if_bge.c Fri Nov 6 23:49:20 2009 (r199010)
@@ -3134,7 +3134,8 @@ bge_rxeof(struct bge_softc *sc)
sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD);
bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE);
- if (BGE_IS_JUMBO_CAPABLE(sc))
+ if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN >
+ (MCLBYTES - ETHER_ALIGN))
bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag,
sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE);

@@ -3266,7 +3267,7 @@ bge_rxeof(struct bge_softc *sc)
bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE);

- if (BGE_IS_JUMBO_CAPABLE(sc) && jumbocnt > 0)
+ if (jumbocnt > 0)
bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag,
sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE);

@@ -3920,7 +3921,8 @@ bge_init_locked(struct bge_softc *sc)
}

/* Init jumbo RX ring. */
- if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) {
+ if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN >
+ (MCLBYTES - ETHER_ALIGN)) {
if (bge_init_rx_ring_jumbo(sc) != 0) {
device_printf(sc->bge_dev, "no memory for std Rx buffers.\n");
bge_stop(sc);


Elapsed time: 0.066 seconds