diff options
author | Luigi Rizzo <luigi@FreeBSD.org> | 2001-12-11 02:47:53 +0000 |
---|---|---|
committer | Luigi Rizzo <luigi@FreeBSD.org> | 2001-12-11 02:47:53 +0000 |
commit | 2dfc960a5bf0de06f99cd5aad020716c3773dae6 (patch) | |
tree | 23cc761de87f4050d3a67dcbeb7107879c75feb2 /sys/dev | |
parent | eaef715000c044a431d4799e806de0a0d4634e68 (diff) | |
download | src-2dfc960a5bf0de06f99cd5aad020716c3773dae6.tar.gz src-2dfc960a5bf0de06f99cd5aad020716c3773dae6.zip |
Avoid an unnecessary copy of a packet if it is already in a single mbuf.
Introduce an additional device flag for those NICs which require the
transmit buffers to be aligned to 32-bit boundaries.
(the equivalen fix for STABLE is slightly simpler because there are
no supported chips which require this alignment there.)
Notes
Notes:
svn path=/head/; revision=87638
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/dc/if_dc.c | 8 | ||||
-rw-r--r-- | sys/dev/dc/if_dcreg.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 7a0c54dc2a70..139983bb089a 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1942,10 +1942,12 @@ static int dc_attach(dev) break; case DC_DEVICEID_X3201: sc->dc_type = DC_TYPE_XIRCOM; - sc->dc_flags |= DC_TX_INTR_ALWAYS | DC_TX_COALESCE; + sc->dc_flags |= DC_TX_INTR_ALWAYS | DC_TX_COALESCE | + DC_TX_ALIGN ; /* * We don't actually need to coalesce, but we're doing * it to obtain a double word aligned buffer. + * The DC_TX_COALESCE flag is required. */ break; case DC_DEVICEID_RS7112: @@ -2996,7 +2998,9 @@ static void dc_start(ifp) if (m_head == NULL) break; - if (sc->dc_flags & DC_TX_COALESCE) { + if (sc->dc_flags & DC_TX_COALESCE && + (m_head->m_next != NULL || + sc->dc_flags & DC_TX_ALIGN) ) { if (dc_coal(sc, &m_head)) { IF_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; diff --git a/sys/dev/dc/if_dcreg.h b/sys/dev/dc/if_dcreg.h index 9336728f2756..0052d33d9220 100644 --- a/sys/dev/dc/if_dcreg.h +++ b/sys/dev/dc/if_dcreg.h @@ -739,6 +739,7 @@ struct dc_softc { #define DC_64BIT_HASH 0x00002000 #define DC_TULIP_LEDS 0x00004000 #define DC_TX_ONE 0x00008000 +#define DC_TX_ALIGN 0x00010000 /* align mbuf on tx */ /* * register space access macros |