From: Stephen Hemminger <stephen@networkplumber.org>
To: longli@linuxonhyperv.com
Cc: Wei Hu <weh@microsoft.com>, dev@dpdk.org, Long Li <longli@microsoft.com>
Subject: Re: [Patch v3 6/6] bus/vmbus: set event for channel without monitoring support
Date: Sun, 6 Apr 2025 09:08:53 -0700 [thread overview]
Message-ID: <20250406090853.78499346@hermes.local> (raw)
In-Reply-To: <1743813338-28238-7-git-send-email-longli@linuxonhyperv.com>
On Fri, 4 Apr 2025 17:35:38 -0700
longli@linuxonhyperv.com wrote:
> diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c
> index bccef168d3..81e8096190 100644
> --- a/drivers/bus/vmbus/vmbus_channel.c
> +++ b/drivers/bus/vmbus/vmbus_channel.c
> @@ -24,6 +24,19 @@ vmbus_sync_set_bit(volatile RTE_ATOMIC(uint32_t) *addr, uint32_t mask)
> rte_atomic_fetch_or_explicit(addr, mask, rte_memory_order_seq_cst);
> }
>
> +static inline void
> +vmbus_send_interrupt(const struct rte_vmbus_device *dev, uint32_t relid)
> +{
> + RTE_ATOMIC(uint32_t) *int_addr;
> + uint32_t int_mask;
> +
> + int_addr = (RTE_ATOMIC(uint32_t)*) (dev->int_page + relid / 32);
> + int_mask = 1u << (relid % 32);
> + vmbus_sync_set_bit(int_addr, int_mask);
> +
> + vmbus_uio_irq_control(dev, 1);
> +}
> +
This part doesn't look right. RTE_ATOMIC() is just a macro to add the _Atomic attribute.
Can it be simplified like this?
static inline void
vmbus_sync_set_bit(RTE_ATOMIC(uint32_t *) addr, uint32_t mask)
{
rte_atomic_fetch_or_explicit(addr, mask, rte_memory_order_seq_cst);
}
static inline void
vmbus_send_interrupt(const struct rte_vmbus_device *dev, uint32_t relid)
{
RTE_ATOMIC(uint32_t *) int_addr;
uint32_t int_mask;
int_addr = dev->int_page + relid / 32;
int_mask = 1u << (relid % 32);
vmbus_sync_set_bit(int_addr, int_mask);
vmbus_uio_irq_control(dev, 1);
}
next prev parent reply other threads:[~2025-04-06 16:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-05 0:35 [Patch v3 0/6] Support VMBUS channels without monitoring enabled longli
2025-04-05 0:35 ` [Patch v3 1/6] net/netvsc: introduce private data for storing vmbus device for secondary process longli
2025-04-05 0:35 ` [Patch v3 2/6] net/netvsc: introduce get_vmbus_device to get the vmbus device longli
2025-04-05 0:35 ` [Patch v3 3/6] bus/vmbus: store UIO fd for secondary process longli
2025-04-05 0:35 ` [Patch v3 4/6] bus/vmbus: support channels without monitoring enabled longli
2025-04-05 0:35 ` [Patch v3 5/6] bus/vmbus: add rte_vmbus_device to all functions accessing vmbus longli
2025-04-05 0:35 ` [Patch v3 6/6] bus/vmbus: set event for channel without monitoring support longli
2025-04-06 16:08 ` Stephen Hemminger [this message]
2025-04-07 22:17 ` [EXTERNAL] " Long Li
2025-04-10 18:09 ` Long Li
2025-04-16 20:59 ` Long Li
2025-04-06 16:09 ` [Patch v3 0/6] Support VMBUS channels without monitoring enabled 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=20250406090853.78499346@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=longli@linuxonhyperv.com \
--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.