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

Function ice_dcf_xstats_get

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

Source from the content-addressed store, hash-verified

1583}
1584
1585static 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
1618static void
1619ice_dcf_free_repr_info(struct ice_dcf_adapter *dcf_adapter)

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