net/ice: fix queue config in DCF
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.
--- drivers/net/ice/ice_dcf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ice/ice_dcf.c +3 -3
@@ -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
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.
---
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
@@ -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
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 DCFWhen DCF configures
rx_queues, it may cause the pointer ofrx_queuesto 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")Signed-off-by Jie Wang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi