From 78fb85bbf7b05f1f9e0f69377a790d6f4428af89 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Sun, 29 Sep 1996 10:20:45 +0000 Subject: [PATCH] Backed out one of my "performance optimizations" as it results in sometimes not resuming the NIC as required for transmit. Thanks to Alan Cox for noticing this. Added another performance optimization to compensate. :-) Changed crscdt to 1...strange, but this seems to be needed for some reason despite what the manual says. --- sys/dev/fxp/if_fxp.c | 22 +++++++++++++--------- sys/pci/if_fxp.c | 22 +++++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 7d6d6469305..75bc852476c 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_fxp.c,v 1.18 1996/09/20 11:05:39 davidg Exp $ + * $Id: if_fxp.c,v 1.19 1996/09/22 11:48:54 davidg Exp $ */ /* @@ -418,7 +418,7 @@ fxp_start(ifp) struct fxp_csr *csr = sc->csr; struct fxp_cb_tx *txp; struct mbuf *m, *mb_head; - int segment; + int segment, first = 1; txloop: /* @@ -513,15 +513,19 @@ tbdinit: sc->tx_queued++; - if (csr->scb_cus == FXP_SCB_CUS_SUSPENDED) { + /* + * Only need to wait prior to the first resume command. + */ + if (first) { + first--; fxp_scb_wait(csr); - - /* - * Resume transmission. - */ - csr->scb_command = FXP_SCB_COMMAND_CU_RESUME; } + /* + * Resume transmission if suspended. + */ + csr->scb_command = FXP_SCB_COMMAND_CU_RESUME; + #if NBPFILTER > 0 /* * Pass packet to bpf if there is a listener. @@ -869,7 +873,7 @@ fxp_init(ifp) cbp->interfrm_spacing = 6; /* (96 bits of) interframe spacing */ cbp->promiscuous = prm; /* promiscuous mode */ cbp->bcast_disable = 0; /* (don't) disable broadcasts */ - cbp->crscdt = 0; /* (CRS only) */ + cbp->crscdt = 1; /* (CRS only) */ cbp->stripping = !prm; /* truncate rx packet to byte count */ cbp->padding = 1; /* (do) pad short tx packets */ cbp->rcv_crc_xfer = 0; /* (don't) xfer CRC to host */ diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c index 7d6d6469305..75bc852476c 100644 --- a/sys/pci/if_fxp.c +++ b/sys/pci/if_fxp.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_fxp.c,v 1.18 1996/09/20 11:05:39 davidg Exp $ + * $Id: if_fxp.c,v 1.19 1996/09/22 11:48:54 davidg Exp $ */ /* @@ -418,7 +418,7 @@ fxp_start(ifp) struct fxp_csr *csr = sc->csr; struct fxp_cb_tx *txp; struct mbuf *m, *mb_head; - int segment; + int segment, first = 1; txloop: /* @@ -513,15 +513,19 @@ tbdinit: sc->tx_queued++; - if (csr->scb_cus == FXP_SCB_CUS_SUSPENDED) { + /* + * Only need to wait prior to the first resume command. + */ + if (first) { + first--; fxp_scb_wait(csr); - - /* - * Resume transmission. - */ - csr->scb_command = FXP_SCB_COMMAND_CU_RESUME; } + /* + * Resume transmission if suspended. + */ + csr->scb_command = FXP_SCB_COMMAND_CU_RESUME; + #if NBPFILTER > 0 /* * Pass packet to bpf if there is a listener. @@ -869,7 +873,7 @@ fxp_init(ifp) cbp->interfrm_spacing = 6; /* (96 bits of) interframe spacing */ cbp->promiscuous = prm; /* promiscuous mode */ cbp->bcast_disable = 0; /* (don't) disable broadcasts */ - cbp->crscdt = 0; /* (CRS only) */ + cbp->crscdt = 1; /* (CRS only) */ cbp->stripping = !prm; /* truncate rx packet to byte count */ cbp->padding = 1; /* (do) pad short tx packets */ cbp->rcv_crc_xfer = 0; /* (don't) xfer CRC to host */