[PATCH 2/2] net/nfp: fix control message over flow problem
Chaoyong He
chaoyong.he at corigine.com
Mon Apr 14 08:02:27 CEST 2025
From: Long Wu <long.wu at 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 at corigine.com
Cc: stable at dpdk.org
Signed-off-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at 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
More information about the dev
mailing list