Skip to contentSkip to conversation

net/mana: fix counter overflow for posted WQE

PATCH Superseded [email protected] 2 participants 3 messages Jul 10, 2023 – Jul 11, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mana: fix counter overflow for posted WQE

From: Long Li <[email protected]>

This counter should set to uint16_t, the same type as pkt_received. Otherwise, it may overflow when pkt_received goes over 256.

Thanks Xinhao Kong <[email protected]> for debugging.

Fixes 517ed6e2d590 ("net/mana: add basic driver with build environment")
---
 drivers/net/mana/rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mana/rx.c +1 -1
index 1047ac1743..b840e402f9 100644
@@ -399,7 +399,7 @@ uint16_t
 mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 {
 	uint16_t pkt_received = 0;
-	uint8_t wqe_posted = 0;
+	uint16_t wqe_posted = 0;
 	struct mana_rxq *rxq = dpdk_rxq;
 	struct mana_priv *priv = rxq->priv;
 	struct rte_mbuf *mbuf;
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/1 net/mana: fix counter overflow for posted WQE

From: Long Li <[email protected]>

This counter should set to uint16_t, the same type as pkt_received. Otherwise, it may overflow when pkt_received goes over 256.

Thanks Xinhao Kong <[email protected]> for debugging this.

Fixes 517ed6e2d590 ("net/mana: add basic driver with build environment")

---
Change log:
v2: added "Signed-off-by"

 drivers/net/mana/rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mana/rx.c +1 -1
index 1047ac1743..b840e402f9 100644
@@ -399,7 +399,7 @@ uint16_t
 mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 {
 	uint16_t pkt_received = 0;
-	uint8_t wqe_posted = 0;
+	uint16_t wqe_posted = 0;
 	struct mana_rxq *rxq = dpdk_rxq;
 	struct mana_priv *priv = rxq->priv;
 	struct rte_mbuf *mbuf;
Signature · 1 line
2.34.1
Applied
#2 lore raw
Quoted 5 lines · On 7/11/2023 12:51 AM, [email protected] wrote:

From: Long Li <[email protected]>

This counter should set to uint16_t, the same type as pkt_received. Otherwise, it may overflow when pkt_received goes over 256.

Quoted 7 lines

Thanks Xinhao Kong <[email protected]> for debugging this.

Fixes 517ed6e2d590 ("net/mana: add basic driver with build environment")

Applied to dpdk-next-net/main, thanks.