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
drivers/net: build Intel NIC PMDs with meson
[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
fe83d37
..
bd93cc8
100644
(file)
--- a/
drivers/net/bnxt/bnxt_stats.c
+++ b/
drivers/net/bnxt/bnxt_stats.c
@@
-236,6
+236,10
@@
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
struct bnxt *bp = eth_dev->data->dev_private;
memset(bnxt_stats, 0, sizeof(*bnxt_stats));
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];
for (i = 0; i < bp->rx_cp_nr_rings; i++) {
struct bnxt_rx_queue *rxq = bp->rx_queues[i];
@@
-267,6
+271,11
@@
void bnxt_stats_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_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);
}
@@
-280,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;
}
@@
-358,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,
@@
-385,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]];
@@
-411,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,