memset(bnxt_stats, 0, sizeof(*bnxt_stats));
if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
- return -1;
+ return -EIO;
}
num_q_stats = RTE_MIN(bp->rx_cp_nr_rings,
if (unlikely(rc))
return rc;
}
+
rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats);
- if (unlikely(rc))
- return rc;
return rc;
}
if (ret)
return ret;
- if (bp->flags & BNXT_FLAG_PORT_STATS && BNXT_SINGLE_PF(bp)) {
- ret = bnxt_hwrm_port_clr_stats(bp);
- if (ret != 0) {
- PMD_DRV_LOG(ERR, "Operation failed: %s\n",
- strerror(-ret));
- return ret;
- }
- }
-
- ret = 0;
-
- if (BNXT_VF(bp)) {
- PMD_DRV_LOG(ERR, "Operation not supported on a VF device\n");
- ret = -ENOTSUP;
- }
- if (!BNXT_SINGLE_PF(bp)) {
- PMD_DRV_LOG(ERR, "Operation not supported on a MF device\n");
- ret = -ENOTSUP;
- }
- if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
+ if (BNXT_VF(bp) || !BNXT_SINGLE_PF(bp) ||
+ !(bp->flags & BNXT_FLAG_PORT_STATS)) {
PMD_DRV_LOG(ERR, "Operation not supported\n");
ret = -ENOTSUP;
}
+ ret = bnxt_hwrm_port_clr_stats(bp);
+ if (ret != 0)
+ PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n",
+ strerror(-ret));
+
return ret;
}
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
PMD_DRV_LOG(ERR, "id value isn't valid");
- return -1;
+ return -EINVAL;
}
values[i] = values_copy[ids[i]];
}
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
PMD_DRV_LOG(ERR, "id value isn't valid");
- return -1;
+ return -EINVAL;
}
strcpy(xstats_names[i].name,
xstats_names_copy[ids[i]].name);