svn commit: r254679 - projects/vmxnet/sys/dev/vmware/vmxnet3
Bryan Venteicher
bryanv at FreeBSD.org
Fri Aug 23 05:26:46 UTC 2013
Author: bryanv
Date: Fri Aug 23 05:26:45 2013
New Revision: 254679
URL: http://svnweb.freebsd.org/changeset/base/254679
Log:
Fix typo that could give us the wrong number of avail Tx descriptors
Add a few more error statistics
Modified:
projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmx.c
projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmxvar.h
Modified: projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmx.c Fri Aug 23 02:10:21 2013 (r254678)
+++ projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmx.c Fri Aug 23 05:26:45 2013 (r254679)
@@ -1633,7 +1633,7 @@ vmxnet3_newbuf(struct vmxnet3_softc *sc,
m = m_getjcl(M_NOWAIT, MT_DATA, flags, clsize);
if (m == NULL) {
- sc->vmx_stats.vmst_getcl_failed++;
+ sc->vmx_stats.vmst_mgetcl_failed++;
return (ENOBUFS);
}
@@ -1647,6 +1647,7 @@ vmxnet3_newbuf(struct vmxnet3_softc *sc,
BUS_DMA_NOWAIT);
if (error) {
m_freem(m);
+ sc->vmx_stats.vmst_mbuf_load_failed++;;
return (error);
}
KASSERT(nsegs == 1,
@@ -2442,6 +2443,7 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue
} else if (m->m_pkthdr.csum_flags & VMXNET3_CSUM_ALL_OFFLOAD) {
error = vmxnet3_txq_offload_ctx(m, &etype, &proto, &start);
if (error) {
+ txq->vxtxq_stats.vtxrs_offload_failed++;
vmxnet3_txq_unload_mbuf(txq, dmap);
m_freem(m);
*m0 = NULL;
@@ -2944,6 +2946,8 @@ vmxnet3_setup_txq_sysctl(struct vmxnet3_
SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "ringfull", CTLFLAG_RD,
&stats->vtxrs_full, "Tx ring full");
+ SYSCTL_ADD_UQUAD(ctx, list, OID_AUTO, "offload_failed", CTLFLAG_RD,
+ &stats->vtxrs_offload_failed, "Tx checksum offload failed");
/*
* Add statistics reported by the host. These are updated once
@@ -3114,10 +3118,12 @@ vmxnet3_setup_sysctl(struct vmxnet3_soft
&sc->vmx_nrxqueues, 0, "Number of Rx queues");
stats = &sc->vmx_stats;
- SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "collapsed", CTLFLAG_RD,
- &stats->vmst_collapsed, "Tx mbuf chains collapsed");
- SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "getcl_failed", CTLFLAG_RD,
- &stats->vmst_getcl_failed, "Alloc of mbuf cluster failed");
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "collapsed", CTLFLAG_RD,
+ &stats->vmst_collapsed, 0, "Tx mbuf chains collapsed");
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "mgetcl_failed", CTLFLAG_RD,
+ &stats->vmst_mgetcl_failed, 0, "mbuf cluster allocation failed");
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "mbuf_load_failed", CTLFLAG_RD,
+ &stats->vmst_mbuf_load_failed, 0, "mbuf load segments failed");
vmxnet3_setup_queue_sysctl(sc, ctx, child);
}
Modified: projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmxvar.h
==============================================================================
--- projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Aug 23 02:10:21 2013 (r254678)
+++ projects/vmxnet/sys/dev/vmware/vmxnet3/if_vmxvar.h Fri Aug 23 05:26:45 2013 (r254679)
@@ -73,8 +73,12 @@ struct vmxnet3_txring {
struct vmxnet3_dma_alloc vxtxr_dma;
};
-#define VMXNET3_TXRING_AVAIL(_txr) \
- (((_txr)->vxtxr_head - (_txr)->vxtxr_head - 1) % VMXNET3_MAX_TX_NDESC)
+static inline int
+VMXNET3_TXRING_AVAIL(struct vmxnet3_txring *txr)
+{
+ int avail = txr->vxtxr_next - txr->vxtxr_head - 1;
+ return (avail < 0 ? txr->vxtxr_ndesc + avail : avail);
+}
struct vmxnet3_rxbuf {
bus_dmamap_t vrxb_dmamap;
@@ -116,6 +120,7 @@ struct vmxnet3_comp_ring {
struct vmxnet3_txq_stats {
uint64_t vtxrs_full;
+ uint64_t vtxrs_offload_failed;
};
@@ -166,8 +171,9 @@ struct vmxnet3_rxqueue {
mtx_assert(&(_rxq)->vxrxq_mtx, MA_NOTOWNED)
struct vmxnet3_statistics {
- uint64_t vmst_collapsed;
- uint64_t vmst_getcl_failed;
+ uint32_t vmst_collapsed;
+ uint32_t vmst_mgetcl_failed;
+ uint32_t vmst_mbuf_load_failed;
};
More information about the svn-src-projects
mailing list