Skip to contentSkip to conversation

net/iavf: fix setting wrong RXDID value for Rx queue

PATCH Applied Ting Xu 3 participants 3 messages May 11, 2020 – May 18, 2020 Network drivers

lore
Share & tools
lore

Ting Xu

author
#0 lore raw

PATCH 1/1 net/iavf: fix setting wrong RXDID value for Rx queue

CVL kernel PF configures all reserved queues for VF, including Rx queue RXDID. The number of reserved queues is the maximum between Tx and Rx queues. If the number of the enabled Rx queues is less than that of reserved queues, required RXDID will only be set for those enabled, but default value (0) is set for others. However, RXDID 0 (legacy 16byte descriptor) is not supported now, PF will return error when configuring those disabled VF queues.

In this patch, required RXDID is set for all reserved Rx queues, no matter enabled or not. In this way, PF will configure Rx queues correctly without reporting error.

Fixes b8b4c54ef9b0 ("net/iavf: support flexible Rx descriptor in normal path")
---
 drivers/net/iavf/iavf_vchnl.c | 44 +++++++++++++++++------------------
 1 file changed, 22 insertions(+), 22 deletions(-)
drivers/net/iavf/iavf_vchnl.c +22 -22
index 2a0cdd927..328cfdf01 100644
@@ -593,32 +593,32 @@ iavf_configure_queues(struct iavf_adapter *adapter)
 			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 &
-			    VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
-			    vf->supported_rxdid & BIT(IAVF_RXDID_COMMS_OVS_1)) {
-				vc_qp->rxq.rxdid = IAVF_RXDID_COMMS_OVS_1;
-				PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			} else {
-				vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_1;
-				PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			}
+		if (vf->vf_res->vf_cap_flags &
+			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
+			vf->supported_rxdid & BIT(IAVF_RXDID_COMMS_OVS_1)) {
+			vc_qp->rxq.rxdid = IAVF_RXDID_COMMS_OVS_1;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		} else {
+			vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_1;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		}
 #else
-			if (vf->vf_res->vf_cap_flags &
-			    VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
-			    vf->supported_rxdid & BIT(IAVF_RXDID_LEGACY_0)) {
-				vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_0;
-				PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			} else {
-				PMD_DRV_LOG(ERR, "RXDID == 0 is not supported");
-				return -1;
-			}
-#endif
+		if (vf->vf_res->vf_cap_flags &
+			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
+			vf->supported_rxdid & BIT(IAVF_RXDID_LEGACY_0)) {
+			vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_0;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		} else {
+			PMD_DRV_LOG(ERR, "RXDID == 0 is not supported");
+			return -1;
 		}
+#endif
 	}
 
 	memset(&args, 0, sizeof(args));
Signature · 1 line
2.17.1
Tested-by on v1 1/1
#1 lore raw

Best regards,
Zeng,xiaoxiao

Quoted 102 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ting Xu
Sent: Monday, May 11, 2020 11:28 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>; Ye, Xiaolong <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v1] net/iavf: fix setting wrong RXDID value for Rx queue

CVL kernel PF configures all reserved queues for VF, including Rx queue RXDID. The number of reserved queues is the maximum between Tx and Rx queues. If the number of the enabled Rx queues is less than that of reserved queues, required RXDID will only be set for those enabled, but default value
(0) is set for others.
However, RXDID 0 (legacy 16byte descriptor) is not supported now, PF will return error when configuring those disabled VF queues.

In this patch, required RXDID is set for all reserved Rx queues, no matter enabled or not. In this way, PF will configure Rx queues correctly without reporting error.

Fixes b8b4c54ef9b0 ("net/iavf: support flexible Rx descriptor in normal path")
---
 drivers/net/iavf/iavf_vchnl.c | 44 +++++++++++++++++------------------
 1 file changed, 22 insertions(+), 22 deletions(-)
drivers/net/iavf/iavf_vchnl.c index renamed from drivers/net/iavf/iavf_vchnl.c +0 -0

2a0cdd927..328cfdf01 100644

drivers/net/iavf/iavf_vchnl.c +1 -5
@@ -593,32 +593,32 @@ iavf_configure_queues(struct iavf_adapter
 *adapter)
 			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 &
-			    VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
-			    vf->supported_rxdid &
 BIT(IAVF_RXDID_COMMS_OVS_1)) {
-				vc_qp->rxq.rxdid =
 IAVF_RXDID_COMMS_OVS_1;
-				PMD_DRV_LOG(NOTICE, "request RXDID

== %d in "

drivers/net/iavf/iavf_vchnl.c +0 -4
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			} else {
-				vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_1;
-				PMD_DRV_LOG(NOTICE, "request RXDID

== %d in "

drivers/net/iavf/iavf_vchnl.c +3 -2
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			}
+		if (vf->vf_res->vf_cap_flags &
+			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
+			vf->supported_rxdid &

BIT(IAVF_RXDID_COMMS_OVS_1)) {

drivers/net/iavf/iavf_vchnl.c +8 -3
+			vc_qp->rxq.rxdid = IAVF_RXDID_COMMS_OVS_1;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		} else {
+			vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_1;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		}
 #else
-			if (vf->vf_res->vf_cap_flags &
-			    VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
-			    vf->supported_rxdid &

BIT(IAVF_RXDID_LEGACY_0)) {

drivers/net/iavf/iavf_vchnl.c +0 -2
-				vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_0;
-				PMD_DRV_LOG(NOTICE, "request RXDID

== %d in "

drivers/net/iavf/iavf_vchnl.c +0 -3
-					    "Queue[%d]", vc_qp->rxq.rxdid, i);
-			} else {
-				PMD_DRV_LOG(ERR, "RXDID == 0 is not

supported");

drivers/net/iavf/iavf_vchnl.c +3 -3
-				return -1;
-			}
-#endif
+		if (vf->vf_res->vf_cap_flags &
+			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC &&
+			vf->supported_rxdid & BIT(IAVF_RXDID_LEGACY_0))

{

drivers/net/iavf/iavf_vchnl.c +7 -1
+			vc_qp->rxq.rxdid = IAVF_RXDID_LEGACY_0;
+			PMD_DRV_LOG(NOTICE, "request RXDID == %d in "
+					"Queue[%d]", vc_qp->rxq.rxdid, i);
+		} else {
+			PMD_DRV_LOG(ERR, "RXDID == 0 is not supported");
+			return -1;
 		}
+#endif
 	}
 
 	memset(&args, 0, sizeof(args));
--

2.17.1

Acked-by on v1 1/1 Applied
#2 lore raw
In reply to Ting Xu
Quoted 8 lines · Ting Xu

CVL kernel PF configures all reserved queues for VF, including Rx queue RXDID. The number of reserved queues is the maximum between Tx and Rx queues. If the number of the enabled Rx queues is less than that of reserved queues, required RXDID will only be set for those enabled, but default value (0) is set for others. However, RXDID 0 (legacy 16byte descriptor) is not supported now, PF will return error when configuring those disabled VF queues.

Quoted 6 lines

In this patch, required RXDID is set for all reserved Rx queues, no matter enabled or not. In this way, PF will configure Rx queues correctly without reporting error.

Fixes b8b4c54ef9b0 ("net/iavf: support flexible Rx descriptor in normal path")

b8b4c54ef9b0 is introduce in this release, no need to cc stable.

Quoted 1 line

Applied to dpdk-next-net-intel, Thanks.