From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Jens Freimann <jfreiman@redhat.com>
Cc: dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com
Subject: Re: [dpdk-dev] [RFC 1/2] vhost: add packed ring support to vring base requests
Date: Tue, 14 Aug 2018 14:09:21 +0200 [thread overview]
Message-ID: <2004c11d-6c2a-bed5-389d-bd92fee25ed1@redhat.com> (raw)
In-Reply-To: <20180810070902.we3jf4xfpbgu5vst@jenstp.localdomain>
Hi Jens,
On 08/10/2018 09:09 AM, Jens Freimann wrote:
> On Wed, Aug 08, 2018 at 05:23:22PM +0200, Maxime Coquelin wrote:
>> For consistency with Vhost kernel backend, save the wrap
>> counter value into bit 31 of num's vring state field.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> lib/librte_vhost/vhost_user.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/librte_vhost/vhost_user.c
>> b/lib/librte_vhost/vhost_user.c
>> index a2d4c9ffc..31cfdf163 100644
>> --- a/lib/librte_vhost/vhost_user.c
>> +++ b/lib/librte_vhost/vhost_user.c
>> @@ -648,10 +648,15 @@ static int
>> vhost_user_set_vring_base(struct virtio_net *dev,
>> VhostUserMsg *msg)
>> {
>> - dev->virtqueue[msg->payload.state.index]->last_used_idx =
>> - msg->payload.state.num;
>> - dev->virtqueue[msg->payload.state.index]->last_avail_idx =
>> - msg->payload.state.num;
>> + struct vhost_virtqueue *vq =
>> dev->virtqueue[msg->payload.state.index];
>> + if (dev->features & (1ULL << VIRTIO_F_RING_PACKED)) {
>> + vq->avail_wrap_counter = msg->payload.state.num >> 31;
>> + vq->used_wrap_counter = vq->avail_wrap_counter;
>
> Maybe I don't understand when this is called, but the wrap counters
> could have different values, no?
No, because we set the used index to the saved avail index value, so
wrap counters must be the same.
> Apart from that:
>
> Reviewed-by: Jens Freimann <jfreimann@redhat.com>
> regards,
> Jens
next prev parent reply other threads:[~2018-08-14 12:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 15:23 [dpdk-dev] [RFC 0/2] vhost: packed ring support completion Maxime Coquelin
2018-08-08 15:23 ` [dpdk-dev] [RFC 1/2] vhost: add packed ring support to vring base requests Maxime Coquelin
2018-08-10 7:09 ` Jens Freimann
2018-08-14 12:09 ` Maxime Coquelin [this message]
2018-08-08 15:23 ` [dpdk-dev] [RFC 2/2] vhost: advertize packed ring layout support 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=2004c11d-6c2a-bed5-389d-bd92fee25ed1@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=jfreiman@redhat.com \
--cc=tiwei.bie@intel.com \
--cc=zhihong.wang@intel.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).