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.)
This commit is contained in:
luigi 2001-12-11 02:47:53 +00:00
parent df33bd2279
commit d9e046f772
4 changed files with 14 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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