From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com,
James Hershaw <james.hershaw@corigine.com>,
stable@dpdk.org, Peng Zhang <peng.zhang@corigine.com>,
Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH] net/nfp: update incorrect MAC stats offset
Date: Tue, 10 Oct 2023 14:09:53 +0800 [thread overview]
Message-ID: <20231010060953.205806-1-chaoyong.he@corigine.com> (raw)
From: James Hershaw <james.hershaw@corigine.com>
The pointer to the beginning of the MAC stats counters for port 1 are
incorrectly set as the pointer to the beginning of the port 0 MAC stats
counters, plus the size of the MAC stats counters multiplied by the port
number.
This patch corrects this by setting the multiplier as the eth_table
index of the port.
Fixes: f26e82397f6d ("net/nfp: implement xstats")
Cc: stable@dpdk.org
Signed-off-by: James Hershaw <james.hershaw@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index ebc5538291..0645123c99 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -547,7 +547,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
return -ENODEV;
/* Use port offset in pf ctrl_bar for this ports control bar */
hw->ctrl_bar = pf_dev->ctrl_bar + (port * NFP_PF_CSR_SLICE_SIZE);
- hw->mac_stats = app_fw_nic->ports[0]->mac_stats_bar + (port * NFP_MAC_STATS_SIZE);
+ hw->mac_stats = app_fw_nic->ports[0]->mac_stats_bar +
+ (hw->nfp_idx * NFP_MAC_STATS_SIZE);
}
PMD_INIT_LOG(DEBUG, "ctrl bar: %p", hw->ctrl_bar);
--
2.39.1
next reply other threads:[~2023-10-10 6:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 6:09 Chaoyong He [this message]
2023-10-16 13:25 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231010060953.205806-1-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=james.hershaw@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=peng.zhang@corigine.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).