FreeBSD Bugzilla – Attachment 175696 Details for
Bug 213439
ifOutOctets are always zero for Xen xn interfaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch (untested)
xen.diff (text/plain), 2.43 KB, created by
Andrey V. Elsukov
on 2016-10-13 11:09:38 UTC
(
hide
)
Description:
Proposed patch (untested)
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2016-10-13 11:09:38 UTC
Size:
2.43 KB
patch
obsolete
>diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c >index a68bc96..3c080ef 100644 >--- a/sys/dev/xen/netfront/netfront.c >+++ b/sys/dev/xen/netfront/netfront.c >@@ -156,21 +156,6 @@ static int xn_get_responses(struct netfront_rxq *, > #define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) > > #define INVALID_P2M_ENTRY (~0UL) >- >-struct xn_rx_stats >-{ >- u_long rx_packets; /* total packets received */ >- u_long rx_bytes; /* total bytes received */ >- u_long rx_errors; /* bad packets received */ >-}; >- >-struct xn_tx_stats >-{ >- u_long tx_packets; /* total packets transmitted */ >- u_long tx_bytes; /* total bytes transmitted */ >- u_long tx_errors; /* packet transmit problems */ >-}; >- > #define XN_QUEUE_NAME_LEN 8 /* xn{t,r}x_%u, allow for two digits */ > struct netfront_rxq { > struct netfront_info *info; >@@ -190,8 +175,6 @@ struct netfront_rxq { > struct lro_ctrl lro; > > struct callout rx_refill; >- >- struct xn_rx_stats stats; > }; > > struct netfront_txq { >@@ -215,8 +198,6 @@ struct netfront_txq { > struct task defrtask; > > bool full; >- >- struct xn_tx_stats stats; > }; > > struct netfront_info { >@@ -1191,7 +1172,7 @@ xn_rxeof(struct netfront_rxq *rxq) > if (__predict_false(err)) { > if (m) > (void )mbufq_enqueue(&mbufq_errq, m); >- rxq->stats.rx_errors++; >+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); > continue; > } > >@@ -1216,9 +1197,6 @@ xn_rxeof(struct netfront_rxq *rxq) > m->m_pkthdr.csum_flags |= CSUM_TSO; > } > >- rxq->stats.rx_packets++; >- rxq->stats.rx_bytes += m->m_pkthdr.len; >- > (void )mbufq_enqueue(&mbufq_rxq, m); > rxq->ring.rsp_cons = i; > } >@@ -1304,12 +1282,6 @@ xn_txeof(struct netfront_txq *txq) > "trying to free it again!")); > M_ASSERTVALID(m); > >- /* >- * Increment packet count if this is the last >- * mbuf of the chain. >- */ >- if (!m->m_next) >- if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > if (__predict_false(gnttab_query_foreign_access( > txq->grant_ref[id]) != 0)) { > panic("%s: grant id %u still in use by the " >@@ -1701,10 +1673,12 @@ xn_assemble_tx_request(struct netfront_txq *txq, struct mbuf *m_head) > } > BPF_MTAP(ifp, m_head); > >- xn_txeof(txq); >+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); >+ if_inc_counter(ifp, IFCOUNTER_OBYTES, m_head->m_pkthdr.len); >+ if (m_head->m_flags & M_MCAST) >+ if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); > >- txq->stats.tx_bytes += m_head->m_pkthdr.len; >- txq->stats.tx_packets++; >+ xn_txeof(txq); > > return (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 213439
:
175694
| 175696