Skip to contentSkip to conversation

net/ice: fix queue config in DCF

PATCH Superseded Jie Wang 2 participants 3 messages Aug 20, 2021 – Aug 29, 2021 Network drivers

lore
Share & tools
lore

Jie Wang

author
#0 lore raw

PATCH 1/1 net/ice: fix queue config in DCF

When DCF configures rx_queues, it may cause the pointer of rx_queues to go out of bounds.

This patch expands the scope of the judgment condition to fix this issue.

Fixes 4b0d391f0eab ("net/ice: add queue config in DCF")
---
 drivers/net/ice/ice_dcf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +3 -3
index 4c2e0c7216..45820a0a82 100644
@@ -880,13 +880,13 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)
 			vc_qp->txq.ring_len = txq[i]->nb_tx_desc;
 			vc_qp->txq.dma_ring_addr = txq[i]->tx_ring_dma;
 		}
-		vc_qp->rxq.vsi_id = hw->vsi_res->vsi_id;
-		vc_qp->rxq.queue_id = i;
-		vc_qp->rxq.max_pkt_size = rxq[i]->max_pkt_len;
 
 		if (i >= hw->eth_dev->data->nb_rx_queues)
 			continue;
 
+		vc_qp->rxq.vsi_id = hw->vsi_res->vsi_id;
+		vc_qp->rxq.queue_id = i;
+		vc_qp->rxq.max_pkt_size = rxq[i]->max_pkt_len;
 		vc_qp->rxq.ring_len = rxq[i]->nb_rx_desc;
 		vc_qp->rxq.dma_ring_addr = rxq[i]->rx_ring_dma;
 		vc_qp->rxq.databuffer_size = rxq[i]->rx_buf_len;
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v2 1/1 net/ice: fix queue config in DCF

When DCF configures rx_queues, it may cause the pointer of rx_queues to go out of bounds.

This patch expands the scope of the judgment condition to fix this issue.

Fixes 4b0d391f0eab ("net/ice: add queue config in DCF")

---
v2: assign values to rxq.vsi_id and rxq.queue_id, ensure rxq.vsi_id is equal to txq.vsi_id and rxq.queue_id is equal to txq.queue_id.

---
 drivers/net/ice/ice_dcf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ice/ice_dcf.c +1 -1
index 4c2e0c7216..a68b355cb8 100644
@@ -882,11 +882,11 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)
 		}
 		vc_qp->rxq.vsi_id = hw->vsi_res->vsi_id;
 		vc_qp->rxq.queue_id = i;
-		vc_qp->rxq.max_pkt_size = rxq[i]->max_pkt_len;
 
 		if (i >= hw->eth_dev->data->nb_rx_queues)
 			continue;
 
+		vc_qp->rxq.max_pkt_size = rxq[i]->max_pkt_len;
 		vc_qp->rxq.ring_len = rxq[i]->nb_rx_desc;
 		vc_qp->rxq.dma_ring_addr = rxq[i]->rx_ring_dma;
 		vc_qp->rxq.databuffer_size = rxq[i]->rx_buf_len;
Signature · 1 line
2.25.1
Acked-by on v2 1/1 Applied
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Wang, Jie1X <[email protected]>
Sent: Tuesday, August 24, 2021 11:13 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Wang, Jie1X <[email protected]>; [email protected]
Subject: [PATCH v2] net/ice: fix queue config in DCF

When DCF configures rx_queues, it may cause the pointer of rx_queues to go out of bounds.

Quoted 6 lines

This patch expands the scope of the judgment condition to fix this issue.

Fixes 4b0d391f0eab ("net/ice: add queue config in DCF")

Applied to dpdk-next-net-intel.

Thanks
Qi