bge(4) diff needs testing.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

bge(4) diff needs testing.

Brad Smith-14
Please test the following diff with any bge(4) adapters. Just checking to
ensure no regressions with known working adapters. Just check that things
are working as usual. Just bringing in some fixes for some of the newer
chipsets soon to appear. Nothing changed with existing chipsets though.


Index: if_bge.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.293
diff -u -p -r1.293 if_bge.c
--- if_bge.c 6 Apr 2010 15:27:51 -0000 1.293
+++ if_bge.c 10 Apr 2010 19:27:19 -0000
@@ -1352,9 +1375,12 @@ bge_blockinit(struct bge_softc *sc)
 
  /* Configure mbuf pool watermarks */
  /* new Broadcom docs strongly recommend these: */
- if (BGE_IS_5705_PLUS(sc) &&
-    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 &&
-    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765) {
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) {
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
+ } else if (BGE_IS_5705_PLUS(sc)) {
  CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
 
  if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
@@ -1660,11 +1686,17 @@ bge_blockinit(struct bge_softc *sc)
  if (BGE_IS_5755_PLUS(sc))
  val |= BGE_WDMAMODE_STATUS_TAG_FIX;
 
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785)
+ val |= BGE_WDMAMODE_BURST_ALL_DATA;
+
  /* Turn on write DMA state machine */
  CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
 
  val = BGE_RDMAMODE_ENABLE|BGE_RDMAMODE_ALL_ATTNS;
 
+ if (BGE_ASICREV(sc->bge_chipi) == BGE_ASICREV_BCM5717)
+ val |= BGE_RDMAMODE_MULT_DMA_RD_DIS;
+
  if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 ||
     BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 ||
     BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
@@ -2116,10 +2148,12 @@ bge_attach(struct device *parent, struct
  sc->bge_tx_max_coal_bds = 400;
 
  /* 5705 limits RX return ring to 512 entries. */
- if (BGE_IS_5705_PLUS(sc))
- sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
- else
+ if (BGE_IS_5700_FAMILY(sc) ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765)
  sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT;
+ else
+ sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
 
  /* Set up ifnet structure */
  ifp = &sc->arpcom.ac_if;
@@ -2188,7 +2222,8 @@ bge_attach(struct device *parent, struct
  /* The SysKonnect SK-9D41 is a 1000baseSX card. */
  if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
     (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
- if (BGE_IS_5714_FAMILY(sc))
+ if (BGE_IS_5714_FAMILY(sc) ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717)
     sc->bge_flags |= BGE_PHY_FIBER_MII;
  else
     sc->bge_flags |= BGE_PHY_FIBER_TBI;
Index: if_bgereg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bgereg.h,v
retrieving revision 1.100
diff -u -p -r1.100 if_bgereg.h
--- if_bgereg.h 9 Jan 2010 06:19:01 -0000 1.100
+++ if_bgereg.h 10 Apr 2010 19:27:19 -0000
@@ -1517,6 +1517,7 @@
 #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000
 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000
 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000
+#define BGE_RDMAMODE_MULT_DMA_RD_DIS 0x01000000
 
 /* Read DMA status register */
 #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004
@@ -1548,6 +1549,7 @@
 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC
 #define BGE_WDMAMODE_RX_ACCEL 0x00000400
 #define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000
+#define BGE_WDMAMODE_BURST_ALL_DATA 0xc0000000
 
 /* Write DMA status register */
 #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004

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

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

Brad Smith-14
On Sat, Apr 10, 2010 at 04:58:36PM -0400, Brad wrote:
> Please test the following diff with any bge(4) adapters. Just checking to
> ensure no regressions with known working adapters. Just check that things
> are working as usual. Just bringing in some fixes for some of the newer
> chipsets soon to appear. Nothing changed with existing chipsets though.

oops. there was a typo in the original diff. please test this revision.


Index: if_bge.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.293
diff -u -p -r1.293 if_bge.c
--- if_bge.c 6 Apr 2010 15:27:51 -0000 1.293
+++ if_bge.c 17 Apr 2010 03:32:24 -0000
@@ -1352,9 +1352,12 @@ bge_blockinit(struct bge_softc *sc)
 
  /* Configure mbuf pool watermarks */
  /* new Broadcom docs strongly recommend these: */
- if (BGE_IS_5705_PLUS(sc) &&
-    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 &&
-    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765) {
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) {
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
+ CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
+ } else if (BGE_IS_5705_PLUS(sc)) {
  CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
 
  if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
@@ -1660,11 +1663,17 @@ bge_blockinit(struct bge_softc *sc)
  if (BGE_IS_5755_PLUS(sc))
  val |= BGE_WDMAMODE_STATUS_TAG_FIX;
 
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785)
+ val |= BGE_WDMAMODE_BURST_ALL_DATA;
+
  /* Turn on write DMA state machine */
  CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
 
  val = BGE_RDMAMODE_ENABLE|BGE_RDMAMODE_ALL_ATTNS;
 
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717)
+ val |= BGE_RDMAMODE_MULT_DMA_RD_DIS;
+
  if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 ||
     BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 ||
     BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
@@ -2116,10 +2125,12 @@ bge_attach(struct device *parent, struct
  sc->bge_tx_max_coal_bds = 400;
 
  /* 5705 limits RX return ring to 512 entries. */
- if (BGE_IS_5705_PLUS(sc))
- sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
- else
+ if (BGE_IS_5700_FAMILY(sc) ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765)
  sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT;
+ else
+ sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
 
  /* Set up ifnet structure */
  ifp = &sc->arpcom.ac_if;
@@ -2188,7 +2199,8 @@ bge_attach(struct device *parent, struct
  /* The SysKonnect SK-9D41 is a 1000baseSX card. */
  if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
     (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
- if (BGE_IS_5714_FAMILY(sc))
+ if (BGE_IS_5714_FAMILY(sc) ||
+    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717)
     sc->bge_flags |= BGE_PHY_FIBER_MII;
  else
     sc->bge_flags |= BGE_PHY_FIBER_TBI;
Index: if_bgereg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bgereg.h,v
retrieving revision 1.100
diff -u -p -r1.100 if_bgereg.h
--- if_bgereg.h 9 Jan 2010 06:19:01 -0000 1.100
+++ if_bgereg.h 17 Apr 2010 03:32:24 -0000
@@ -1517,6 +1517,7 @@
 #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000
 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000
 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000
+#define BGE_RDMAMODE_MULT_DMA_RD_DIS 0x01000000
 
 /* Read DMA status register */
 #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004
@@ -1548,6 +1549,7 @@
 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC
 #define BGE_WDMAMODE_RX_ACCEL 0x00000400
 #define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000
+#define BGE_WDMAMODE_BURST_ALL_DATA 0xc0000000
 
 /* Write DMA status register */
 #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004

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

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

Theo de Raadt
Which ones should people tests?

Should I assume _all of them_ ... since you probably tested zero yourself?

Can you please report the ones you yourself tested on, before asking others
to invest time?

> On Sat, Apr 10, 2010 at 04:58:36PM -0400, Brad wrote:
> > Please test the following diff with any bge(4) adapters. Just checking to
> > ensure no regressions with known working adapters. Just check that things
> > are working as usual. Just bringing in some fixes for some of the newer
> > chipsets soon to appear. Nothing changed with existing chipsets though.
>
> oops. there was a typo in the original diff. please test this revision.
>
>
> Index: if_bge.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_bge.c,v
> retrieving revision 1.293
> diff -u -p -r1.293 if_bge.c
> --- if_bge.c 6 Apr 2010 15:27:51 -0000 1.293
> +++ if_bge.c 17 Apr 2010 03:32:24 -0000
> @@ -1352,9 +1352,12 @@ bge_blockinit(struct bge_softc *sc)
>  
>   /* Configure mbuf pool watermarks */
>   /* new Broadcom docs strongly recommend these: */
> - if (BGE_IS_5705_PLUS(sc) &&
> -    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5717 &&
> -    BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM57765) {
> + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
> +    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) {
> + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
> + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x2a);
> + CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xa0);
> + } else if (BGE_IS_5705_PLUS(sc)) {
>   CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
>  
>   if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
> @@ -1660,11 +1663,17 @@ bge_blockinit(struct bge_softc *sc)
>   if (BGE_IS_5755_PLUS(sc))
>   val |= BGE_WDMAMODE_STATUS_TAG_FIX;
>  
> + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785)
> + val |= BGE_WDMAMODE_BURST_ALL_DATA;
> +
>   /* Turn on write DMA state machine */
>   CSR_WRITE_4(sc, BGE_WDMA_MODE, val);
>  
>   val = BGE_RDMAMODE_ENABLE|BGE_RDMAMODE_ALL_ATTNS;
>  
> + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717)
> + val |= BGE_RDMAMODE_MULT_DMA_RD_DIS;
> +
>   if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 ||
>      BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 ||
>      BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
> @@ -2116,10 +2125,12 @@ bge_attach(struct device *parent, struct
>   sc->bge_tx_max_coal_bds = 400;
>  
>   /* 5705 limits RX return ring to 512 entries. */
> - if (BGE_IS_5705_PLUS(sc))
> - sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
> - else
> + if (BGE_IS_5700_FAMILY(sc) ||
> +    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
> +    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765)
>   sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT;
> + else
> + sc->bge_return_ring_cnt = BGE_RETURN_RING_CNT_5705;
>  
>   /* Set up ifnet structure */
>   ifp = &sc->arpcom.ac_if;
> @@ -2188,7 +2199,8 @@ bge_attach(struct device *parent, struct
>   /* The SysKonnect SK-9D41 is a 1000baseSX card. */
>   if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41 ||
>      (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) {
> - if (BGE_IS_5714_FAMILY(sc))
> + if (BGE_IS_5714_FAMILY(sc) ||
> +    BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717)
>      sc->bge_flags |= BGE_PHY_FIBER_MII;
>   else
>      sc->bge_flags |= BGE_PHY_FIBER_TBI;
> Index: if_bgereg.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_bgereg.h,v
> retrieving revision 1.100
> diff -u -p -r1.100 if_bgereg.h
> --- if_bgereg.h 9 Jan 2010 06:19:01 -0000 1.100
> +++ if_bgereg.h 17 Apr 2010 03:32:24 -0000
> @@ -1517,6 +1517,7 @@
>  #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000
>  #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000
>  #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000
> +#define BGE_RDMAMODE_MULT_DMA_RD_DIS 0x01000000
>  
>  /* Read DMA status register */
>  #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004
> @@ -1548,6 +1549,7 @@
>  #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC
>  #define BGE_WDMAMODE_RX_ACCEL 0x00000400
>  #define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000
> +#define BGE_WDMAMODE_BURST_ALL_DATA 0xc0000000
>  
>  /* Write DMA status register */
>  #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

Brad Smith-14
On Wednesday 21 April 2010 20:18:02 Theo de Raadt wrote:
> Which ones should people tests?

The bge(4), msk(4), ne(4) and ep(4) diffs.

bge(4) and msk(4) I have and have tested those respective diffs.
I have no ne(4) or ep(4) hardware, the changes are mechanical but
still need testing.

> Should I assume _all of them_ ... since you probably tested zero yourself?

Well, pretty much everything I post to tech@ I want people to test in some
manner.

> Can you please report the ones you yourself tested on, before asking others
> to invest time?

Ok. I can definitely do that.

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

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

Theo de Raadt
> On Wednesday 21 April 2010 20:18:02 Theo de Raadt wrote:
> > Which ones should people tests?
>
> The bge(4), msk(4), ne(4) and ep(4) diffs.
>
> bge(4) and msk(4) I have and have tested those respective diffs.
> I have no ne(4) or ep(4) hardware, the changes are mechanical but
> still need testing.
>
> > Should I assume _all of them_ ... since you probably tested zero yourself?
>
> Well, pretty much everything I post to tech@ I want people to test in some
> manner.
>
> > Can you please report the ones you yourself tested on, before asking others
> > to invest time?
>
> Ok. I can definitely do that.

If you want to be taken seriously, every diff you mail out should say
what you have tested _yourself_, before you ask others to test as well.

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

J.C. Roberts-3
In reply to this post by Brad Smith-14
On Wed, 21 Apr 2010 20:59:46 -0400 Brad <[hidden email]> wrote:

> > Which ones should people tests?
>
> The bge(4), msk(4), ne(4) and ep(4) diffs.
>
> bge(4) and msk(4) I have and have tested those respective diffs.
> I have no ne(4) or ep(4) hardware, the changes are mechanical but
> still need testing.

I didn't see the ep(4) diff?

I know I've got ep(4) 3c595 cards are but they really suck and are
unused. They can only do half duplex 100Mbit, or full duplex at 10Mbit,
and configuring the card mode requires MSDOS/Windows (3com util).

        jcr

--
The OpenBSD Journal - http://www.undeadly.org

Reply | Threaded
Open this post in threaded view
|

Re: bge(4) diff needs testing.

Paul de Weerd
In reply to this post by Brad Smith-14
On Sat, Apr 17, 2010 at 12:17:40PM -0400, Brad wrote:
| On Sat, Apr 10, 2010 at 04:58:36PM -0400, Brad wrote:
| > Please test the following diff with any bge(4) adapters. Just checking to
| > ensure no regressions with known working adapters. Just check that things
| > are working as usual. Just bringing in some fixes for some of the newer
| > chipsets soon to appear. Nothing changed with existing chipsets though.
|
| oops. there was a typo in the original diff. please test this revision.

This one works just fine on my older machine (Dell OptiPlex GX620)
running amd64 :

bge0 at pci2 dev 0 function 0 "Broadcom BCM5751" rev 0x01, BCM5750 A1 (0x4001): apic 8 int 16 (irq 11), address 00:13:72:bc:66:f7
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0

Found no issues with light use (v4, v6, multicast).

Paul 'WEiRD' de Weerd

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/