DPDK patches and discussions
 help / color / mirror / Atom feed
From: Eelco Chaudron <echaudro@redhat.com>
To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, dev@dpdk.org
Subject: Re: [EXT] [PATCH] vhost: add device op to offload the interrupt kick
Date: Mon, 27 Mar 2023 18:04:22 +0200	[thread overview]
Message-ID: <4FB0405A-41E0-4CE2-B8B1-0974CD398956@redhat.com> (raw)
In-Reply-To: <CO1PR18MB4714FF403301E7B911B05D95CB8B9@CO1PR18MB4714.namprd18.prod.outlook.com>



On 27 Mar 2023, at 17:16, Gowrishankar Muthukrishnan wrote:

> Hi Eelco,
>
>> +void
>> +rte_vhost_notify_guest(int vid, uint16_t queue_id) {
>> +	struct virtio_net *dev = get_device(vid);
>> +	struct vhost_virtqueue *vq;
>> +
>> +	if (!dev ||  queue_id >= VHOST_MAX_VRING)
>> +		return;
>> +
>> +	vq = dev->virtqueue[queue_id];
>> +	if (!vq)
>> +		return;
>> +
>> +	rte_spinlock_lock(&vq->access_lock);
>> +
>
> Is spin lock needed here before system call ?

I assumed access_lock is protecting all the following fields in this structure, so I need the lock to read the vq->callfd, however, I can/should move the eventfd_write outside of the lock.

>> +	if (vq->callfd >= 0)
>> +		eventfd_write(vq->callfd, (eventfd_t)1);
>> +
>> +	rte_spinlock_unlock(&vq->access_lock);
>> +}
>> +
>
> Thanks.


  reply	other threads:[~2023-03-27 16:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 12:51 Eelco Chaudron
2023-03-27 13:21 ` Maxime Coquelin
2023-03-27 14:10   ` Eelco Chaudron
2023-03-27 15:16 ` [EXT] " Gowrishankar Muthukrishnan
2023-03-27 16:04   ` Eelco Chaudron [this message]
2023-03-27 16:35     ` Maxime Coquelin
2023-03-28 12:14       ` Eelco Chaudron
2023-04-03 14:51       ` Eelco Chaudron
2023-04-03 15:26         ` Maxime Coquelin

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=4FB0405A-41E0-4CE2-B8B1-0974CD398956@redhat.com \
    --to=echaudro@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=gmuthukrishn@marvell.com \
    --cc=maxime.coquelin@redhat.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).