fa.openbsd.tech
[Top] [All Lists]

bge(4) diff needs testing.

Subject: bge(4) diff needs testing.
From: Brad <brad@xxxxxxxxxxxx>
Date: Tue, 22 Jul 2008 14:36:23 UTC
Newsgroups: fa.openbsd.tech

The following diff needs testing with BCM5705 ASIC based bge(4)
adapters such as the following..

bge0 at pci1 dev 13 function 0 "Broadcom BCM5705" rev 0x03, BCM5705 A3
bge0 at pci7 dev 2 function 0 "Broadcom BCM5705K" rev 0x03, BCM5705 A3
bge0 at pci1 dev 0 function 0 "Broadcom BCM5705M" rev 0x01, BCM5705 A1
bge0 at pci2 dev 14 function 0 "Broadcom BCM5705M Alt" rev 0x03, BCM5705 A3
bge0 at pci1 dev 2 function 0 "Broadcom BCM5782" rev 0x03, BCM5705 A3
bge0 at pci0 dev 11 function 0 "Broadcom BCM5901" rev 0x01, BCM5705 A3

If you're able to please do some performance benchmarks with iperf or
tcpbench. Please send me the dmesg.


Index: if_bge.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.238
diff -u -p -r1.238 if_bge.c
--- if_bge.c    17 Jul 2008 19:59:44 -0000      1.238
+++ if_bge.c    22 Jul 2008 13:27:47 -0000
@@ -1320,6 +1320,7 @@ bge_chipinit(struct bge_softc *sc)
 int
 bge_blockinit(struct bge_softc *sc)
 {
+       struct pci_attach_args  *pa = &(sc->bge_pa);
        volatile struct bge_rcb         *rcb;
        vaddr_t                 rcb_addr;
        int                     i;
@@ -1652,7 +1653,15 @@ bge_blockinit(struct bge_softc *sc)
        if (!(BGE_IS_5705_OR_BEYOND(sc)))
                CSR_WRITE_4(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE);
 
-       val = BGE_WDMAMODE_ENABLE|BGE_WDMAMODE_ALL_ATTNS;
+       val = BGE_WDMAMODE_ENABLE | BGE_WDMAMODE_ALL_ATTNS;
+
+       if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 &&
+           sc->bge_chipid != BGE_CHIPID_BCM5705_A0) {
+               if (!(pci_conf_read(pa->pa_pc, pa->pa_tag,
+                   BGE_PCI_PCISTATE) & BGE_PCISTATE_PCI_BUSSPEED) &&
+                   !(sc->bge_flags & BGE_IS_5788))
+                       val |= BGE_WDMAMODE_RX_ACCEL;
+       }
 
        /* Enable host coalescing bug fix. */
        if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 ||
@@ -1662,18 +1671,21 @@ bge_blockinit(struct bge_softc *sc)
        /* Turn on write DMA state machine */
        CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
 
-       /* Turn on read DMA state machine */
-       {
-               uint32_t dma_read_modebits;
+       val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
 
-               dma_read_modebits =
-                 BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS;
+       if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 &&
+           sc->bge_chipid != BGE_CHIPID_BCM5705_A0) {
+               if (!(pci_conf_read(pa->pa_pc, pa->pa_tag,
+                   BGE_PCI_PCISTATE) & BGE_PCISTATE_PCI_BUSSPEED) &&
+                   !(sc->bge_flags & BGE_IS_5788))
+                       val |= BGE_RDMAMODE_FIFO_LONG_BURST;
+       }
 
-               if (sc->bge_flags & BGE_PCIE)
-                       dma_read_modebits |= BGE_RDMAMODE_FIFO_LONG_BURST;
+       if (sc->bge_flags & BGE_PCIE)
+               val |= BGE_RDMAMODE_FIFO_LONG_BURST;
 
-               CSR_WRITE_4(sc, BGE_RDMA_MODE, dma_read_modebits);
-       }
+       /* Turn on read DMA state machine */
+       CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
 
        /* Turn on RX data completion state machine */
        CSR_WRITE_4(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE);

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


<Prev in Thread] Current Thread [Next in Thread>