From 8eb2877b11a090c6e7ab1457d248be6f3f7bf0a3 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sun, 10 Aug 2008 18:43:55 +0000 Subject: [PATCH] - no need to set the TXCMD_TXINT bit against the last enqueued TX packet because TX_EMPTY interrupt is enough to serve it on TX completion - start TX right after each TX packet has been prepared A quick ttcp(1) test shows ~5% improvements. --- sys/arch/sgimips/mace/if_mec.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/arch/sgimips/mace/if_mec.c b/sys/arch/sgimips/mace/if_mec.c index fe9140054c9d..2c5792a0e5c4 100644 --- a/sys/arch/sgimips/mace/if_mec.c +++ b/sys/arch/sgimips/mace/if_mec.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mec.c,v 1.24 2008/08/10 16:21:28 tsutsui Exp $ */ +/* $NetBSD: if_mec.c,v 1.25 2008/08/10 18:43:55 tsutsui Exp $ */ /*- * Copyright (c) 2004 Izumi Tsutsui. All rights reserved. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.24 2008/08/10 16:21:28 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.25 2008/08/10 18:43:55 tsutsui Exp $"); #include "opt_ddb.h" #include "bpfilter.h" @@ -1046,6 +1046,9 @@ mec_start(struct ifnet *ifp) MEC_TXDESCSYNC(sc, nexttx, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); + /* start TX */ + bus_space_write_8(st, sh, MEC_TX_RING_PTR, MEC_NEXTTX(nexttx)); + /* advance the TX pointer. */ sc->sc_txpending++; sc->sc_txlast = nexttx; @@ -1057,18 +1060,6 @@ mec_start(struct ifnet *ifp) } if (sc->sc_txpending != opending) { - /* - * Cause a TX interrupt to happen on the last packet - * we enqueued. - */ - sc->sc_txdesc[sc->sc_txlast].txd_cmd |= MEC_TXCMD_TXINT; - MEC_TXCMDSYNC(sc, sc->sc_txlast, - BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); - - /* start TX */ - bus_space_write_8(st, sh, MEC_TX_RING_PTR, - MEC_NEXTTX(sc->sc_txlast)); - /* * If the transmitter was idle, * reset the txdirty pointer and re-enable TX interrupt.