Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen - count if_opackets correctly.



details:   https://anonhg.NetBSD.org/src/rev/f0dbed4c7208
branches:  trunk
changeset: 583749:f0dbed4c7208
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Aug 21 13:12:59 2005 +0000

description:
- count if_opackets correctly.
- reflect tx errors to if_oerrors.

diffstat:

 sys/arch/xen/xen/if_xennet.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 1ecee52ca5f3 -r f0dbed4c7208 sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c      Sun Aug 21 00:25:51 2005 +0000
+++ b/sys/arch/xen/xen/if_xennet.c      Sun Aug 21 13:12:59 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_xennet.c,v 1.29 2005/08/07 04:54:58 yamt Exp $      */
+/*     $NetBSD: if_xennet.c,v 1.30 2005/08/21 13:12:59 yamt Exp $      */
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.29 2005/08/07 04:54:58 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.30 2005/08/21 13:12:59 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_nfs_boot.h"
@@ -823,6 +823,13 @@
                        put_bufarray_entry(sc->sc_tx_bufa,
                            sc->sc_tx->ring[MASK_NETIF_TX_IDX(idx)].resp.id);
                        sc->sc_tx_entries--; /* atomic */
+
+                       if (sc->sc_tx->ring[MASK_NETIF_TX_IDX(idx)].resp.status
+                           == NETIF_RSP_OKAY) {
+                               ifp->if_opackets++;
+                       } else {
+                               ifp->if_oerrors++;
+                       }
                }
 
                sc->sc_tx_resp_cons = prod;
@@ -1110,8 +1117,6 @@
                ifp->if_timer = 5;
        }
 
-       ifp->if_opackets++;
-
        DPRINTFN(XEDB_FOLLOW, ("%s: xennet_start() done\n",
            sc->sc_dev.dv_xname));
 }



Home | Main Index | Thread Index | Old Index