* DPDK callback to retrieve names of extended device statistics * * @param dev * Pointer to Ethernet device structure. * @param[out] xstats_names * Buffer to insert names into. * @param n * Number of names. * * @return * Number of xstats names. */
| 3295 | * Number of xstats names. |
| 3296 | */ |
| 3297 | static int ena_xstats_get_names(struct rte_eth_dev *dev, |
| 3298 | struct rte_eth_xstat_name *xstats_names, |
| 3299 | unsigned int n) |
| 3300 | { |
| 3301 | struct ena_adapter *adapter = dev->data->dev_private; |
| 3302 | unsigned int xstats_count = ena_xstats_calc_num(dev->data); |
| 3303 | unsigned int stat, i, count = 0; |
| 3304 | |
| 3305 | if (n < xstats_count || !xstats_names) |
| 3306 | return xstats_count; |
| 3307 | |
| 3308 | for (stat = 0; stat < ENA_STATS_ARRAY_GLOBAL; stat++, count++) |
| 3309 | strcpy(xstats_names[count].name, |
| 3310 | ena_stats_global_strings[stat].name); |
| 3311 | |
| 3312 | for (stat = 0; stat < adapter->metrics_num; stat++, count++) |
| 3313 | rte_strscpy(xstats_names[count].name, |
| 3314 | ena_stats_metrics_strings[stat].name, |
| 3315 | RTE_ETH_XSTATS_NAME_SIZE); |
| 3316 | for (stat = 0; stat < ENA_STATS_ARRAY_ENA_SRD; stat++, count++) |
| 3317 | rte_strscpy(xstats_names[count].name, |
| 3318 | ena_stats_srd_strings[stat].name, |
| 3319 | RTE_ETH_XSTATS_NAME_SIZE); |
| 3320 | |
| 3321 | for (stat = 0; stat < ENA_STATS_ARRAY_RX; stat++) |
| 3322 | for (i = 0; i < dev->data->nb_rx_queues; i++, count++) |
| 3323 | snprintf(xstats_names[count].name, |
| 3324 | sizeof(xstats_names[count].name), |
| 3325 | "rx_q%d_%s", i, |
| 3326 | ena_stats_rx_strings[stat].name); |
| 3327 | |
| 3328 | for (stat = 0; stat < ENA_STATS_ARRAY_TX; stat++) |
| 3329 | for (i = 0; i < dev->data->nb_tx_queues; i++, count++) |
| 3330 | snprintf(xstats_names[count].name, |
| 3331 | sizeof(xstats_names[count].name), |
| 3332 | "tx_q%d_%s", i, |
| 3333 | ena_stats_tx_strings[stat].name); |
| 3334 | |
| 3335 | return xstats_count; |
| 3336 | } |
| 3337 | |
| 3338 | /** |
| 3339 | * DPDK callback to retrieve names of extended device statistics for the given |
nothing calls this directly
no test coverage detected