* [PATCH 1/2] net/netvsc: make da_cache_list local @ 2025-09-26 15:58 Stephen Hemminger 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Stephen Hemminger ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Stephen Hemminger @ 2025-09-26 15:58 UTC (permalink / raw) To: dev; +Cc: Stephen Hemminger, longli, Wei Hu The list of devices is only used in one file and does not follow naming prefix convention. Make it local. Fixes: 9a9d038c782e ("net/netvsc: cache device parameters for hotplug events") Cc: longli@microsoft.com Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- drivers/net/netvsc/hn_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 1d788f3fb7..5b9b54c068 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -102,7 +102,7 @@ struct da_cache { char drv_str[]; }; -LIST_HEAD(da_cache_list, da_cache) da_cache_list; +static LIST_HEAD(da_cache_list, da_cache) da_cache_list; static unsigned int da_cache_usage; static struct rte_eth_dev * -- 2.47.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function 2025-09-26 15:58 [PATCH 1/2] net/netvsc: make da_cache_list local Stephen Hemminger @ 2025-09-26 15:58 ` Stephen Hemminger 2025-09-26 16:35 ` [EXTERNAL] " 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 2 siblings, 2 replies; 6+ messages in thread From: Stephen Hemminger @ 2025-09-26 15:58 UTC (permalink / raw) To: dev; +Cc: Stephen Hemminger, longli, Wei Hu 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXTERNAL] [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Stephen Hemminger @ 2025-09-26 16:35 ` Long Li 2025-09-26 17:21 ` Stephen Hemminger 1 sibling, 0 replies; 6+ messages in thread From: Long Li @ 2025-09-26 16:35 UTC (permalink / raw) To: Stephen Hemminger, dev; +Cc: Wei Hu > Subject: [EXTERNAL] [PATCH 2/2] net/netvsc: rename get_vmbus_device internal > function > > 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> Reviewed-by: Long Li <longli@microsoft.com> > --- > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Stephen Hemminger 2025-09-26 16:35 ` [EXTERNAL] " Long Li @ 2025-09-26 17:21 ` Stephen Hemminger 1 sibling, 0 replies; 6+ messages in thread From: Stephen Hemminger @ 2025-09-26 17:21 UTC (permalink / raw) To: dev; +Cc: longli, Wei Hu On Fri, 26 Sep 2025 08:58:01 -0700 Stephen Hemminger <stephen@networkplumber.org> wrote: > 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> > --- Queued to next-net ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXTERNAL] [PATCH 1/2] net/netvsc: make da_cache_list local 2025-09-26 15:58 [PATCH 1/2] net/netvsc: make da_cache_list local Stephen Hemminger 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Stephen Hemminger @ 2025-09-26 16:34 ` Long Li 2025-09-26 17:20 ` Stephen Hemminger 2 siblings, 0 replies; 6+ messages in thread From: Long Li @ 2025-09-26 16:34 UTC (permalink / raw) To: Stephen Hemminger, dev; +Cc: Wei Hu > Subject: [EXTERNAL] [PATCH 1/2] net/netvsc: make da_cache_list local > > The list of devices is only used in one file and does not follow naming prefix > convention. Make it local. > > Fixes: 9a9d038c782e ("net/netvsc: cache device parameters for hotplug events") > Cc: longli@microsoft.com > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Long Li <longli@microsoft.com> > --- > drivers/net/netvsc/hn_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c > index 1d788f3fb7..5b9b54c068 100644 > --- a/drivers/net/netvsc/hn_ethdev.c > +++ b/drivers/net/netvsc/hn_ethdev.c > @@ -102,7 +102,7 @@ struct da_cache { > char drv_str[]; > }; > > -LIST_HEAD(da_cache_list, da_cache) da_cache_list; > +static LIST_HEAD(da_cache_list, da_cache) da_cache_list; > static unsigned int da_cache_usage; > > static struct rte_eth_dev * > -- > 2.47.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] net/netvsc: make da_cache_list local 2025-09-26 15:58 [PATCH 1/2] net/netvsc: make da_cache_list local Stephen Hemminger 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function 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 2 siblings, 0 replies; 6+ messages in thread From: Stephen Hemminger @ 2025-09-26 17:20 UTC (permalink / raw) To: dev; +Cc: longli, Wei Hu On Fri, 26 Sep 2025 08:58:00 -0700 Stephen Hemminger <stephen@networkplumber.org> wrote: > The list of devices is only used in one file and does not follow > naming prefix convention. Make it local. > > Fixes: 9a9d038c782e ("net/netvsc: cache device parameters for hotplug events") > Cc: longli@microsoft.com > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Queued to next-net ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-26 17:21 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-09-26 15:58 [PATCH 1/2] net/netvsc: make da_cache_list local Stephen Hemminger 2025-09-26 15:58 ` [PATCH 2/2] net/netvsc: rename get_vmbus_device internal function Stephen Hemminger 2025-09-26 16:35 ` [EXTERNAL] " 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
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).