| 1514 | |
| 1515 | |
| 1516 | static int |
| 1517 | ice_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 | |
| 1548 | static int |
| 1549 | ice_dcf_stats_reset(struct rte_eth_dev *dev) |
nothing calls this directly
no test coverage detected