MCPcopy Create free account
hub / github.com/F-Stack/f-stack / idpf_dev_stats_get

Function idpf_dev_stats_get

dpdk/drivers/net/idpf/idpf_ethdev.c:268–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268static int
269idpf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
270{
271 struct idpf_vport *vport =
272 (struct idpf_vport *)dev->data->dev_private;
273 struct virtchnl2_vport_stats *pstats = NULL;
274 int ret;
275
276 ret = idpf_vc_stats_query(vport, &pstats);
277 if (ret == 0) {
278 uint8_t crc_stats_len = (dev->data->dev_conf.rxmode.offloads &
279 RTE_ETH_RX_OFFLOAD_KEEP_CRC) ? 0 :
280 RTE_ETHER_CRC_LEN;
281
282 idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
283 stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
284 pstats->rx_broadcast;
285 stats->opackets = pstats->tx_broadcast + pstats->tx_multicast +
286 pstats->tx_unicast;
287 stats->ierrors = pstats->rx_errors;
288 stats->imissed = pstats->rx_discards;
289 stats->oerrors = pstats->tx_errors + pstats->tx_discards;
290 stats->ibytes = pstats->rx_bytes;
291 stats->ibytes -= stats->ipackets * crc_stats_len;
292 stats->obytes = pstats->tx_bytes;
293
294 dev->data->rx_mbuf_alloc_failed = idpf_get_mbuf_alloc_failed_stats(dev);
295 stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
296 } else {
297 PMD_DRV_LOG(ERR, "Get statistics failed");
298 }
299 return ret;
300}
301
302static void
303idpf_reset_mbuf_alloc_failed_stats(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 3

idpf_vc_stats_queryFunction · 0.85
idpf_vport_stats_updateFunction · 0.85

Tested by

no test coverage detected