[4/4] mlx5: re-add support of rx_queue_count for mlx5_rx_burst_mprq

Message ID 20201110140938.15046-5-maxime.leroy@6wind.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fixes for rx queue count calculation |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Maxime Leroy Nov. 10, 2020, 2:09 p.m. UTC
  The commit 014a6936008b ("Revert "net/mlx5: fix Rx queue count
calculation"")' has removed the support of rx_queue_count for
mlx5_rx_burst_mprq.

This commit has been revert because the fixes done on rx_queue_count
computation was wrong. Anyway, it's still true that the Rx queue count
calculation is same for any rx burts method since CQ handling is the
same for regular, vectorized, and multi-packet Rx queues.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 2cabd650..db3c6100 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -492,7 +492,7 @@  rx_queue_count(struct mlx5_rxq_data *rxq)
 		used += n;
 		cqe = &(*rxq->cqes)[cq_ci & cqe_cnt];
 	}
-	used = RTE_MIN(used * sges_n, 1U << rxq->elts_n);
+	used = RTE_MIN(used * sges_n, cqe_cnt);
 	return used;
 }
 
@@ -515,7 +515,8 @@  mlx5_rx_descriptor_status(void *rx_queue, uint16_t offset)
 			container_of(rxq, struct mlx5_rxq_ctrl, rxq);
 	struct rte_eth_dev *dev = ETH_DEV(rxq_ctrl->priv);
 
-	if (dev->rx_pkt_burst != mlx5_rx_burst) {
+	if (dev->rx_pkt_burst == NULL ||
+	    dev->rx_pkt_burst == removed_rx_burst) {
 		rte_errno = ENOTSUP;
 		return -rte_errno;
 	}