aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2019-04-23 03:19:03 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2019-04-23 03:19:03 +0000
commitf4c5f64d3072402f3a3613602e7f051e356da1c6 (patch)
tree8cbc37b0b916c2250a385af1ed8e81b7c2919596
parentba5189f7bec2bea96aae702d5dee3db0d5f0501c (diff)
downloadsrc-f4c5f64d3072402f3a3613602e7f051e356da1c6.tar.gz
src-f4c5f64d3072402f3a3613602e7f051e356da1c6.zip
[PowerPC64] pseries-llan: increment packet output counters on error and success
Summary: when using pseries-llan driver, Opkts and Oerrs counters (netstat -i) are always zero. This patch adds an small error handling to increment these counters. Submitted by: alfredo.junior_eldorado.org.br Differential Revision: https://reviews.freebsd.org/D20009
Notes
Notes: svn path=/head/; revision=346590
-rw-r--r--sys/powerpc/pseries/phyp_llan.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/powerpc/pseries/phyp_llan.c b/sys/powerpc/pseries/phyp_llan.c
index 58333214ba06..5b95147dd1ad 100644
--- a/sys/powerpc/pseries/phyp_llan.c
+++ b/sys/powerpc/pseries/phyp_llan.c
@@ -425,7 +425,7 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, int nsegs,
{
struct llan_softc *sc = xsc;
uint64_t bufdescs[6];
- int i;
+ int i, err;
bzero(bufdescs, sizeof(bufdescs));
@@ -435,7 +435,7 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, int nsegs,
bufdescs[i] |= segs[i].ds_addr;
}
- phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0],
+ err = phyp_hcall(H_SEND_LOGICAL_LAN, sc->unit, bufdescs[0],
bufdescs[1], bufdescs[2], bufdescs[3], bufdescs[4], bufdescs[5], 0);
/*
* The hypercall returning implies completion -- or that the call will
@@ -443,6 +443,10 @@ llan_send_packet(void *xsc, bus_dma_segment_t *segs, int nsegs,
* H_BUSY based on the continuation token in R4. For now, just drop
* the packet in such cases.
*/
+ if (err == H_SUCCESS)
+ if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1);
+ else
+ if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
}
static void