+#define RTE_VERSION_16_07 RTE_VERSION_NUM(16, 7, 0, 16)
+
+#if RTE_VERSION < RTE_VERSION_16_07
+#define DPDK_STATS_XSTAT_GET_VALUE(ctx, index) ctx->xstats[index].value
+#define DPDK_STATS_XSTAT_GET_NAME(ctx, index) ctx->xstats[index].name
+#define DPDK_STATS_CTX_GET_XSTAT_SIZE sizeof(struct rte_eth_xstats)
+#define DPDK_STATS_CTX_INIT(ctx) \
+ do { \
+ ctx->xstats = (struct rte_eth_xstats *)&ctx->raw_data[0]; \
+ } while (0)
+#else
+#define DPDK_STATS_XSTAT_GET_VALUE(ctx, index) ctx->xstats[index].value
+#define DPDK_STATS_XSTAT_GET_NAME(ctx, index) ctx->xnames[index].name
+#define DPDK_STATS_CTX_GET_XSTAT_SIZE \
+ (sizeof(struct rte_eth_xstat) + sizeof(struct rte_eth_xstat_name))
+#define DPDK_STATS_CTX_INIT(ctx) \
+ do { \
+ ctx->xstats = (struct rte_eth_xstat *)&ctx->raw_data[0]; \
+ ctx->xnames = \
+ (struct rte_eth_xstat_name *)&ctx \
+ ->raw_data[ctx->num_xstats * sizeof(struct rte_eth_xstat)]; \
+ } while (0)
+#endif
+