From: longli@linuxonhyperv.com
To: Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: dev@dpdk.org, Long Li <longli@microsoft.com>
Subject: [PATCH] net/mana: rename mana_find_pmd_mr() to mana_alloc_pmd_mr()
Date: Fri, 19 Jan 2024 16:55:35 -0800 [thread overview]
Message-ID: <1705712135-24492-1-git-send-email-longli@linuxonhyperv.com> (raw)
From: Long Li <longli@microsoft.com>
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 <longli@microsoft.com>
---
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
next reply other threads:[~2024-01-20 0:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-20 0:55 longli [this message]
2024-01-22 12:18 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1705712135-24492-1-git-send-email-longli@linuxonhyperv.com \
--to=longli@linuxonhyperv.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=longli@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).