patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Xia, Chenbo" <chenbo.xia@intel.com>,
	Ilya Maximets <i.maximets@ovn.org>, dpdk stable <stable@dpdk.org>
Subject: Re: [PATCH v2 1/5] vhost: fix missing virtqueue lock protection
Date: Mon, 28 Mar 2022 16:59:03 +0200	[thread overview]
Message-ID: <46586efd-2b88-a0c2-8d3b-b785f3fc26cb@redhat.com> (raw)
In-Reply-To: <CAJFAV8xvZ+Xy19UOop-uY1s0=Gu64zER=0viW9LMDHNd7gx_+Q@mail.gmail.com>



On 3/28/22 10:07, David Marchand wrote:
> On Thu, Mar 24, 2022 at 1:46 PM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>>
>> This patch ensures virtqueue metadata are not being
>> modified while rte_vhost_vring_call() is executed.
>>
>> Fixes: 6c299bb7322f ("vhost: introduce vring call API")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   lib/vhost/vhost.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
>> index bc88148347..2f96a28dac 100644
>> --- a/lib/vhost/vhost.c
>> +++ b/lib/vhost/vhost.c
>> @@ -1291,11 +1291,15 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
>>          if (!vq)
>>                  return -1;
>>
>> +       rte_spinlock_lock(&vq->access_lock);
>> +
>>          if (vq_is_packed(dev))
>>                  vhost_vring_call_packed(dev, vq);
>>          else
>>                  vhost_vring_call_split(dev, vq);
>>
>> +       rte_spinlock_unlock(&vq->access_lock);
>> +
>>          return 0;
>>   }
>>
> 
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> You can probably merge quickly this fix regardless of the rest of the
> stats series.
> It would help me with a series of mine that annotates vhost locks.
> 
> 

Thanks for the review.

Applied this single patch to next-virtio tree.

Maxime


      reply	other threads:[~2022-03-28 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220324124638.32672-1-maxime.coquelin@redhat.com>
2022-03-24 12:46 ` Maxime Coquelin
2022-03-28  8:07   ` David Marchand
2022-03-28 14:59     ` Maxime Coquelin [this message]

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=46586efd-2b88-a0c2-8d3b-b785f3fc26cb@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=i.maximets@ovn.org \
    --cc=stable@dpdk.org \
    /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).