Module Name: src
Committed By: thorpej
Date: Wed Jan 29 05:41:48 UTC 2020
Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c xennetback_xenbus.c
Log Message:
Adopt <net/if_stats.h>.
To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/xen/xen/xennetback_xenbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.87 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.88
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.87 Wed Oct 30 07:40:06 2019
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c Wed Jan 29 05:41:48 2020
@@ -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 @@ again:
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 @@ again:
* 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 @@ again:
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 @@ again:
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 @@ again:
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;
}
Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.75 src/sys/arch/xen/xen/xennetback_xenbus.c:1.76
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.75 Sat Mar 9 08:42:25 2019
+++ src/sys/arch/xen/xen/xennetback_xenbus.c Wed Jan 29 05:41:48 2020
@@ -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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_evthandler(void *arg)
(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 @@ xennetback_evthandler(void *arg)
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 @@ xennetback_ifsoftstart_transfer(void *ar
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 @@ xennetback_ifsoftstart_copy(void *arg)
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) {