From ceb781da3e1d310ffe643775a2972c5a61681a6f Mon Sep 17 00:00:00 2001 From: brad Date: Wed, 16 Jul 2008 03:56:25 +0000 Subject: [PATCH] Enable the read DMA engine's PCI read request burst length long burst mode (4KB) for PCIe chips. This resolves the poor TX performance for the PCIe chips. The result being a bit under double the TX performance on a Gig connection (roughly 495 Mb/s -> 940 Mb/s). Tested by reyk@, sthen@, brad@ and a few end users. --- sys/dev/pci/if_bge.c | 6 +++--- sys/dev/pci/if_bgereg.h | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index c6a9555d65e..cb093f3301e 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.236 2008/06/07 19:05:11 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.237 2008/07/16 03:56:25 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1669,8 +1669,8 @@ bge_blockinit(struct bge_softc *sc) dma_read_modebits = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; - if (sc->bge_flags & BGE_PCIE && 0) - dma_read_modebits |= BGE_RDMA_MODE_FIFO_LONG_BURST; + if (sc->bge_flags & BGE_PCIE) + dma_read_modebits |= BGE_RDMAMODE_FIFO_LONG_BURST; CSR_WRITE_4(sc, BGE_RDMA_MODE, dma_read_modebits); } diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index 4a6a84bc4c3..c482e2481b7 100644 --- a/sys/dev/pci/if_bgereg.h +++ b/sys/dev/pci/if_bgereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bgereg.h,v 1.83 2008/04/20 01:32:43 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.84 2008/07/16 03:56:25 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1362,10 +1362,8 @@ #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMAMODE_LOCWRITE_TOOBIG 0x00000200 #define BGE_RDMAMODE_ALL_ATTNS 0x000003FC - -/* Alternate encodings for PCI-Express, from Broadcom-supplied Linux driver */ -#define BGE_RDMA_MODE_FIFO_LONG_BURST ((1 << 17) || (1 << 16)) -#define BGE_RDMA_MODE_FIFO_SIZE_128 (1 << 17) +#define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 +#define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 /* Read DMA status register */ #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -1395,6 +1393,7 @@ #define BGE_WDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_WDMAMODE_LOCREAD_TOOBIG 0x00000200 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_WDMAMODE_RX_ACCEL 0x00000400 /* Write DMA status register */ #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 -- 2.20.1