summaryrefslogtreecommitdiffstats
path: root/sys/dev/em
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2006-08-14 00:36:53 +0000
committeryongari <yongari@FreeBSD.org>2006-08-14 00:36:53 +0000
commit78a915dfb7092a6ecf5af7f964f1d652d4879f6f (patch)
tree9720a143be6473e662051ef835382f7a4dd3c816 /sys/dev/em
parentff74569fb442f8ab132b3a0571f8acdabf709690 (diff)
downloadFreeBSD-src-78a915dfb7092a6ecf5af7f964f1d652d4879f6f.zip
FreeBSD-src-78a915dfb7092a6ecf5af7f964f1d652d4879f6f.tar.gz
Apply alignment fixup only when programmed frame size is greater than
MCLBYTES - ETHER_ALIGN. Previously it applied the alignment fixup code for oversized frames which would result in reduced performance on strict alignment archs.
Diffstat (limited to 'sys/dev/em')
-rw-r--r--sys/dev/em/if_em.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index a5c7567..df48f8b 100644
--- a/sys/dev/em/if_em.c
+++ b/sys/dev/em/if_em.c
@@ -2805,7 +2805,6 @@ em_txeof(struct adapter *adapter)
static int
em_get_buf(int i, struct adapter *adapter, struct mbuf *mp)
{
- struct ifnet *ifp = adapter->ifp;
bus_dma_segment_t segs[1];
struct em_buffer *rx_buffer;
int error, nsegs;
@@ -2823,7 +2822,7 @@ em_get_buf(int i, struct adapter *adapter, struct mbuf *mp)
mp->m_next = NULL;
}
- if (ifp->if_mtu <= ETHERMTU)
+ if (adapter->hw.max_frame_size <= (MCLBYTES - ETHER_ALIGN))
m_adj(mp, ETHER_ALIGN);
rx_buffer = &adapter->rx_buffer_area[i];
@@ -3187,7 +3186,8 @@ em_rxeof(struct adapter *adapter, int count)
em_receive_checksum(adapter, current_desc,
adapter->fmp);
#ifndef __NO_STRICT_ALIGNMENT
- if (ifp->if_mtu > ETHERMTU &&
+ if (adapter->hw.max_frame_size >
+ (MCLBYTES - ETHER_ALIGN) &&
em_fixup_rx(adapter) != 0)
goto skip;
#endif
OpenPOWER on IntegriCloud