diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-08-22 15:51:19 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-08-22 15:51:19 +0000 |
commit | 3cb9a67a84ad9bdbc5e000382d2ec12b351a5ad9 (patch) | |
tree | f61f91e4dc477228a5cbc8cbfd97fb510e271fae /sys/dev | |
parent | 68118a4a0ead22ed019c893ce400c0a8d6d78a05 (diff) |
- Re-add the m_adj() back into em_get_buf(), but this time check
the HW max frame size and only call m_adj() if the size is less
than or equal to MCLBYTES - ETHER_ALIGN (2046).
- Set the HW long packet enable bit on all adapters, even 82573
based adapters which are capable of Jumbo's.
- Only do RX alignment fixup on adapters capable of Jumbo frames.
ok jason@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_em.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index b3a87976ec2..de11d01a114 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.145 2006/08/14 17:23:32 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.146 2006/08/22 15:51:18 brad Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2121,6 +2121,9 @@ em_get_buf(int i, struct em_softc *sc, struct mbuf *nmp) mp->m_next = NULL; } + if (sc->hw.max_frame_size <= (MCLBYTES - ETHER_ALIGN)) + m_adj(mp, ETHER_ALIGN); + rx_buffer = &sc->rx_buffer_area[i]; /* @@ -2291,7 +2294,7 @@ em_initialize_receive_unit(struct em_softc *sc) break; } - if (sc->hw.mac_type != em_82573) + if (sc->hw.max_frame_size != ETHER_MAX_LEN) reg_rctl |= E1000_RCTL_LPE; /* Enable 82543 Receive Checksum Offload for TCP and UDP */ @@ -2458,7 +2461,8 @@ em_rxeof(struct em_softc *sc, int count) em_receive_checksum(sc, current_desc, sc->fmp); #ifdef __STRICT_ALIGNMENT - em_fixup_rx(sc); + if (sc->hw.max_frame_size > (MCLBYTES - ETHER_ALIGN)) + em_fixup_rx(sc); #endif m = sc->fmp; sc->fmp = NULL; |