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

Function __fs_xstats_get

dpdk/drivers/net/failsafe/failsafe_ops.c:1038–1075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036}
1037
1038static int
1039__fs_xstats_get(struct rte_eth_dev *dev,
1040 struct rte_eth_xstat *xstats,
1041 unsigned int n)
1042{
1043 unsigned int count = 0;
1044 struct sub_device *sdev;
1045 uint8_t i;
1046 int j, ret;
1047
1048 ret = __fs_xstats_count(dev);
1049 /*
1050 * if error
1051 * or caller did not give enough space
1052 * or just querying
1053 */
1054 if (ret < 0 || ret > (int)n || xstats == NULL)
1055 return ret;
1056
1057 FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
1058 ret = rte_eth_xstats_get(PORT_ID(sdev), xstats, n);
1059 if (ret < 0)
1060 return ret;
1061
1062 if (ret > (int)n)
1063 return n + count;
1064
1065 /* add offset to id's from sub-device */
1066 for (j = 0; j < ret; j++)
1067 xstats[j].id += count;
1068
1069 xstats += ret;
1070 n -= ret;
1071 count += ret;
1072 }
1073
1074 return count;
1075}
1076
1077static int
1078fs_xstats_get(struct rte_eth_dev *dev,

Callers 1

fs_xstats_getFunction · 0.85

Calls 3

__fs_xstats_countFunction · 0.85
FOREACH_SUBDEV_STATEFunction · 0.85
rte_eth_xstats_getFunction · 0.85

Tested by

no test coverage detected