net/mlx5: adds the checking for Tx queue affinity

Message ID 20230922065025.9658-1-jiaweiw@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: adds the checking for Tx queue affinity |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Jiawei Wang Sept. 22, 2023, 6:50 a.m. UTC
  MLX5 PMD updates the TIS index based on the tx queue affinity,
and creates the DevX SQ object with updated the TIS index.

This patch adds the checking that set the affinity per Tx Queue
if HW objects can be created by DevX.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_txq.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Raslan Darawsheh Oct. 9, 2023, 8:59 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Friday, September 22, 2023 9:50 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: adds the checking for Tx queue affinity
> 
> MLX5 PMD updates the TIS index based on the tx queue affinity, and creates
> the DevX SQ object with updated the TIS index.
> 
> This patch adds the checking that set the affinity per Tx Queue if HW objects
> can be created by DevX.
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 8cb52b0f7d..b584055fa8 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -1381,6 +1381,11 @@  int mlx5_map_aggr_tx_affinity(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 	struct mlx5_priv *priv;
 
 	priv = dev->data->dev_private;
+	if (!mlx5_devx_obj_ops_en(priv->sh)) {
+		DRV_LOG(ERR, "Tx affinity mapping isn't supported by Verbs API.");
+		rte_errno = ENOTSUP;
+		return -rte_errno;
+	}
 	txq = (*priv->txqs)[tx_queue_id];
 	if (!txq)
 		return -1;