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 Adopt <net/if_stats.h>.



details:   https://anonhg.NetBSD.org/src/rev/d2168a242838
branches:  trunk
changeset: 744293:d2168a242838
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jan 29 05:41:48 2020 +0000

description:
Adopt <net/if_stats.h>.

diffstat:

 sys/arch/xen/xen/if_xennet_xenbus.c  |  16 ++++++++--------
 sys/arch/xen/xen/xennetback_xenbus.c |  22 +++++++++++-----------
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (165 lines):

diff -r f371be46c6f2 -r d2168a242838 sys/arch/xen/xen/if_xennet_xenbus.c
--- a/sys/arch/xen/xen/if_xennet_xenbus.c       Wed Jan 29 05:30:14 2020 +0000
+++ b/sys/arch/xen/xen/if_xennet_xenbus.c       Wed Jan 29 05:41:48 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.87 2019/10/30 07:40:06 maxv Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.88 2020/01/29 05:41:48 thorpej Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.87 2019/10/30 07:40:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.88 2020/01/29 05:41:48 thorpej Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -953,9 +953,9 @@
                if (__predict_false(
                    RING_GET_RESPONSE(&sc->sc_tx_ring, i)->status !=
                    NETIF_RSP_OKAY))
-                       ifp->if_oerrors++;
+                       if_statinc(ifp, if_oerrors);
                else
-                       ifp->if_opackets++;
+                       if_statinc(ifp, if_opackets);
                xengnt_revoke_access(req->txreq_gntref);
                m_freem(req->txreq_m);
                SLIST_INSERT_HEAD(&sc->sc_txreq_head, req, txreq_next);
@@ -1033,7 +1033,7 @@
                                 * we can't free this rxreq as no page will be mapped
                                 * here. Instead give it back immediatly to backend.
                                 */
-                               ifp->if_ierrors++;
+                               if_statinc(ifp, if_ierrors);
                                RING_GET_REQUEST(&sc->sc_rx_ring,
                                    sc->sc_rx_ring.req_prod_pvt)->id = req->rxreq_id;
                                RING_GET_REQUEST(&sc->sc_rx_ring,
@@ -1087,7 +1087,7 @@
                MGETHDR(m, M_DONTWAIT, MT_DATA);
                if (__predict_false(m == NULL)) {
                        printf("%s: rx no mbuf\n", ifp->if_xname);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        xennet_rx_free_req(req);
                        continue;
                }
@@ -1105,7 +1105,7 @@
                            if_xennetrxbuf_cache, PR_NOWAIT, &req->rxreq_pa);
                        if (__predict_false(req->rxreq_va == 0)) {
                                printf("%s: rx no buf\n", ifp->if_xname);
-                               ifp->if_ierrors++;
+                               if_statinc(ifp, if_ierrors);
                                req->rxreq_va = va;
                                req->rxreq_pa = pa;
                                xennet_rx_free_req(req);
@@ -1121,7 +1121,7 @@
                if ((rx->flags & NETRXF_csum_blank) != 0) {
                        xennet_checksum_fill(&m);
                        if (m == NULL) {
-                               ifp->if_ierrors++;
+                               if_statinc(ifp, if_ierrors);
                                xennet_rx_free_req(req);
                                continue;
                        }
diff -r f371be46c6f2 -r d2168a242838 sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Wed Jan 29 05:30:14 2020 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Wed Jan 29 05:41:48 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.75 2019/03/09 08:42:25 maxv Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.76 2020/01/29 05:41:48 thorpej Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.75 2019/03/09 08:42:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.76 2020/01/29 05:41:48 thorpej Exp $");
 
 #include "opt_xen.h"
 
@@ -788,7 +788,7 @@
                            ifp->if_xname, txreq.size, msg);
                        xennetback_tx_response(xneti, txreq.id,
                            NETIF_RSP_ERROR);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        continue;
                }
 
@@ -801,7 +801,7 @@
                                    ifp->if_xname);
                        xennetback_tx_response(xneti, txreq.id,
                            NETIF_RSP_DROPPED);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        continue;
                }
 
@@ -817,7 +817,7 @@
                                    ifp->if_xname);
                        xennetback_tx_response(xneti, txreq.id,
                            NETIF_RSP_DROPPED);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        m_freem(m);
                        continue;
                }
@@ -826,7 +826,7 @@
                if (__predict_false(err == ENOMEM)) {
                        xennetback_tx_response(xneti, txreq.id,
                            NETIF_RSP_DROPPED);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        pool_put(&xni_pkt_pool, pkt);
                        m_freem(m);
                        continue;
@@ -837,7 +837,7 @@
                            xneti->xni_if.if_xname, err);
                        xennetback_tx_response(xneti, txreq.id,
                            NETIF_RSP_ERROR);
-                       ifp->if_ierrors++;
+                       if_statinc(ifp, if_ierrors);
                        pool_put(&xni_pkt_pool, pkt);
                        m_freem(m);
                        continue;
@@ -879,7 +879,7 @@
                            (void *)(pkt_va + txreq.offset));
                        xni_pkt_unmap(pkt, pkt_va);
                        if (m->m_pkthdr.len < txreq.size) {
-                               ifp->if_ierrors++;
+                               if_statinc(ifp, if_ierrors);
                                m_freem(m);
                                xennetback_tx_response(xneti, txreq.id,
                                    NETIF_RSP_DROPPED);
@@ -900,7 +900,7 @@
                if ((txreq.flags & NETTXF_csum_blank) != 0) {
                        xennet_checksum_fill(&m);
                        if (m == NULL) {
-                               ifp->if_ierrors++;
+                               if_statinc(ifp, if_ierrors);
                                continue;
                        }
                }
@@ -1092,7 +1092,7 @@
                        mbufs_sent[i] = m;
                        resp_prod++;
                        i++; /* this packet has been queued */
-                       ifp->if_opackets++;
+                       if_statinc(ifp, if_opackets);
                        bpf_mtap(ifp, m, BPF_D_OUT);
                }
                if (i != 0) {
@@ -1384,7 +1384,7 @@
                        mbufs_sent[i] = m;
                        resp_prod++;
                        i++; /* this packet has been queued */
-                       ifp->if_opackets++;
+                       if_statinc(ifp, if_opackets);
                        bpf_mtap(ifp, m, BPF_D_OUT);
                }
                if (i != 0) {



Home | Main Index | Thread Index | Old Index