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 8D21BA04BA; Thu, 1 Oct 2020 16:14:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E83D1DB85; Thu, 1 Oct 2020 16:11:24 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0AF0F1DBE7 for ; Thu, 1 Oct 2020 16:11:21 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from michaelba@nvidia.com) with SMTP; 1 Oct 2020 17:11:21 +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 091EAAEQ012743; Thu, 1 Oct 2020 17:11:21 +0300 From: Michael Baum To: dev@dpdk.org Cc: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko Date: Thu, 1 Oct 2020 14:09:21 +0000 Message-Id: <1601561366-1821-11-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 10/15] net/mlx5: rearrange QP creation in Verbs module 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" 1. Rename function to mention the internal resources. 2. Reduce the number of function arguments. Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_verbs.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c index 5568c75..0476d94 100644 --- a/drivers/net/mlx5/linux/mlx5_verbs.c +++ b/drivers/net/mlx5/linux/mlx5_verbs.c @@ -789,15 +789,12 @@ * Pointer to Ethernet device. * @param idx * Queue index in DPDK Tx queue array. - * @param rxq_obj - * Pointer to Tx queue object data. * * @return - * The QP Verbs object initialized, NULL otherwise and rte_errno is set. + * The QP Verbs object, NULL otherwise and rte_errno is set. */ static struct ibv_qp * -mlx5_ibv_qp_new(struct rte_eth_dev *dev, uint16_t idx, - struct mlx5_txq_obj *txq_obj) +mlx5_txq_ibv_qp_create(struct rte_eth_dev *dev, uint16_t idx) { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_txq_data *txq_data = (*priv->txqs)[idx]; @@ -807,11 +804,11 @@ struct ibv_qp_init_attr_ex qp_attr = { 0 }; const int desc = 1 << txq_data->elts_n; - MLX5_ASSERT(txq_ctrl->obj); + MLX5_ASSERT(txq_ctrl->obj->cq); /* CQ to be associated with the send queue. */ - qp_attr.send_cq = txq_obj->cq; + qp_attr.send_cq = txq_ctrl->obj->cq; /* CQ to be associated with the receive queue. */ - qp_attr.recv_cq = txq_obj->cq; + qp_attr.recv_cq = txq_ctrl->obj->cq; /* Max number of outstanding WRs. */ qp_attr.cap.max_send_wr = ((priv->sh->device_attr.max_qp_wr < desc) ? priv->sh->device_attr.max_qp_wr : desc); @@ -890,7 +887,7 @@ rte_errno = errno; goto error; } - txq_obj->qp = mlx5_ibv_qp_new(dev, idx, txq_obj); + txq_obj->qp = mlx5_txq_ibv_qp_create(dev, idx); if (txq_obj->qp == NULL) { rte_errno = errno; goto error; -- 1.8.3.1