From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69047A04BA; Thu, 1 Oct 2020 16:15:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DBD91DBF6; Thu, 1 Oct 2020 16:11:39 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 2C3361DB73 for ; Thu, 1 Oct 2020 16:11:38 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from michaelba@nvidia.com) with SMTP; 1 Oct 2020 17:11:35 +0300 Received: from nvidia.com (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 091EAAES012743; Thu, 1 Oct 2020 17:11:35 +0300 From: Michael Baum To: dev@dpdk.org Cc: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko Date: Thu, 1 Oct 2020 14:09:23 +0000 Message-Id: <1601561366-1821-13-git-send-email-michaelba@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1601561366-1821-1-git-send-email-michaelba@nvidia.com> References: <1601561366-1821-1-git-send-email-michaelba@nvidia.com> Subject: [dpdk-dev] [PATCH v1 12/15] net/mlx5: share Tx queue object modification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use new modify_qp functions for Tx object creation in DevX and Verbs modules. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_verbs.c | 34 +++------------------------------- drivers/net/mlx5/mlx5_devx.c | 7 ++----- drivers/net/mlx5/mlx5_txq.c | 2 -- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c index 7d5ea37..ad6e3d7 100644 --- a/drivers/net/mlx5/linux/mlx5_verbs.c +++ b/drivers/net/mlx5/linux/mlx5_verbs.c @@ -922,7 +922,6 @@ struct mlx5_txq_ctrl *txq_ctrl = container_of(txq_data, struct mlx5_txq_ctrl, txq); struct mlx5_txq_obj *txq_obj = txq_ctrl->obj; - struct ibv_qp_attr mod; unsigned int cqe_n; struct mlx5dv_qp qp; struct mlx5dv_cq cq_info; @@ -956,37 +955,10 @@ rte_errno = errno; goto error; } - mod = (struct ibv_qp_attr){ - /* Move the QP to this state. */ - .qp_state = IBV_QPS_INIT, - /* IB device port number. */ - .port_num = (uint8_t)priv->dev_port, - }; - ret = mlx5_glue->modify_qp(txq_obj->qp, &mod, - (IBV_QP_STATE | IBV_QP_PORT)); - if (ret) { - DRV_LOG(ERR, - "Port %u Tx queue %u QP state to IBV_QPS_INIT failed.", - dev->data->port_id, idx); - rte_errno = errno; - goto error; - } - mod = (struct ibv_qp_attr){ - .qp_state = IBV_QPS_RTR - }; - ret = mlx5_glue->modify_qp(txq_obj->qp, &mod, IBV_QP_STATE); + ret = mlx5_ibv_modify_qp(txq_obj, MLX5_TXQ_MOD_RST2RDY, + (uint8_t)priv->dev_port); if (ret) { - DRV_LOG(ERR, - "Port %u Tx queue %u QP state to IBV_QPS_RTR failed.", - dev->data->port_id, idx); - rte_errno = errno; - goto error; - } - mod.qp_state = IBV_QPS_RTS; - ret = mlx5_glue->modify_qp(txq_obj->qp, &mod, IBV_QP_STATE); - if (ret) { - DRV_LOG(ERR, - "Port %u Tx queue %u QP state to IBV_QPS_RTS failed.", + DRV_LOG(ERR, "Port %u Tx queue %u QP state modifying failed.", dev->data->port_id, idx); rte_errno = errno; goto error; diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index 7404a15..c876ae9 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -1237,7 +1237,6 @@ return -rte_errno; #else struct mlx5_dev_ctx_shared *sh = priv->sh; - struct mlx5_devx_modify_sq_attr msq_attr = { 0 }; struct mlx5_txq_obj *txq_obj = txq_ctrl->obj; void *reg_addr; uint32_t cqe_n; @@ -1286,13 +1285,11 @@ *txq_data->qp_db = 0; txq_data->qp_num_8s = txq_obj->sq_devx->id << 8; /* Change Send Queue state to Ready-to-Send. */ - msq_attr.sq_state = MLX5_SQC_STATE_RST; - msq_attr.state = MLX5_SQC_STATE_RDY; - ret = mlx5_devx_cmd_modify_sq(txq_obj->sq_devx, &msq_attr); + ret = mlx5_devx_modify_sq(txq_obj, MLX5_TXQ_MOD_RST2RDY, 0); if (ret) { rte_errno = errno; DRV_LOG(ERR, - "Port %u Tx queue %u SP state to SQC_STATE_RDY failed.", + "Port %u Tx queue %u SQ state to SQC_STATE_RDY failed.", dev->data->port_id, idx); goto error; } diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index c31e446..af84f5f 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -16,8 +16,6 @@ #include #include -#include -#include #include #include #include -- 1.8.3.1