.tx_burst_mode_get = bnxt_tx_burst_mode_get,
.dev_led_on = bnxt_dev_led_on_op,
.dev_led_off = bnxt_dev_led_off_op,
- .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op,
- .xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op,
.rx_queue_start = bnxt_rx_queue_start,
.rx_queue_stop = bnxt_rx_queue_stop,
.tx_queue_start = bnxt_tx_queue_start,
return ret;
}
-int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
- uint64_t *values, unsigned int limit)
-{
- struct bnxt *bp = dev->data->dev_private;
- const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +
- RTE_DIM(bnxt_tx_stats_strings) +
- RTE_DIM(bnxt_func_stats_strings) +
- RTE_DIM(bnxt_rx_ext_stats_strings) +
- RTE_DIM(bnxt_tx_ext_stats_strings) +
- bnxt_flow_stats_cnt(bp);
- struct rte_eth_xstat xstats[stat_cnt];
- uint64_t values_copy[stat_cnt];
- uint16_t i;
- int rc;
-
- rc = is_bnxt_in_error(bp);
- if (rc)
- return rc;
-
- if (!ids)
- return bnxt_dev_xstats_get_op(dev, xstats, stat_cnt);
-
- bnxt_dev_xstats_get_by_id_op(dev, NULL, values_copy, stat_cnt);
- for (i = 0; i < limit; i++) {
- if (ids[i] >= stat_cnt) {
- PMD_DRV_LOG(ERR, "id value isn't valid");
- return -EINVAL;
- }
- values[i] = values_copy[ids[i]];
- }
- return stat_cnt;
-}
-
-int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names,
- const uint64_t *ids, unsigned int limit)
-{
- struct bnxt *bp = dev->data->dev_private;
- const unsigned int stat_cnt = RTE_DIM(bnxt_rx_stats_strings) +
- RTE_DIM(bnxt_tx_stats_strings) +
- RTE_DIM(bnxt_func_stats_strings) +
- RTE_DIM(bnxt_rx_ext_stats_strings) +
- RTE_DIM(bnxt_tx_ext_stats_strings) +
- bnxt_flow_stats_cnt(bp);
- struct rte_eth_xstat_name xstats_names_copy[stat_cnt];
- uint16_t i;
- int rc;
-
- rc = is_bnxt_in_error(bp);
- if (rc)
- return rc;
-
- if (!ids)
- return bnxt_dev_xstats_get_names_op(dev, xstats_names,
- stat_cnt);
- bnxt_dev_xstats_get_names_by_id_op(dev, xstats_names_copy, NULL,
- stat_cnt);
-
- for (i = 0; i < limit; i++) {
- if (ids[i] >= stat_cnt) {
- PMD_DRV_LOG(ERR, "id value isn't valid");
- return -EINVAL;
- }
- strcpy(xstats_names[i].name,
- xstats_names_copy[ids[i]].name);
- }
- return stat_cnt;
-}
-
/* Update the input context memory with the flow counter IDs
* of the flows that we are interested in.
* Also, update the output tables with the current local values