Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2001 10:50:09 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        "Kenneth D. Merry" <ken@kdm.org>, current@FreeBSD.ORG
Subject:   SIC: New Patch (context diff)
Message-ID:  <3BCC7351.575FAA5@mindspring.com>
References:  <3BBF5E49.65AF9D8E@mindspring.com> <20011006144418.A6779@panzer.kdm.org> <3BC00ABC.20ECAAD8@mindspring.com> <20011008231046.A10472@panzer.kdm.org> <3BC34FC2.6AF8C872@mindspring.com> <20011010000604.A19388@panzer.kdm.org> <3BC40E04.D89ECB05@mindspring.com> <20011010232020.A27019@panzer.kdm.org> <3BC55201.EC273414@mindspring.com> <20011015002407.A59917@panzer.kdm.org> <3BCB2C87.BEF543A0@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------76CA1126686D7D405218B3D3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Terry Lambert wrote:
> > > OK, I will rediff and generate context diffs; expect them to
> > > be sent in 24 hours or so from now.
> >
> > It's been longer than that...
> 
> Sorry; I've been doing a lot this weekend.  I will redo them
> at work today, and resend them tonight... definitely.

Here are the context diff versions of the coelescing patch.

-- Terry
--------------76CA1126686D7D405218B3D3
Content-Type: text/plain; charset=us-ascii;
 name="mogul.pat.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mogul.pat.txt"

Index: if_dc.c
===================================================================
RCS file: /home/cvs/clickarray/FreeBSD/sys.releng4/pci/if_dc.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 if_dc.c
*** if_dc.c     2001/04/25 22:24:44     1.1.1.2
--- if_dc.c     2001/09/15 13:35:35
***************
*** 193,200 ****
  static int dc_coal            __P((struct dc_softc *, struct mbuf **));
  static void dc_pnic_rx_bug_war        __P((struct dc_softc *, int));
  static int dc_rx_resync               __P((struct dc_softc *));
! static void dc_rxeof          __P((struct dc_softc *));
! static void dc_txeof          __P((struct dc_softc *));
  static void dc_tick           __P((void *));
  static void dc_tx_underrun    __P((struct dc_softc *));
  static void dc_intr           __P((void *));
--- 193,200 ----
  static int dc_coal            __P((struct dc_softc *, struct mbuf **));
  static void dc_pnic_rx_bug_war        __P((struct dc_softc *, int));
  static int dc_rx_resync               __P((struct dc_softc *));
! static int dc_rxeof           __P((struct dc_softc *));
! static int dc_txeof           __P((struct dc_softc *));
  static void dc_tick           __P((void *));
  static void dc_tx_underrun    __P((struct dc_softc *));
  static void dc_intr           __P((void *));
***************
*** 2302,2308 ****
   * A frame has been uploaded: pass the resulting mbuf chain up to
   * the higher level protocols.
   */
! static void dc_rxeof(sc)
        struct dc_softc         *sc;
  {
          struct ether_header   *eh;
--- 2302,2308 ----
   * A frame has been uploaded: pass the resulting mbuf chain up to
   * the higher level protocols.
   */
! static int dc_rxeof(sc)
        struct dc_softc         *sc;
  {
          struct ether_header   *eh;
***************
*** 2311,2316 ****
--- 2311,2317 ----
        struct dc_desc          *cur_rx;
        int                     i, total_len = 0;
        u_int32_t               rxstat;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;
        i = sc->dc_cdata.dc_rx_prod;
***************
*** 2355,2361 ****
                                continue;
                        } else {
                                dc_init(sc);
!                               return;
                        }
                }

--- 2356,2362 ----
                                continue;
                        } else {
                                dc_init(sc);
!                               return(cnt);
                        }
                }

***************
*** 2379,2384 ****
--- 2380,2386 ----
                /* Remove header from mbuf and pass it on. */
                m_adj(m, sizeof(struct ether_header));
                ether_input(ifp, eh, m);
+               cnt++;
        }

        sc->dc_cdata.dc_rx_prod = i;
***************
*** 2389,2400 ****
   * the list buffers.
   */

! static void dc_txeof(sc)
        struct dc_softc         *sc;
  {
        struct dc_desc          *cur_tx = NULL;
        struct ifnet            *ifp;
        int                     idx;

        ifp = &sc->arpcom.ac_if;

--- 2391,2403 ----
   * the list buffers.
   */

! static int dc_txeof(sc)
        struct dc_softc         *sc;
  {
        struct dc_desc          *cur_tx = NULL;
        struct ifnet            *ifp;
        int                     idx;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;

***************
*** 2452,2458 ****
                                ifp->if_collisions++;
                        if (!(txstat & DC_TXSTAT_UNDERRUN)) {
                                dc_init(sc);
!                               return;
                        }
                }

--- 2455,2461 ----
                                ifp->if_collisions++;
                        if (!(txstat & DC_TXSTAT_UNDERRUN)) {
                                dc_init(sc);
!                               return(cnt);
                        }
                }

***************
*** 2466,2478 ****

                sc->dc_cdata.dc_tx_cnt--;
                DC_INC(idx, DC_TX_LIST_CNT);
        }

        sc->dc_cdata.dc_tx_cons = idx;
        if (cur_tx != NULL)
                ifp->if_flags &= ~IFF_OACTIVE;

!       return;
  }

  static void dc_tick(xsc)
--- 2469,2482 ----

                sc->dc_cdata.dc_tx_cnt--;
                DC_INC(idx, DC_TX_LIST_CNT);
+               cnt++;
        }

        sc->dc_cdata.dc_tx_cons = idx;
        if (cur_tx != NULL)
                ifp->if_flags &= ~IFF_OACTIVE;

!       return(cnt);
  }

  static void dc_tick(xsc)
***************
*** 2612,2617 ****
--- 2616,2622 ----
        struct dc_softc         *sc;
        struct ifnet            *ifp;
        u_int32_t               status;
+       int                     cnt = 0;

        sc = arg;

***************
*** 2630,2635 ****
--- 2635,2641 ----
        /* Disable interrupts. */
        CSR_WRITE_4(sc, DC_IMR, 0x00000000);

+ again:
        while((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) {

                CSR_WRITE_4(sc, DC_ISR, status);
***************
*** 2637,2654 ****
                if (status & DC_ISR_RX_OK) {
                        int             curpkts;
                        curpkts = ifp->if_ipackets;
!                       dc_rxeof(sc);
                        if (curpkts == ifp->if_ipackets) {
                                while(dc_rx_resync(sc))
!                                       dc_rxeof(sc);
                        }
                }

                if (status & (DC_ISR_TX_OK|DC_ISR_TX_NOBUF))
!                       dc_txeof(sc);

                if (status & DC_ISR_TX_IDLE) {
!                       dc_txeof(sc);
                        if (sc->dc_cdata.dc_tx_cnt) {
                                DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
                                CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
--- 2643,2660 ----
                if (status & DC_ISR_RX_OK) {
                        int             curpkts;
                        curpkts = ifp->if_ipackets;
!                       cnt += dc_rxeof(sc);
                        if (curpkts == ifp->if_ipackets) {
                                while(dc_rx_resync(sc))
!                                       cnt += dc_rxeof(sc);
                        }
                }

                if (status & (DC_ISR_TX_OK|DC_ISR_TX_NOBUF))
!                       cnt += dc_txeof(sc);

                if (status & DC_ISR_TX_IDLE) {
!                       cnt += dc_txeof(sc);
                        if (sc->dc_cdata.dc_tx_cnt) {
                                DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
                                CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
***************
*** 2662,2671 ****
                    || (status & DC_ISR_RX_NOBUF)) {
                        int             curpkts;
                        curpkts = ifp->if_ipackets;
!                       dc_rxeof(sc);
                        if (curpkts == ifp->if_ipackets) {
                                while(dc_rx_resync(sc))
!                                       dc_rxeof(sc);
                        }
                }

--- 2668,2677 ----
                    || (status & DC_ISR_RX_NOBUF)) {
                        int             curpkts;
                        curpkts = ifp->if_ipackets;
!                       cnt += dc_rxeof(sc);
                        if (curpkts == ifp->if_ipackets) {
                                while(dc_rx_resync(sc))
!                                       cnt += dc_rxeof(sc);
                        }
                }

***************
*** 2673,2678 ****
--- 2679,2689 ----
                        dc_reset(sc);
                        dc_init(sc);
                }
+       }
+
+       if (cnt) {      /* XXX limit repeats? */
+               cnt = 0;
+               goto again;
        }

        /* Re-enable interrupts. */
Index: if_ti.c
===================================================================
RCS file: /home/cvs/clickarray/FreeBSD/sys.releng4/pci/if_ti.c,v
retrieving revision 1.4
diff -c -r1.4 if_ti.c
*** if_ti.c     2001/07/26 23:05:20     1.4
--- if_ti.c     2001/09/15 13:36:49
***************
*** 159,166 ****
  static int ti_probe           __P((device_t));
  static int ti_attach          __P((device_t));
  static int ti_detach          __P((device_t));
! static void ti_txeof          __P((struct ti_softc *));
! static void ti_rxeof          __P((struct ti_softc *));

  static void ti_stats_update   __P((struct ti_softc *));
  static int ti_encap           __P((struct ti_softc *, struct mbuf *,
--- 159,166 ----
  static int ti_probe           __P((device_t));
  static int ti_attach          __P((device_t));
  static int ti_detach          __P((device_t));
! static int ti_txeof           __P((struct ti_softc *));
! static int ti_rxeof           __P((struct ti_softc *));

  static void ti_stats_update   __P((struct ti_softc *));
  static int ti_encap           __P((struct ti_softc *, struct mbuf *,
***************
*** 1815,1825 ****
   * 3) the frame is from the standard receive ring
   */

! static void ti_rxeof(sc)
        struct ti_softc         *sc;
  {
        struct ifnet            *ifp;
        struct ti_cmd_desc      cmd;

        ifp = &sc->arpcom.ac_if;

--- 1815,1826 ----
   * 3) the frame is from the standard receive ring
   */

! static int ti_rxeof(sc)
        struct ti_softc         *sc;
  {
        struct ifnet            *ifp;
        struct ti_cmd_desc      cmd;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;

***************
*** 1904,1909 ****
--- 1905,1911 ----
                                m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
                        m->m_pkthdr.csum_data = cur_rx->ti_tcp_udp_cksum;
                }
+               cnt++;

  #if NVLAN > 0
                /*
***************
*** 1928,1941 ****
        TI_UPDATE_MINIPROD(sc, sc->ti_mini);
        TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo);

!       return;
  }

! static void ti_txeof(sc)
        struct ti_softc         *sc;
  {
        struct ti_tx_desc       *cur_tx = NULL;
        struct ifnet            *ifp;

        ifp = &sc->arpcom.ac_if;

--- 1930,1944 ----
        TI_UPDATE_MINIPROD(sc, sc->ti_mini);
        TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo);

!       return(cnt);
  }

! static int ti_txeof(sc)
        struct ti_softc         *sc;
  {
        struct ti_tx_desc       *cur_tx = NULL;
        struct ifnet            *ifp;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;

***************
*** 1972,1983 ****
                sc->ti_txcnt--;
                TI_INC(sc->ti_tx_saved_considx, TI_TX_RING_CNT);
                ifp->if_timer = 0;
        }

        if (cur_tx != NULL)
                ifp->if_flags &= ~IFF_OACTIVE;

!       return;
  }

  static void ti_intr(xsc)
--- 1975,1987 ----
                sc->ti_txcnt--;
                TI_INC(sc->ti_tx_saved_considx, TI_TX_RING_CNT);
                ifp->if_timer = 0;
+               cnt++;
        }

        if (cur_tx != NULL)
                ifp->if_flags &= ~IFF_OACTIVE;

!       return(cnt);
  }

  static void ti_intr(xsc)
***************
*** 2000,2010 ****
        CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);

        if (ifp->if_flags & IFF_RUNNING) {
!               /* Check RX return ring producer/consumer */
!               ti_rxeof(sc);
!
!               /* Check TX ring producer/consumer */
!               ti_txeof(sc);
        }

        ti_handle_events(sc);
--- 2004,2012 ----
        CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);

        if (ifp->if_flags & IFF_RUNNING) {
!               /* Check RX, TX return ring producer/consumer */
!               while(ti_rxeof(sc) || ti_txeof(sc))
!                       continue;       /* XXX limit repeats? */
        }

        ti_handle_events(sc);
Index: if_vr.c
===================================================================
RCS file: /home/cvs/clickarray/FreeBSD/sys.releng4/pci/if_vr.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 if_vr.c
*** if_vr.c     2001/03/21 00:54:05     1.1.1.1
--- if_vr.c     2001/09/15 13:35:19
***************
*** 130,138 ****
  static int vr_encap           __P((struct vr_softc *, struct vr_chain *,
                                                struct mbuf * ));

! static void vr_rxeof          __P((struct vr_softc *));
! static void vr_rxeoc          __P((struct vr_softc *));
! static void vr_txeof          __P((struct vr_softc *));
  static void vr_txeoc          __P((struct vr_softc *));
  static void vr_tick           __P((void *));
  static void vr_intr           __P((void *));
--- 130,138 ----
  static int vr_encap           __P((struct vr_softc *, struct vr_chain *,
                                                struct mbuf * ));

! static int vr_rxeof           __P((struct vr_softc *));
! static int vr_rxeoc           __P((struct vr_softc *));
! static int vr_txeof           __P((struct vr_softc *));
  static void vr_txeoc          __P((struct vr_softc *));
  static void vr_tick           __P((void *));
  static void vr_intr           __P((void *));
***************
*** 953,959 ****
   * A frame has been uploaded: pass the resulting mbuf chain up to
   * the higher level protocols.
   */
! static void vr_rxeof(sc)
        struct vr_softc         *sc;
  {
          struct ether_header   *eh;
--- 953,959 ----
   * A frame has been uploaded: pass the resulting mbuf chain up to
   * the higher level protocols.
   */
! static int vr_rxeof(sc)
        struct vr_softc         *sc;
  {
          struct ether_header   *eh;
***************
*** 962,967 ****
--- 962,968 ----
        struct vr_chain_onefrag *cur_rx;
        int                     total_len = 0;
        u_int32_t               rxstat;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;

***************
*** 1040,1061 ****
                /* Remove header from mbuf and pass it on. */
                m_adj(m, sizeof(struct ether_header));
                ether_input(ifp, eh, m);
        }

!       return;
  }

! void vr_rxeoc(sc)
        struct vr_softc         *sc;
  {

!       vr_rxeof(sc);
        VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
        CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
        VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
        VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO);

!       return;
  }

  /*
--- 1041,1065 ----
                /* Remove header from mbuf and pass it on. */
                m_adj(m, sizeof(struct ether_header));
                ether_input(ifp, eh, m);
+
+               cnt++;
        }

!       return(cnt);
  }

! int vr_rxeoc(sc)
        struct vr_softc         *sc;
  {
+       int cnt;

!       cnt = vr_rxeof(sc);
        VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
        CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
        VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
        VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO);

!       return(cnt);
  }

  /*
***************
*** 1063,1073 ****
   * the list buffers.
   */

! static void vr_txeof(sc)
        struct vr_softc         *sc;
  {
        struct vr_chain         *cur_tx;
        struct ifnet            *ifp;

        ifp = &sc->arpcom.ac_if;

--- 1067,1078 ----
   * the list buffers.
   */

! static int vr_txeof(sc)
        struct vr_softc         *sc;
  {
        struct vr_chain         *cur_tx;
        struct ifnet            *ifp;
+       int                     cnt = 0;

        ifp = &sc->arpcom.ac_if;

***************
*** 1165,1170 ****
--- 1170,1176 ----
        struct vr_softc         *sc;
        struct ifnet            *ifp;
        u_int16_t               status;
+       int                     cnt = 0;

        sc = arg;
        ifp = &sc->arpcom.ac_if;
***************
*** 1178,1183 ****
--- 1184,1190 ----
        /* Disable interrupts. */
        CSR_WRITE_2(sc, VR_IMR, 0x0000);

+ again:
        for (;;) {

                status = CSR_READ_2(sc, VR_ISR);
***************
*** 1188,1210 ****
                        break;

                if (status & VR_ISR_RX_OK)
!                       vr_rxeof(sc);

                if ((status & VR_ISR_RX_ERR) || (status & VR_ISR_RX_NOBUF) ||
                    (status & VR_ISR_RX_NOBUF) || (status & VR_ISR_RX_OFLOW) ||
                    (status & VR_ISR_RX_DROPPED)) {
                        vr_rxeof(sc);
!                       vr_rxeoc(sc);
                }

                if (status & VR_ISR_TX_OK) {
!                       vr_txeof(sc);
                        vr_txeoc(sc);
                }

                if ((status & VR_ISR_TX_UNDERRUN)||(status & VR_ISR_TX_ABRT)){
                        ifp->if_oerrors++;
!                       vr_txeof(sc);
                        if (sc->vr_cdata.vr_tx_head != NULL) {
                                VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
                                VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
--- 1195,1217 ----
                        break;

                if (status & VR_ISR_RX_OK)
!                       cnt += vr_rxeof(sc);

                if ((status & VR_ISR_RX_ERR) || (status & VR_ISR_RX_NOBUF) ||
                    (status & VR_ISR_RX_NOBUF) || (status & VR_ISR_RX_OFLOW) ||
                    (status & VR_ISR_RX_DROPPED)) {
                        vr_rxeof(sc);
!                       cnt += vr_rxeoc(sc);
                }

                if (status & VR_ISR_TX_OK) {
!                       cnt += vr_txeof(sc);
                        vr_txeoc(sc);
                }

                if ((status & VR_ISR_TX_UNDERRUN)||(status & VR_ISR_TX_ABRT)){
                        ifp->if_oerrors++;
!                       cnt += vr_txeof(sc);
                        if (sc->vr_cdata.vr_tx_head != NULL) {
                                VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
                                VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
***************
*** 1215,1220 ****
--- 1222,1232 ----
                        vr_reset(sc);
                        vr_init(sc);
                }
+       }
+
+       if (cnt) {      /* XXX limit repeats? */
+               cnt = 0;
+               goto again;
        }

        /* Re-enable interrupts. */

--------------76CA1126686D7D405218B3D3--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BCC7351.575FAA5>