Author: yongari
Date: Tue Dec 13 20:26:46 2011
New Revision: 228479
URL: http://svn.freebsd.org/changeset/base/228479

Log:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.
  
  Submitted by: Geans Pin < geanspin <> broadcom dot com >

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c   Tue Dec 13 19:39:24 2011        (r228478)
+++ head/sys/dev/bge/if_bge.c   Tue Dec 13 20:26:46 2011        (r228479)
@@ -2080,9 +2080,15 @@ bge_blockinit(struct bge_softc *sc)
                        val |= BGE_RDMAMODE_TSO6_ENABLE;
        }
 
-       if (sc->bge_asicrev == BGE_ASICREV_BCM5720)
+       if (sc->bge_asicrev == BGE_ASICREV_BCM5720) {
                val |= CSR_READ_4(sc, BGE_RDMA_MODE) &
                        BGE_RDMAMODE_H2BNC_VLAN_DET;
+               /*
+                * Allow multiple outstanding read requests from
+                * non-LSO read DMA engine.
+                */
+               val &= ~BGE_RDMAMODE_MULT_DMA_RD_DIS;
+       }
 
        if (sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
            sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
@@ -2112,12 +2118,20 @@ bge_blockinit(struct bge_softc *sc)
                    BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
        }
 
-       if (sc->bge_asicrev == BGE_ASICREV_BCM5719 ||
-           sc->bge_asicrev == BGE_ASICREV_BCM5720) {
+       if (sc->bge_asicrev == BGE_ASICREV_BCM5719) {
                CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL,
                    CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) |
                    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K |
                    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K);
+       } else if (sc->bge_asicrev == BGE_ASICREV_BCM5720) {
+               /*
+                * Allow 4KB burst length reads for non-LSO frames.
+                * Enable 512B burst length reads for buffer descriptors.
+                */
+               CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL,
+                   CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) |
+                   BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 |
+                   BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K);
        }
 
        CSR_WRITE_4(sc, BGE_RDMA_MODE, val);

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h        Tue Dec 13 19:39:24 2011        
(r228478)
+++ head/sys/dev/bge/if_bgereg.h        Tue Dec 13 20:26:46 2011        
(r228479)
@@ -1573,6 +1573,7 @@
 #define        BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000
 #define        BGE_RDMA_RSRVCTRL_TXMRGN_MASK   0xFFE00000
 
+#define        BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512    0x00020000
 #define        BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K     0x00030000
 #define        BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K    0x000C0000
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to