Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Don't call m_aux_find() in the inner loop when c...



details:   https://anonhg.NetBSD.org/src/rev/caeca73c8e42
branches:  trunk
changeset: 533344:caeca73c8e42
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jun 27 23:21:34 2002 +0000

description:
Don't call m_aux_find() in the inner loop when creating the Tx
descriptor list.  Instead, call it once and remember the result,
and only call it looking for VLAN tags if VLANs are configured
on the interface.

diffstat:

 sys/dev/pci/if_bge.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 686c04549054 -r caeca73c8e42 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Thu Jun 27 23:14:40 2002 +0000
+++ b/sys/dev/pci/if_bge.c      Thu Jun 27 23:21:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.5 2002/06/27 22:31:30 thorpej Exp $       */
+/*     $NetBSD: if_bge.c,v 1.6 2002/06/27 23:21:34 thorpej Exp $       */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -2349,6 +2349,9 @@
            BUS_DMA_NOWAIT))
                return(ENOBUFS);
 
+       n = sc->ethercom.ec_nvlans ?
+           m_aux_find(m_head, AF_LINK, ETHERTYPE_VLAN) : NULL;
+
        for (i = 0; i < dmamap->dm_nsegs; i++) {
                f = &sc->bge_rdata->bge_tx_ring[frag];
                if (sc->bge_cdata.bge_tx_chain[frag] != NULL)
@@ -2357,7 +2360,6 @@
                f->bge_len = dmamap->dm_segs[i].ds_len;
                f->bge_flags = csum_flags;
 
-               n = m_aux_find(m_head, AF_LINK, ETHERTYPE_VLAN);
                if (n != NULL) {
                        f->bge_flags |= BGE_TXBDFLAG_VLAN_TAG;
                        f->bge_vlan_tag = *mtod(n, int *);



Home | Main Index | Thread Index | Old Index