git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bonding: fix library version in meson build
[dpdk.git]
/
drivers
/
net
/
bnxt
/
bnxt_stats.c
diff --git
a/drivers/net/bnxt/bnxt_stats.c
b/drivers/net/bnxt/bnxt_stats.c
index
87feac6
..
bd93cc8
100644
(file)
--- a/
drivers/net/bnxt/bnxt_stats.c
+++ b/
drivers/net/bnxt/bnxt_stats.c
@@
-228,37
+228,54
@@
void bnxt_free_stats(struct bnxt *bp)
}
}
}
}
-
void
bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
+
int
bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
struct rte_eth_stats *bnxt_stats)
{
struct rte_eth_stats *bnxt_stats)
{
+ int rc = 0;
unsigned int i;
struct bnxt *bp = eth_dev->data->dev_private;
memset(bnxt_stats, 0, sizeof(*bnxt_stats));
unsigned int i;
struct bnxt *bp = eth_dev->data->dev_private;
memset(bnxt_stats, 0, sizeof(*bnxt_stats));
+ if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
+ PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
+ return 0;
+ }
for (i = 0; i < bp->rx_cp_nr_rings; i++) {
struct bnxt_rx_queue *rxq = bp->rx_queues[i];
struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
for (i = 0; i < bp->rx_cp_nr_rings; i++) {
struct bnxt_rx_queue *rxq = bp->rx_queues[i];
struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
- bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i,
+
rc =
bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i,
bnxt_stats, 1);
bnxt_stats, 1);
+ if (unlikely(rc))
+ return rc;
}
for (i = 0; i < bp->tx_cp_nr_rings; i++) {
struct bnxt_tx_queue *txq = bp->tx_queues[i];
struct bnxt_cp_ring_info *cpr = txq->cp_ring;
}
for (i = 0; i < bp->tx_cp_nr_rings; i++) {
struct bnxt_tx_queue *txq = bp->tx_queues[i];
struct bnxt_cp_ring_info *cpr = txq->cp_ring;
- bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i,
+
rc =
bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i,
bnxt_stats, 0);
bnxt_stats, 0);
+ if (unlikely(rc))
+ return rc;
}
}
- bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats);
+ rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats);
+ if (unlikely(rc))
+ return rc;
bnxt_stats->rx_nombuf = rte_atomic64_read(&bp->rx_mbuf_alloc_fail);
bnxt_stats->rx_nombuf = rte_atomic64_read(&bp->rx_mbuf_alloc_fail);
+ return rc;
}
void bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
}
void bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+ if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
+ PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
+ return;
+ }
+
bnxt_clear_all_hwrm_stat_ctxs(bp);
rte_atomic64_clear(&bp->rx_mbuf_alloc_fail);
}
bnxt_clear_all_hwrm_stat_ctxs(bp);
rte_atomic64_clear(&bp->rx_mbuf_alloc_fail);
}
@@
-272,7
+289,7
@@
int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
uint64_t tx_drop_pkts;
if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
uint64_t tx_drop_pkts;
if (!(bp->flags & BNXT_FLAG_PORT_STATS)) {
-
RTE_LOG(ERR, PMD
, "xstats not supported for VF\n");
+
PMD_DRV_LOG(ERR
, "xstats not supported for VF\n");
return 0;
}
return 0;
}
@@
-350,15
+367,15
@@
void bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
- if (bp->flags & BNXT_FLAG_PORT_STATS &&
!BNXT_NPAR
_PF(bp))
+ if (bp->flags & BNXT_FLAG_PORT_STATS &&
BNXT_SINGLE
_PF(bp))
bnxt_hwrm_port_clr_stats(bp);
if (BNXT_VF(bp))
bnxt_hwrm_port_clr_stats(bp);
if (BNXT_VF(bp))
-
RTE_LOG(ERR, PMD
, "Operation not supported on a VF device\n");
- if (
BNXT_NPAR
_PF(bp))
-
RTE_LOG(ERR, PMD
, "Operation not supported on a MF device\n");
+
PMD_DRV_LOG(ERR
, "Operation not supported on a VF device\n");
+ if (
!BNXT_SINGLE
_PF(bp))
+
PMD_DRV_LOG(ERR
, "Operation not supported on a MF device\n");
if (!(bp->flags & BNXT_FLAG_PORT_STATS))
if (!(bp->flags & BNXT_FLAG_PORT_STATS))
-
RTE_LOG(ERR, PMD
, "Operation not supported\n");
+
PMD_DRV_LOG(ERR
, "Operation not supported\n");
}
int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
}
int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
@@
-377,7
+394,7
@@
int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids,
bnxt_dev_xstats_get_by_id_op(dev, NULL, values_copy, stat_cnt);
for (i = 0; i < limit; i++) {
if (ids[i] >= 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) {
-
RTE_LOG(ERR, PMD
, "id value isn't valid");
+
PMD_DRV_LOG(ERR
, "id value isn't valid");
return -1;
}
values[i] = values_copy[ids[i]];
return -1;
}
values[i] = values_copy[ids[i]];
@@
-403,7
+420,7
@@
int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev,
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
for (i = 0; i < limit; i++) {
if (ids[i] >= stat_cnt) {
-
RTE_LOG(ERR, PMD
, "id value isn't valid");
+
PMD_DRV_LOG(ERR
, "id value isn't valid");
return -1;
}
strcpy(xstats_names[i].name,
return -1;
}
strcpy(xstats_names[i].name,