| 1583 | } |
| 1584 | |
| 1585 | static int ice_dcf_xstats_get(struct rte_eth_dev *dev, |
| 1586 | struct rte_eth_xstat *xstats, unsigned int n) |
| 1587 | { |
| 1588 | int ret; |
| 1589 | unsigned int i; |
| 1590 | struct ice_dcf_adapter *adapter = |
| 1591 | ICE_DCF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); |
| 1592 | struct ice_dcf_hw *hw = &adapter->real_hw; |
| 1593 | struct virtchnl_eth_stats *postats = &hw->eth_stats_offset; |
| 1594 | struct virtchnl_eth_stats pnstats; |
| 1595 | |
| 1596 | if (n < ICE_DCF_NB_XSTATS) |
| 1597 | return ICE_DCF_NB_XSTATS; |
| 1598 | |
| 1599 | ret = ice_dcf_query_stats(hw, &pnstats); |
| 1600 | if (ret != 0) |
| 1601 | return 0; |
| 1602 | |
| 1603 | if (!xstats) |
| 1604 | return 0; |
| 1605 | |
| 1606 | ice_dcf_update_stats(postats, &pnstats); |
| 1607 | |
| 1608 | /* loop over xstats array and values from pstats */ |
| 1609 | for (i = 0; i < ICE_DCF_NB_XSTATS; i++) { |
| 1610 | xstats[i].id = i; |
| 1611 | xstats[i].value = *(uint64_t *)(((char *)&pnstats) + |
| 1612 | rte_ice_dcf_stats_strings[i].offset); |
| 1613 | } |
| 1614 | |
| 1615 | return ICE_DCF_NB_XSTATS; |
| 1616 | } |
| 1617 | |
| 1618 | static void |
| 1619 | ice_dcf_free_repr_info(struct ice_dcf_adapter *dcf_adapter) |
nothing calls this directly
no test coverage detected