DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Saini, Abhimanyu" <abhimanyu.saini@amd.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"abhimanyu.saini@xilinx.com" <abhimanyu.saini@xilinx.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "chenbo.xia@intel.com" <chenbo.xia@intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Vijay Kumar Srivastava <vsrivast@xilinx.com>
Subject: RE: [PATCH] common/sfc_efx/base: remove VQ index check during VQ start
Date: Tue, 12 Jul 2022 05:00:22 +0000	[thread overview]
Message-ID: <SA0PR12MB43521B18DF6EC943359BFA1AE3869@SA0PR12MB4352.namprd12.prod.outlook.com> (raw)
In-Reply-To: <422a7c97-056d-56cb-8510-efaf5257b6e2@oktetlabs.ru>

[AMD Official Use Only - General]

On 7/8/22 10:37, abhimanyu.saini@xilinx.com wrote:
> > From: Abhimanyu Saini <absaini@amd.com>
> >
> > The used/avail queue indexes are not bound by queue
> > size, because the descriptor entry index is calculated
> > by a simple modulo between queue index and queue_size
> 
> "is calculated" is a bit vague since looking at the code
> I've failed to find the place where modulo operation is
> done. Don't we need to apply it these values are put
> into MCDI message?
> 

The values are added to the MCDI as is and,
the modulo is performed by the hardware.

I can append the commit message to reflect the same?

> >
> > So, do not check initial used and avail queue indexes
> > against queue size because it is possible for these
> > indexes to be greater than queue size in the
> > following cases:
> > 1) The queue is created to be migrated into, or
> > 2) The client issues a qstop/qstart after running datapath
> >
> > Fixes: 4dda72dbdeab3 ("common/sfc_efx/base: add base virtio support for
> vDPA")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Abhimanyu Saini <absaini@amd.com>
> > ---
> >   drivers/common/sfc_efx/base/rhead_virtio.c | 12 +-----------
> >   1 file changed, 1 insertion(+), 11 deletions(-)
> >
> > diff --git a/drivers/common/sfc_efx/base/rhead_virtio.c
> b/drivers/common/sfc_efx/base/rhead_virtio.c
> > index 335cb74..7f08717 100644
> > --- a/drivers/common/sfc_efx/base/rhead_virtio.c
> > +++ b/drivers/common/sfc_efx/base/rhead_virtio.c
> > @@ -47,14 +47,6 @@
> >               goto fail2;
> >       }
> >
> > -     if (evvdp != NULL) {
> > -             if ((evvdp->evvd_vq_cidx > evvcp->evvc_vq_size) ||
> > -                 (evvdp->evvd_vq_pidx > evvcp->evvc_vq_size)) {
> > -                     rc = EINVAL;
> > -                     goto fail3;
> > -             }
> > -     }
> > -
> >       req.emr_cmd = MC_CMD_VIRTIO_INIT_QUEUE;
> >       req.emr_in_buf = payload;
> >       req.emr_in_length = MC_CMD_VIRTIO_INIT_QUEUE_REQ_LEN;
> > @@ -116,15 +108,13 @@
> >
> >       if (req.emr_rc != 0) {
> >               rc = req.emr_rc;
> > -             goto fail4;
> > +             goto fail3;
> >       }
> >
> >       evvp->evv_vi_index = vi_index;
> >
> >       return (0);
> >
> > -fail4:
> > -     EFSYS_PROBE(fail4);
> >   fail3:
> >       EFSYS_PROBE(fail3);
> >   fail2:

      reply	other threads:[~2022-07-12  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  7:37 abhimanyu.saini
     [not found] ` <SA0PR12MB43523906A4BF7F13DF9B9D0FE3829@SA0PR12MB4352.namprd12.prod.outlook.com>
2022-07-08  9:17   ` Srivastava, Vijay
2022-07-11  8:25     ` Andrew Rybchenko
2022-07-11  8:31       ` David Marchand
2022-07-11  8:36 ` Andrew Rybchenko
2022-07-12  5:00   ` Saini, Abhimanyu [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=SA0PR12MB43521B18DF6EC943359BFA1AE3869@SA0PR12MB4352.namprd12.prod.outlook.com \
    --to=abhimanyu.saini@amd.com \
    --cc=abhimanyu.saini@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=vsrivast@xilinx.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).