Skip to contentSkip to conversation

net/netvsc: fix rndis packet addresses

PATCH Applied Long Li 4 participants 6 messages Sep 18, 2020 – Sep 21, 2020 Network drivers

lore
Share & tools
lore

Long Li

author
#0 lore raw

PATCH 1/1 net/netvsc: fix rndis packet addresses

From: Long Li <[email protected]>

The address should be calculated before type cast, not after.

Fixes cc02518 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +2 -2
index 813f8c3cc..70f8b8332 100644
@@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused,
 
 	txd->queue_id = txq->queue_id;
 	txd->chim_index = NVS_CHIM_IDX_INVALID;
-	txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis
-		+ idx * HN_RNDIS_PKT_ALIGNED;
+	txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis
+		+ idx * HN_RNDIS_PKT_ALIGNED);
 }
 
 int
Signature · 1 line
2.25.1
#2 lore raw
In reply to Long Li
Quoted 4 lines · Long Li

From: Long Li <[email protected]>

The address should be calculated before type cast, not after.

This is being requested for 18.11.10 as it is fixing a reported regression introduced in 18.11.9.

If netvsc maintainers agree and it is merged in DPDK mainline this week, I can take it into 18.11.10, otherwise it will be for 18.11.11.

Souvik, maybe you can give tested-by tags?

Quoted 25 lines
Fixes cc02518 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +2 -2
index 813f8c3cc..70f8b8332 100644
@@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused,
 
 	txd->queue_id = txq->queue_id;
 	txd->chim_index = NVS_CHIM_IDX_INVALID;
-	txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis
-		+ idx * HN_RNDIS_PKT_ALIGNED;
+	txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis
+		+ idx * HN_RNDIS_PKT_ALIGNED);
 }
 
 int
#3 lore raw

+fixed Souvik email

Quoted 39 lines · Kevin Traynor
Quoted 4 lines · Long Li

From: Long Li <[email protected]>

The address should be calculated before type cast, not after.

This is being requested for 18.11.10 as it is fixing a reported regression introduced in 18.11.9.

If netvsc maintainers agree and it is merged in DPDK mainline this week, I can take it into 18.11.10, otherwise it will be for 18.11.11.

Souvik, maybe you can give tested-by tags?

Quoted 25 lines
Fixes cc02518 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +2 -2
index 813f8c3cc..70f8b8332 100644
@@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused,
 
 	txd->queue_id = txq->queue_id;
 	txd->chim_index = NVS_CHIM_IDX_INVALID;
-	txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis
-		+ idx * HN_RNDIS_PKT_ALIGNED;
+	txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis
+		+ idx * HN_RNDIS_PKT_ALIGNED);
 }
 
 int
#4 lore raw
In reply to Kevin Traynor
Quoted 6 lines · Kevin Traynor
Quoted 4 lines · Long Li

From: Long Li <[email protected]>

The address should be calculated before type cast, not after.

Quoted 8 lines

This is being requested for 18.11.10 as it is fixing a reported regression introduced in 18.11.9.

If netvsc maintainers agree and it is merged in DPDK mainline this week, I can take it into 18.11.10, otherwise it will be for 18.11.11.

Souvik, maybe you can give tested-by tags?

Ah, already applied to next-net, Ferruh is fast.

Stephen/Long - I will assume you ack this for 18.11.10 (normally it would be 18.11.11 after 20.11 release). Please let me know if any doubt.

Quoted 26 lines
Quoted 25 lines
Fixes cc02518 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +2 -2
index 813f8c3cc..70f8b8332 100644
@@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused,
 
 	txd->queue_id = txq->queue_id;
 	txd->chim_index = NVS_CHIM_IDX_INVALID;
-	txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis
-		+ idx * HN_RNDIS_PKT_ALIGNED;
+	txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis
+		+ idx * HN_RNDIS_PKT_ALIGNED);
 }
 
 int
#5 lore raw
Quoted 13 lines · Kevin Traynor
Quoted 12 lines · Long Li
Quoted 4 lines

From: Long Li <[email protected]>

The address should be calculated before type cast, not after.

This is being requested for 18.11.10 as it is fixing a reported regression introduced in 18.11.9.

If netvsc maintainers agree and it is merged in DPDK mainline this week, I can take it into 18.11.10, otherwise it will be for 18.11.11.

Quoted 7 lines
Quoted 2 lines

Souvik, maybe you can give tested-by tags?

Ah, already applied to next-net, Ferruh is fast.

Stephen/Long - I will assume you ack this for 18.11.10 (normally it would be 18.11.11 after 20.11 release). Please let me know if any doubt.

Yes, please get this patch in 18.11.10.

Quoted 28 lines
Quoted 28 lines
Quoted 27 lines
Fixes cc02518 ("net/netvsc: split send buffers from Tx descriptors")
---
 drivers/net/netvsc/hn_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/netvsc/hn_rxtx.c index 813f8c3cc..70f8b8332 100644

drivers/net/netvsc/hn_rxtx.c +2 -2
@@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp
 __rte_unused,
 
 	txd->queue_id = txq->queue_id;
 	txd->chim_index = NVS_CHIM_IDX_INVALID;
-	txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis
-		+ idx * HN_RNDIS_PKT_ALIGNED;
+	txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis
+		+ idx * HN_RNDIS_PKT_ALIGNED);
 }
 

int