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

Function ice_dcf_stats_get

dpdk/drivers/net/ice/ice_dcf_ethdev.c:1516–1546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1514
1515
1516static int
1517ice_dcf_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
1518{
1519 struct ice_dcf_adapter *ad = dev->data->dev_private;
1520 struct ice_dcf_hw *hw = &ad->real_hw;
1521 struct virtchnl_eth_stats pstats;
1522 int ret;
1523
1524 if (hw->resetting) {
1525 PMD_DRV_LOG(ERR,
1526 "The DCF has been reset by PF, please reinit first");
1527 return -EIO;
1528 }
1529
1530 ret = ice_dcf_query_stats(hw, &pstats);
1531 if (ret == 0) {
1532 ice_dcf_update_stats(&hw->eth_stats_offset, &pstats);
1533 stats->ipackets = pstats.rx_unicast + pstats.rx_multicast +
1534 pstats.rx_broadcast - pstats.rx_discards;
1535 stats->opackets = pstats.tx_broadcast + pstats.tx_multicast +
1536 pstats.tx_unicast;
1537 stats->imissed = pstats.rx_discards;
1538 stats->oerrors = pstats.tx_errors + pstats.tx_discards;
1539 stats->ibytes = pstats.rx_bytes;
1540 stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
1541 stats->obytes = pstats.tx_bytes;
1542 } else {
1543 PMD_DRV_LOG(ERR, "Get statistics failed");
1544 }
1545 return ret;
1546}
1547
1548static int
1549ice_dcf_stats_reset(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 2

ice_dcf_query_statsFunction · 0.85
ice_dcf_update_statsFunction · 0.85

Tested by

no test coverage detected