|
Lines 156-176
static int xn_get_responses(struct netfront_rxq *,
Link Here
|
| 156 |
#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) |
156 |
#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) |
| 157 |
|
157 |
|
| 158 |
#define INVALID_P2M_ENTRY (~0UL) |
158 |
#define INVALID_P2M_ENTRY (~0UL) |
| 159 |
|
|
|
| 160 |
struct xn_rx_stats |
| 161 |
{ |
| 162 |
u_long rx_packets; /* total packets received */ |
| 163 |
u_long rx_bytes; /* total bytes received */ |
| 164 |
u_long rx_errors; /* bad packets received */ |
| 165 |
}; |
| 166 |
|
| 167 |
struct xn_tx_stats |
| 168 |
{ |
| 169 |
u_long tx_packets; /* total packets transmitted */ |
| 170 |
u_long tx_bytes; /* total bytes transmitted */ |
| 171 |
u_long tx_errors; /* packet transmit problems */ |
| 172 |
}; |
| 173 |
|
| 174 |
#define XN_QUEUE_NAME_LEN 8 /* xn{t,r}x_%u, allow for two digits */ |
159 |
#define XN_QUEUE_NAME_LEN 8 /* xn{t,r}x_%u, allow for two digits */ |
| 175 |
struct netfront_rxq { |
160 |
struct netfront_rxq { |
| 176 |
struct netfront_info *info; |
161 |
struct netfront_info *info; |
|
Lines 190-197
struct netfront_rxq {
Link Here
|
| 190 |
struct lro_ctrl lro; |
175 |
struct lro_ctrl lro; |
| 191 |
|
176 |
|
| 192 |
struct callout rx_refill; |
177 |
struct callout rx_refill; |
| 193 |
|
|
|
| 194 |
struct xn_rx_stats stats; |
| 195 |
}; |
178 |
}; |
| 196 |
|
179 |
|
| 197 |
struct netfront_txq { |
180 |
struct netfront_txq { |
|
Lines 215-222
struct netfront_txq {
Link Here
|
| 215 |
struct task defrtask; |
198 |
struct task defrtask; |
| 216 |
|
199 |
|
| 217 |
bool full; |
200 |
bool full; |
| 218 |
|
|
|
| 219 |
struct xn_tx_stats stats; |
| 220 |
}; |
201 |
}; |
| 221 |
|
202 |
|
| 222 |
struct netfront_info { |
203 |
struct netfront_info { |
|
Lines 1191-1197
xn_rxeof(struct netfront_rxq *rxq)
Link Here
|
| 1191 |
if (__predict_false(err)) { |
1172 |
if (__predict_false(err)) { |
| 1192 |
if (m) |
1173 |
if (m) |
| 1193 |
(void )mbufq_enqueue(&mbufq_errq, m); |
1174 |
(void )mbufq_enqueue(&mbufq_errq, m); |
| 1194 |
rxq->stats.rx_errors++; |
1175 |
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); |
| 1195 |
continue; |
1176 |
continue; |
| 1196 |
} |
1177 |
} |
| 1197 |
|
1178 |
|
|
Lines 1216-1224
xn_rxeof(struct netfront_rxq *rxq)
Link Here
|
| 1216 |
m->m_pkthdr.csum_flags |= CSUM_TSO; |
1197 |
m->m_pkthdr.csum_flags |= CSUM_TSO; |
| 1217 |
} |
1198 |
} |
| 1218 |
|
1199 |
|
| 1219 |
rxq->stats.rx_packets++; |
|
|
| 1220 |
rxq->stats.rx_bytes += m->m_pkthdr.len; |
| 1221 |
|
| 1222 |
(void )mbufq_enqueue(&mbufq_rxq, m); |
1200 |
(void )mbufq_enqueue(&mbufq_rxq, m); |
| 1223 |
rxq->ring.rsp_cons = i; |
1201 |
rxq->ring.rsp_cons = i; |
| 1224 |
} |
1202 |
} |
|
Lines 1703-1710
xn_assemble_tx_request(struct netfront_txq *txq, struct mbuf *m_head)
Link Here
|
| 1703 |
|
1681 |
|
| 1704 |
xn_txeof(txq); |
1682 |
xn_txeof(txq); |
| 1705 |
|
1683 |
|
| 1706 |
txq->stats.tx_bytes += m_head->m_pkthdr.len; |
1684 |
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); |
| 1707 |
txq->stats.tx_packets++; |
1685 |
if_inc_counter(ifp, IFCOUNTER_OBYTES, m_head->m_pkthdr.len); |
|
|
1686 |
if (m_head->m_flags & M_MCAST) |
| 1687 |
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); |
| 1708 |
|
1688 |
|
| 1709 |
return (0); |
1689 |
return (0); |
| 1710 |
} |
1690 |
} |