linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eli Cohen <elic@nvidia.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>
Cc: Jason Wang <jasowang@redhat.com>, <mst@redhat.com>,
	<virtualization@lists.linux-foundation.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lulu@redhat.com>
Subject: Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map
Date: Wed, 17 Feb 2021 08:51:23 +0200	[thread overview]
Message-ID: <20210217065123.GA128881@mtl-vdi-166.wap.labs.mlnx> (raw)
In-Reply-To: <fa78717a-3707-520b-35cb-c8e37503dccf@oracle.com>

On Tue, Feb 16, 2021 at 04:25:20PM -0800, Si-Wei Liu wrote:
> 
> > > The saved mvq->avail_idx will be used to recreate hardware virtq object and
> > > the used index in create_virtqueue(), once status DRIVER_OK is set. I
> > > suspect we should pass the index to mvq->used_idx in
> > > mlx5_vdpa_set_vq_state() below instead.
> > > 
> > Right, that's what I am checking but still no final conclusions. I need
> > to harness hardware guy to provide me with clear answers.
> OK. Could you update what you find from the hardware guy and let us know
> e.g. if the current firmware interface would suffice?
> 

Te answer I got is that upon query_virtqueue, the hardware available and
used indices should always return the same value for virtqueues that
complete in order - that's the case for network virtqueues. The value
returned is the consumer index of the hardware. These values should be
provided when creating a virtqueue; in case of attaching to an existing
virtqueue (e.g. after suspend and resume), the values can be non zero.

Currently there's a bug in the firmware where for RX virtqueue, the
value returned for the available index is wrong. However, the value
returned for used index is the correct value.

Therefore, we need to return the hardware used index in get_vq_state()
and restore this value into both the new object's available and used
indices.

  reply	other threads:[~2021-02-17  6:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  7:36 [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map Eli Cohen
2021-02-05  3:57 ` Jason Wang
2021-02-05 23:07 ` Si-Wei Liu
2021-02-08  4:27   ` Jason Wang
2021-02-08  6:37     ` Eli Cohen
2021-02-08  9:04       ` Jason Wang
2021-02-08  9:26         ` Michael S. Tsirkin
2021-02-08 10:04         ` Eli Cohen
2021-02-09  3:20           ` Jason Wang
2021-02-09  6:12             ` Eli Cohen
2021-02-09  6:37               ` Jason Wang
2021-02-10  2:30                 ` Si-Wei Liu
2021-02-10  3:53                   ` Jason Wang
2021-02-10  8:59                     ` Si-Wei Liu
2021-02-10 15:45                       ` Eli Cohen
2021-02-17  0:25                         ` Si-Wei Liu
2021-02-17  6:51                           ` Eli Cohen [this message]
2021-02-18  4:44                       ` Jason Wang
2021-02-18 12:43                         ` Si-Wei Liu
2021-02-19  3:10                           ` Jason Wang
2021-02-20  2:05                             ` Si-Wei Liu
2021-02-20  2:38                               ` Jason Wang
2021-02-20  3:00                                 ` Si-Wei Liu

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=20210217065123.GA128881@mtl-vdi-166.wap.labs.mlnx \
    --to=elic@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=si-wei.liu@oracle.com \
    --cc=virtualization@lists.linux-foundation.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).