From 22e294e0e664263caa152b701e24e315cdafae48 Mon Sep 17 00:00:00 2001 From: Jeff Guo Date: Mon, 9 Nov 2020 14:05:17 +0800 Subject: [PATCH] net/iavf: fix RXDID configure When configure Rx queue by virtchnnl, the RXDID (Rx Descriptor ID) should be configured only if the Rx queue has been set up. Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") Signed-off-by: Jeff Guo Tested-by: Yingya Han Acked-by: Qi Zhang --- drivers/net/iavf/iavf_vchnl.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 64d194670b..33d03af653 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -833,20 +833,24 @@ iavf_configure_queues(struct iavf_adapter *adapter, i++, vc_qp++) { vc_qp->txq.vsi_id = vf->vsi_res->vsi_id; vc_qp->txq.queue_id = i; - /* Virtchnnl configure queues by pairs */ + + /* Virtchnnl configure tx queues by pairs */ if (i < adapter->eth_dev->data->nb_tx_queues) { vc_qp->txq.ring_len = txq[i]->nb_tx_desc; vc_qp->txq.dma_ring_addr = txq[i]->tx_ring_phys_addr; } + vc_qp->rxq.vsi_id = vf->vsi_res->vsi_id; vc_qp->rxq.queue_id = i; vc_qp->rxq.max_pkt_size = vf->max_pkt_len; - /* Virtchnnl configure queues by pairs */ - if (i < adapter->eth_dev->data->nb_rx_queues) { - vc_qp->rxq.ring_len = rxq[i]->nb_rx_desc; - vc_qp->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr; - vc_qp->rxq.databuffer_size = rxq[i]->rx_buf_len; - } + + if (i >= adapter->eth_dev->data->nb_rx_queues) + continue; + + /* Virtchnnl configure rx queues by pairs */ + vc_qp->rxq.ring_len = rxq[i]->nb_rx_desc; + vc_qp->rxq.dma_ring_addr = rxq[i]->rx_ring_phys_addr; + vc_qp->rxq.databuffer_size = rxq[i]->rx_buf_len; #ifndef RTE_LIBRTE_IAVF_16BYTE_RX_DESC if (vf->vf_res->vf_cap_flags & -- 2.20.1