From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
chaoyong.he@corigine.com, stable@dpdk.org
Subject: [PATCH 2/2] net/nfp: fix control message over flow problem
Date: Mon, 14 Apr 2025 14:02:27 +0800 [thread overview]
Message-ID: <20250414060227.1251817-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20250414060227.1251817-1-chaoyong.he@corigine.com>
From: Long Wu <long.wu@corigine.com>
Control message will send 32 bits data every time, so the number
of write operations should be adjust correctly, or there will be
over flow problem.
Fixes: ca65f2eef224 ("net/nfp: add control message channel")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_net_cmsg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_net_cmsg.c b/drivers/net/nfp/nfp_net_cmsg.c
index 8f77c5588a..1ebd66bb0f 100644
--- a/drivers/net/nfp/nfp_net_cmsg.c
+++ b/drivers/net/nfp/nfp_net_cmsg.c
@@ -36,8 +36,9 @@ nfp_net_cmsg_xmit(struct nfp_net_hw *hw,
{
int ret;
uint32_t i;
+ uint32_t data_num = msg_size / sizeof(uint32_t);
- for (i = 0; i < msg_size; i++)
+ for (i = 0; i < data_num; i++)
nn_cfg_writel(&hw->super, NFP_NET_CFG_MBOX_VAL + 4 * i, *((uint32_t *)cmsg + i));
ret = nfp_net_mbox_reconfig(hw, NFP_NET_CFG_MBOX_CMD_FLOW_STEER);
--
2.43.5
prev parent reply other threads:[~2025-04-14 6:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 6:02 [PATCH 0/2] fix two nfp pmd bugs Chaoyong He
2025-04-14 6:02 ` [PATCH 1/2] net/nfp: fix flow rule free problem Chaoyong He
2025-04-14 6:02 ` Chaoyong He [this message]
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=20250414060227.1251817-3-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=long.wu@corigine.com \
--cc=oss-drivers@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).