net/iavf: fix RXDID configure
authorJeff Guo <jia.guo@intel.com>
Mon, 9 Nov 2020 06:05:17 +0000 (14:05 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 18:43:26 +0000 (19:43 +0100)
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 <jia.guo@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_vchnl.c

index 64d1946..33d03af 100644 (file)
@@ -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 &