From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B256443904; Sat, 20 Jan 2024 01:55:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 739B3402AA; Sat, 20 Jan 2024 01:55:44 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 783934027B for ; Sat, 20 Jan 2024 01:55:42 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1004) id 99A6D20DFE69; Fri, 19 Jan 2024 16:55:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 99A6D20DFE69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1705712141; bh=MMFnzlY0+s9bSqR4Vuv/LzD9u5Z9E+RVbe/3WdQYLJI=; h=From:To:Cc:Subject:Date:From; b=EZNxzVnKcnNbNJfKpl//Xw8iBA/gEDGqOL3UqeWEGD/hUIVsnNJx8OioYE1YDL4Pv MSKwfjwQh4+Df1YtnnsMowOSW+MhDzmYZYWb3C6xybLibNdPCzqkgsDqT63dOil7Wa 95uJe27xOaFz3PsCzIbgXtsdt297lG1A9jkdKhog= From: longli@linuxonhyperv.com To: Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Long Li Subject: [PATCH] net/mana: rename mana_find_pmd_mr() to mana_alloc_pmd_mr() Date: Fri, 19 Jan 2024 16:55:35 -0800 Message-Id: <1705712135-24492-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Li The function name mana_find_pmd_mr() is misleading as there might be allocations to get a MR. Change function name to mana_alloc_pmd_mr(). Signed-off-by: Long Li --- drivers/net/mana/mana.h | 6 +++--- drivers/net/mana/mr.c | 7 ++++--- drivers/net/mana/rx.c | 2 +- drivers/net/mana/tx.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h index 6836872dc2..eadcd01858 100644 --- a/drivers/net/mana/mana.h +++ b/drivers/net/mana/mana.h @@ -511,9 +511,9 @@ int mana_start_tx_queues(struct rte_eth_dev *dev); int mana_stop_rx_queues(struct rte_eth_dev *dev); int mana_stop_tx_queues(struct rte_eth_dev *dev); -struct mana_mr_cache *mana_find_pmd_mr(struct mana_mr_btree *local_tree, - struct mana_priv *priv, - struct rte_mbuf *mbuf); +struct mana_mr_cache *mana_alloc_pmd_mr(struct mana_mr_btree *local_tree, + struct mana_priv *priv, + struct rte_mbuf *mbuf); int mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv, struct rte_mempool *pool); void mana_remove_all_mr(struct mana_priv *priv); diff --git a/drivers/net/mana/mr.c b/drivers/net/mana/mr.c index b8e6ea0bbf..d6a5ad1460 100644 --- a/drivers/net/mana/mr.c +++ b/drivers/net/mana/mr.c @@ -122,11 +122,12 @@ mana_del_pmd_mr(struct mana_mr_cache *mr) } /* - * Find a MR from cache. If not found, register a new MR. + * Alloc a MR. + * Try to find a MR in the cache. If not found, register a new MR. */ struct mana_mr_cache * -mana_find_pmd_mr(struct mana_mr_btree *local_mr_btree, struct mana_priv *priv, - struct rte_mbuf *mbuf) +mana_alloc_pmd_mr(struct mana_mr_btree *local_mr_btree, struct mana_priv *priv, + struct rte_mbuf *mbuf) { struct rte_mempool *pool = mbuf->pool; int ret, second_try = 0; diff --git a/drivers/net/mana/rx.c b/drivers/net/mana/rx.c index 63042fe9b9..acad5e26cd 100644 --- a/drivers/net/mana/rx.c +++ b/drivers/net/mana/rx.c @@ -75,7 +75,7 @@ mana_alloc_and_post_rx_wqe(struct mana_rxq *rxq) return -ENOMEM; } - mr = mana_find_pmd_mr(&rxq->mr_btree, priv, mbuf); + mr = mana_alloc_pmd_mr(&rxq->mr_btree, priv, mbuf); if (!mr) { DP_LOG(ERR, "failed to register RX MR"); rte_pktmbuf_free(mbuf); diff --git a/drivers/net/mana/tx.c b/drivers/net/mana/tx.c index c50385d9fe..58c4a1d976 100644 --- a/drivers/net/mana/tx.c +++ b/drivers/net/mana/tx.c @@ -365,7 +365,7 @@ mana_tx_burst(void *dpdk_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) /* Create SGL for packet data buffers */ for (seg_idx = 0; seg_idx < m_pkt->nb_segs; seg_idx++) { struct mana_mr_cache *mr = - mana_find_pmd_mr(&txq->mr_btree, priv, m_seg); + mana_alloc_pmd_mr(&txq->mr_btree, priv, m_seg); if (!mr) { DP_LOG(ERR, "failed to get MR, pkt_idx %u", -- 2.25.1