The following diff adds support for jumbos with the bge(4) BCM5714/5715/5780
chipsets. I have only been able to find someone to test with a 5714 family
chipset with non-jumbo mode of operation but it's a remote system on a network
without jumbos so not able to test there as well as 5700 family with and without
jumbos and newer chipsets without (they don't support jumbos). So I'm looking
for someone with a 5714 family chipset (5714, 5715, 5780) and is able to test
with an approriate setup with jumbos that would be great.


Index: share/man/man4/bge.4
===================================================================
RCS file: /home/cvs/src/share/man/man4/bge.4,v
retrieving revision 1.53
diff -u -p -r1.53 bge.4
--- share/man/man4/bge.4        13 Jul 2011 07:44:38 -0000      1.53
+++ share/man/man4/bge.4        13 Mar 2012 01:00:30 -0000
@@ -122,8 +122,8 @@ The BCM5717, BCM5718, BCM5723, BCM5724, 
 BCM5784, BCM5785, BCM5787 and BCM577xx chips also support IPv6 receive TCP/UDP
 checksum offload.
 .Pp
-The BCM5700, BCM5701, BCM5703 and BCM5704 chips are capable of
-supporting Jumbo frames, which can be configured via the
+The BCM5700, BCM5701, BCM5703, BCM5704, BCM5714, BCM5715 and BCM5780 chips are
+capable of supporting Jumbo frames, which can be configured via the
 interface MTU setting.
 Selecting an MTU larger than 1500 bytes with the
 .Xr ifconfig 8
Index: sys/dev/pci/if_bge.c
===================================================================
RCS file: /home/cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.307
diff -u -p -r1.307 if_bge.c
--- sys/dev/pci/if_bge.c        22 Jun 2011 16:44:27 -0000      1.307
+++ sys/dev/pci/if_bge.c        13 Mar 2012 02:04:55 -0000
@@ -731,10 +731,10 @@ bge_newbuf(struct bge_softc *sc, int i)
        struct mbuf             *m;
        int                     error;
 
-       m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES);
+       m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, sc->bge_std_len);
        if (!m)
                return (ENOBUFS);
-       m->m_len = m->m_pkthdr.len = MCLBYTES;
+       m->m_len = m->m_pkthdr.len = sc->bge_std_len;
        if (!(sc->bge_flags & BGE_RX_ALIGNBUG))
            m_adj(m, ETHER_ALIGN);
 
@@ -859,8 +859,8 @@ bge_init_rx_ring_std(struct bge_softc *s
                return (0);
 
        for (i = 0; i < BGE_STD_RX_RING_CNT; i++) {
-               if (bus_dmamap_create(sc->bge_dmatag, MCLBYTES, 1, MCLBYTES, 0,
-                   BUS_DMA_WAITOK | BUS_DMA_ALLOCNOW,
+               if (bus_dmamap_create(sc->bge_dmatag, sc->bge_std_len, 1,
+                   sc->bge_std_len, 0, BUS_DMA_WAITOK | BUS_DMA_ALLOCNOW,
                    &sc->bge_cdata.bge_rx_std_map[i]) != 0) {
                        printf("%s: unable to create dmamap for slot %d\n",
                            sc->bge_dev.dv_xname, i);
@@ -1434,7 +1434,7 @@ bge_blockinit(struct bge_softc *sc)
         * using this ring (i.e. once we set the MTU
         * high enough to require it).
         */
-       if (BGE_IS_JUMBO_CAPABLE(sc)) {
+       if (sc->bge_flags & BGE_JUMBO_RING) {
                rcb = &sc->bge_rdata->bge_info.bge_jumbo_rx_rcb;
                BGE_HOSTADDR(rcb->bge_hostaddr,
                    BGE_RING_DMA_ADDR(sc, bge_rx_jumbo_ring));
@@ -1472,6 +1472,7 @@ bge_blockinit(struct bge_softc *sc)
                        CSR_WRITE_4(sc, BGE_ISO_PKT_TX,
                            (CSR_READ_4(sc, BGE_ISO_PKT_TX) & ~3) | 2);
        }
+
        /*
         * Set the BD ring replenish thresholds. The recommended
         * values are 1/8th the number of descriptors allocated to
@@ -1481,7 +1482,8 @@ bge_blockinit(struct bge_softc *sc)
         * to work around HW bugs.
         */
        CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, 8);
-       CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, 8);
+       if (sc->bge_flags & BGE_JUMBO_RING)
+               CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, 8);
 
        if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5717 ||
            BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57765) {
@@ -1968,9 +1970,15 @@ bge_attach(struct device *parent, struct
            sc->bge_flags & BGE_PCIX)
                sc->bge_flags |= BGE_RX_ALIGNBUG;
 
-       if (BGE_IS_5700_FAMILY(sc))
+       if (BGE_IS_5700_FAMILY(sc) || BGE_IS_5714_FAMILY(sc))
                sc->bge_flags |= BGE_JUMBO_CAPABLE;
 
+       if (BGE_IS_5700_FAMILY(sc))
+               sc->bge_flags |= BGE_JUMBO_RING;
+
+       if (BGE_IS_5714_FAMILY(sc))
+               sc->bge_flags |= BGE_JUMBO_STD;
+
        if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700 ||
            BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5701) &&
            PCI_VENDOR(subid) == DELL_VENDORID)
@@ -2034,6 +2042,11 @@ bge_attach(struct device *parent, struct
                        sc->bge_flags |= BGE_PHY_BER_BUG;
        }
 
+       if (sc->bge_flags & BGE_JUMBO_STD)
+               sc->bge_std_len = BGE_JLEN;
+       else
+               sc->bge_std_len = MCLBYTES;
+
        /* Try to reset the chip. */
        DPRINTFN(5, ("bge_reset\n"));
        bge_reset(sc);
@@ -3257,7 +3270,7 @@ bge_init(void *xsc)
        }
 
        /* Init Jumbo RX ring. */
-       if (BGE_IS_JUMBO_CAPABLE(sc))
+       if (sc->bge_flags & BGE_JUMBO_RING)
                bge_init_rx_ring_jumbo(sc);
 
        /* Init our RX return ring index */
@@ -3597,7 +3610,7 @@ bge_stop(struct bge_softc *sc)
        bge_free_rx_ring_std(sc);
 
        /* Free jumbo RX list. */
-       if (BGE_IS_JUMBO_CAPABLE(sc))
+       if (sc->bge_flags & BGE_JUMBO_RING)
                bge_free_rx_ring_jumbo(sc);
 
        /* Free TX buffers. */
Index: sys/dev/pci/if_bgereg.h
===================================================================
RCS file: /home/cvs/src/sys/dev/pci/if_bgereg.h,v
retrieving revision 1.104
diff -u -p -r1.104 if_bgereg.h
--- sys/dev/pci/if_bgereg.h     15 Feb 2011 19:49:47 -0000      1.104
+++ sys/dev/pci/if_bgereg.h     12 Mar 2012 21:53:39 -0000
@@ -2611,6 +2611,8 @@ struct bge_softc {
 #define BGE_5755_PLUS          0x00800000
 #define BGE_5714_FAMILY                0x01000000
 #define BGE_5700_FAMILY                0x02000000
+#define BGE_JUMBO_STD          0x04000000
+#define BGE_JUMBO_RING         0x10000000
 
        bus_dma_tag_t           bge_dmatag;
        u_int32_t               bge_chipid;
@@ -2624,6 +2626,7 @@ struct bge_softc {
        u_int32_t               bge_tx_prodidx;
        u_int16_t               bge_std;        /* current std ring head */
        int                     bge_std_cnt;
+       int                     bge_std_len;
        u_int16_t               bge_jumbo;      /* current jumo ring head */
        int                     bge_jumbo_cnt;
        u_int32_t               bge_stat_ticks;

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

Reply via email to