Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/arch/xen/xen Pull up revision 1.28 (requested by yamt...



details:   https://anonhg.NetBSD.org/src/rev/980a045ffd02
branches:  netbsd-3
changeset: 576563:980a045ffd02
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jul 11 11:41:03 2005 +0000

description:
Pull up revision 1.28 (requested by yamt in ticket #574):
handle tx buffer exhaustion.

diffstat:

 sys/arch/xen/xen/if_xennet.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r ee253381a361 -r 980a045ffd02 sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c      Mon Jul 11 11:40:12 2005 +0000
+++ b/sys/arch/xen/xen/if_xennet.c      Mon Jul 11 11:41:03 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_xennet.c,v 1.13.2.12 2005/06/18 10:47:49 tron Exp $ */
+/*     $NetBSD: if_xennet.c,v 1.13.2.13 2005/07/11 11:41:03 tron Exp $ */
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.13.2.12 2005/06/18 10:47:49 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.13.2.13 2005/07/11 11:41:03 tron Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -656,6 +656,7 @@
        struct mbuf *m;
 
        network_tx_buf_gc(sc);
+       ifp->if_flags &= ~IFF_OACTIVE;
        xennet_start(ifp);
 
 #if NRND > 0
@@ -993,6 +994,8 @@
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
                return;
 
+       network_tx_buf_gc(sc);
+
        idx = sc->sc_tx->req_prod;
        while (/*CONSTCOND*/1) {
 
@@ -1000,6 +1003,11 @@
                if (m == NULL)
                        break;
 
+               if (sc->sc_tx_entries >= NETIF_TX_RING_SIZE - 1) {
+                       ifp->if_flags |= IFF_OACTIVE;
+                       break;
+               }
+
                switch (m->m_flags & (M_EXT|M_EXT_CLUSTER)) {
                case M_EXT|M_EXT_CLUSTER:
                        pa = m->m_ext.ext_paddr +
@@ -1090,10 +1098,6 @@
 #endif
        }
 
-       ifp->if_flags &= ~IFF_OACTIVE;
-
-       network_tx_buf_gc(sc);
-
        x86_lfence();
        if (sc->sc_tx->resp_prod != idx) {
                hypervisor_notify_via_evtchn(sc->sc_evtchn);



Home | Main Index | Thread Index | Old Index