On Tue, Apr 25, 2006 at 11:59:39AM +0200, Lars Erik Gullerud wrote:
> On Mon, 24 Apr 2006, Oleg Bulyzhin wrote:
> 
> >Could you try attached patch? It should fix problem when link goes UP but
> >network is still down.
> >
> >About bge resets: you should try if_bge.c rev.1.126, it may help.
> >
> >P.S. anyway, please report how is it going.
> 
> I'll try your patch, however as we can't reproduce this on demand (only 
> happens sometimes under heavy load) it might be a while before I can give 
> you any feedback.
> 
> Regarding trying rev.1.126 from HEAD - I looked at the source and I see 
> some other modifications in 1.126 compared to the version in RELENG_6, 
> specifically, there are a lot of replacements of IFP2ENADDR with IF_LLADR, 
> that seems to have been commited in version 1.99 by ru, and some changes 
> regarding VLAN_INPUT_TAG_NEW vs. VLAN_INPUT_TAG.
> 
> Since these changes have not been MFC'ed to RELENG_6, I gather there is a 
> reason for that - so can 1.126 be used directly on 6.1, or do I need to 
> hand-edit the other changes in 1.126 into the stock RELENG_6 if_bge.c to 
> test this version?
> 
> /leg

Sorry i was not clear enough. Talking about rev 1.126 i meant applying
diff between rev.1.125 and rev.1.126
(i've created one  - it's attached to this mail).

-- 
Oleg.
Index: if_bge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- if_bge.c    17 Mar 2006 09:17:36 -0000      1.125
+++ if_bge.c    15 Apr 2006 08:13:06 -0000      1.126
@@ -2788,27 +2788,23 @@
        }
 #endif
 
-       bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
-           sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD);
+       /*
+        * Do the mandatory PCI flush as well as get the link status.
+        */
+       statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED;
 
-       statusword =
-           atomic_readandclear_32(&sc->bge_ldata.bge_status_block->bge_status);
+       /* Ack interrupt and stop others from occuring. */
+       CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1);
 
+       /* Make sure the descriptor ring indexes are coherent. */
+       bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
+           sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD);
        bus_dmamap_sync(sc->bge_cdata.bge_status_tag,
            sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD);
 
-#ifdef notdef
-       /* Avoid this for now -- checking this register is expensive. */
-       /* Make sure this is really our interrupt. */
-       if (!(CSR_READ_4(sc, BGE_MISC_LOCAL_CTL) & BGE_MLC_INTR_STATE))
-               return;
-#endif
-       /* Ack interrupt and stop others from occuring. */
-       CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 1);
-
        if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
            sc->bge_chipid != BGE_CHIPID_BCM5700_B1) ||
-           statusword & BGE_STATFLAG_LINKSTATE_CHANGED || sc->bge_link_evt)
+           statusword || sc->bge_link_evt)
                bge_link_upd(sc);
 
        if (ifp->if_drv_flags & IFF_DRV_RUNNING) {

Attachment: pgp5BYi0U3Als.pgp
Description: PGP signature

Reply via email to