Page MenuHomeFreeBSD

D54893.diff
No OneTemporary

D54893.diff

diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c
--- a/sys/dev/dpaa2/dpaa2_ni.c
+++ b/sys/dev/dpaa2/dpaa2_ni.c
@@ -2532,6 +2532,7 @@
ch = sc->channels[chidx];
error = buf_ring_enqueue(ch->xmit_br, m);
if (__predict_false(error != 0)) {
+ if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1);
m_freem(m);
} else {
taskqueue_enqueue(ch->cleanup_tq, &ch->cleanup_task);
@@ -2943,6 +2944,8 @@
bus_dma_segment_t segs[DPAA2_TX_SEGLIMIT];
int rc, nsegs;
int error;
+ int len;
+ bool mcast;
mtx_assert(&tx->lock, MA_NOTOWNED);
mtx_lock(&tx->lock);
@@ -2957,6 +2960,8 @@
buf->m = m;
sgt = buf->sgt;
}
+ len = m->m_pkthdr.len;
+ mcast = (m->m_flags & M_MCAST) != 0;
#if defined(INVARIANTS)
struct dpaa2_ni_tx_ring *btx = (struct dpaa2_ni_tx_ring *)buf->opt;
@@ -2974,6 +2979,7 @@
if (md == NULL) {
device_printf(dev, "%s: m_collapse() failed\n", __func__);
fq->chan->tx_dropped++;
+ if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
goto err;
}
@@ -2984,6 +2990,7 @@
device_printf(dev, "%s: bus_dmamap_load_mbuf_sg() "
"failed: error=%d\n", __func__, error);
fq->chan->tx_dropped++;
+ if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
goto err;
}
}
@@ -2993,6 +3000,7 @@
device_printf(dev, "%s: failed to build frame descriptor: "
"error=%d\n", __func__, error);
fq->chan->tx_dropped++;
+ if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
goto err_unload;
}
@@ -3010,8 +3018,13 @@
if (rc != 1) {
fq->chan->tx_dropped++;
+ if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1);
goto err_unload;
} else {
+ if (mcast)
+ if_inc_counter(sc->ifp, IFCOUNTER_OMCASTS, 1);
+ if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1);
+ if_inc_counter(sc->ifp, IFCOUNTER_OBYTES, len);
fq->chan->tx_frames++;
}
return;
@@ -3190,6 +3203,7 @@
m->m_pkthdr.rcvif = sc->ifp;
m->m_pkthdr.flowid = fq->fqid;
M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
+ if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1);
if (ctx->head == NULL) {
KASSERT(ctx->tail == NULL, ("%s: tail already given?", __func__));

File Metadata

Mime Type
text/plain
Expires
Mon, May 25, 7:53 AM (17 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33503065
Default Alt Text
D54893.diff (2 KB)

Event Timeline