From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
longli@microsoft.com, Wei Hu <weh@microsoft.com>
Subject: [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function
Date: Fri, 26 Sep 2025 08:58:01 -0700 [thread overview]
Message-ID: <20250926155802.398869-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20250926155802.398869-1-stephen@networkplumber.org>
All global functions should use a common prefix. For netvsc all
globals start with hn_. Rename get_vmbus_device to
hn_nvs_get_vmbus_device to follow pattern used in this code.
Fixes: 11c0663c9445 ("net/netvsc: add function to get vmbus device")
Cc: longli@microsoft.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/netvsc/hn_nvs.c | 10 +++++-----
drivers/net/netvsc/hn_nvs.h | 6 +++---
drivers/net/netvsc/hn_rxtx.c | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/netvsc/hn_nvs.c b/drivers/net/netvsc/hn_nvs.c
index 0b7e6c0264..c6bd60dbda 100644
--- a/drivers/net/netvsc/hn_nvs.c
+++ b/drivers/net/netvsc/hn_nvs.c
@@ -44,7 +44,7 @@ static const uint32_t hn_nvs_version[] = {
NVS_VERSION_1
};
-struct rte_vmbus_device *get_vmbus_device(struct hn_data *hv)
+struct rte_vmbus_device *hn_nvs_get_vmbus_device(struct hn_data *hv)
{
struct rte_vmbus_device *vmbus = hv->vmbus;
@@ -62,7 +62,7 @@ struct rte_vmbus_device *get_vmbus_device(struct hn_data *hv)
static int hn_nvs_req_send(struct hn_data *hv,
void *req, uint32_t reqlen)
{
- return rte_vmbus_chan_send(get_vmbus_device(hv), hn_primary_chan(hv),
+ return rte_vmbus_chan_send(hn_nvs_get_vmbus_device(hv), hn_primary_chan(hv),
VMBUS_CHANPKT_TYPE_INBAND,
req, reqlen, 0,
VMBUS_CHANPKT_FLAG_NONE, NULL);
@@ -82,7 +82,7 @@ __hn_nvs_execute(struct hn_data *hv,
int ret;
/* Send request to ring buffer */
- ret = rte_vmbus_chan_send(get_vmbus_device(hv), chan,
+ ret = rte_vmbus_chan_send(hn_nvs_get_vmbus_device(hv), chan,
VMBUS_CHANPKT_TYPE_INBAND, req, reqlen, 0,
VMBUS_CHANPKT_FLAG_RC, NULL);
@@ -93,7 +93,7 @@ __hn_nvs_execute(struct hn_data *hv,
retry:
len = sizeof(buffer);
- ret = rte_vmbus_chan_recv(get_vmbus_device(hv), chan, buffer, &len, &xactid);
+ ret = rte_vmbus_chan_recv(hn_nvs_get_vmbus_device(hv), chan, buffer, &len, &xactid);
if (ret == -EAGAIN) {
rte_delay_us(HN_CHAN_INTERVAL_US);
goto retry;
@@ -530,7 +530,7 @@ hn_nvs_ack_rxbuf(struct hn_data *hv, struct vmbus_channel *chan, uint64_t tid)
PMD_RX_LOG(DEBUG, "ack RX id %" PRIu64, tid);
again:
- error = rte_vmbus_chan_send(get_vmbus_device(hv), chan,
+ error = rte_vmbus_chan_send(hn_nvs_get_vmbus_device(hv), chan,
VMBUS_CHANPKT_TYPE_COMP, &ack, sizeof(ack),
tid, VMBUS_CHANPKT_FLAG_NONE, NULL);
diff --git a/drivers/net/netvsc/hn_nvs.h b/drivers/net/netvsc/hn_nvs.h
index b7691a5dc2..bf10621927 100644
--- a/drivers/net/netvsc/hn_nvs.h
+++ b/drivers/net/netvsc/hn_nvs.h
@@ -222,14 +222,14 @@ void hn_nvs_handle_vfassoc(struct rte_eth_dev *dev,
const struct vmbus_chanpkt_hdr *hdr,
const void *data);
-struct rte_vmbus_device *get_vmbus_device(struct hn_data *hv);
+struct rte_vmbus_device *hn_nvs_get_vmbus_device(struct hn_data *hv);
static inline int
hn_nvs_send(struct hn_data *hv, struct vmbus_channel *chan,
uint16_t flags, void *nvs_msg, int nvs_msglen, uintptr_t sndc,
bool *need_sig)
{
- return rte_vmbus_chan_send(get_vmbus_device(hv), chan, VMBUS_CHANPKT_TYPE_INBAND,
+ return rte_vmbus_chan_send(hn_nvs_get_vmbus_device(hv), chan, VMBUS_CHANPKT_TYPE_INBAND,
nvs_msg, nvs_msglen, (uint64_t)sndc,
flags, need_sig);
}
@@ -240,6 +240,6 @@ hn_nvs_send_sglist(struct hn_data *hv, struct vmbus_channel *chan,
void *nvs_msg, int nvs_msglen,
uintptr_t sndc, bool *need_sig)
{
- return rte_vmbus_chan_send_sglist(get_vmbus_device(hv), chan, sg, sglen, nvs_msg,
+ return rte_vmbus_chan_send_sglist(hn_nvs_get_vmbus_device(hv), chan, sg, sglen, nvs_msg,
nvs_msglen, (uint64_t)sndc, need_sig);
}
diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 0764d5b319..72dab26ede 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1176,7 +1176,7 @@ uint32_t hn_process_events(struct hn_data *hv, uint16_t queue_id,
}
if (bytes_read > 0)
- rte_vmbus_chan_signal_read(get_vmbus_device(hv), rxq->chan, bytes_read);
+ rte_vmbus_chan_signal_read(hn_nvs_get_vmbus_device(hv), rxq->chan, bytes_read);
rte_spinlock_unlock(&rxq->ring_lock);
@@ -1641,7 +1641,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
fail:
if (need_sig)
- rte_vmbus_chan_signal_tx(get_vmbus_device(hv), txq->chan);
+ rte_vmbus_chan_signal_tx(hn_nvs_get_vmbus_device(hv), txq->chan);
return nb_tx;
}
--
2.47.3
next prev parent reply other threads:[~2025-09-26 15:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 15:58 [PATCH 1/2] net/netvsc: make da_cache_list local Stephen Hemminger
2025-09-26 15:58 ` Stephen Hemminger [this message]
2025-09-26 16:35 ` [EXTERNAL] [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Long Li
2025-09-26 17:21 ` Stephen Hemminger
2025-09-26 16:34 ` [EXTERNAL] [PATCH 1/2] net/netvsc: make da_cache_list local Long Li
2025-09-26 17:20 ` Stephen Hemminger
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=20250926155802.398869-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=longli@microsoft.com \
--cc=weh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.