DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	Li Feng <fengli@smartx.com>,
	 "Liu, Changpeng" <changpeng.liu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring
Date: Thu, 14 Oct 2021 08:28:13 +0000	[thread overview]
Message-ID: <SN6PR11MB350450ECC407D41E53B9182F9CB89@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f6e20588-e8d0-3f99-b5a3-0a3383ddb8b4@redhat.com>

Hi Changpeng,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Thursday, October 14, 2021 4:26 PM
> To: Li Feng <fengli@smartx.com>; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v1] vhost: add sanity check for resubmiting reqs in split
> ring
> 
> 
> 
> On 10/14/21 10:17, Maxime Coquelin wrote:
> > Hi Li,
> >
> > Adding Jin Yu who introduced this function.
> 
> Looks like Jin Yu has left Intel, Chenbo, could you find someone from
> the Intel SPDK team to look at it?

Could you or your team member help check this?

Thanks,
Chenbo

> 
> > On 8/27/21 07:12, Li Feng wrote:
> >> When getting reqs from the avail ring, the id may exceed inflight
> >> queue size. Then the dpdk will crash forever.
> >
> > You need to add Fixes tag and Cc stable@dpdk.org so that it can be
> > backported.
> >
> >> Signed-off-by: Li Feng <fengli@smartx.com>
> >> ---
> >>   lib/vhost/vhost_user.c | 10 ++++++++--
> >>   1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> >> index 29a4c9af60..f09d0f6a48 100644
> >> --- a/lib/vhost/vhost_user.c
> >> +++ b/lib/vhost/vhost_user.c
> >> @@ -1823,8 +1823,14 @@ vhost_check_queue_inflights_split(struct
> >> virtio_net *dev,
> >>       last_io = inflight_split->last_inflight_io;
> >>       if (inflight_split->used_idx != used->idx) {
> >> -        inflight_split->desc[last_io].inflight = 0;
> >> -        rte_atomic_thread_fence(__ATOMIC_SEQ_CST);
> >> +        if (unlikely(last_io >= inflight_split->desc_num)) {
> >> +            VHOST_LOG_CONFIG(ERR, "last_inflight_io '%"PRIu16"'
> >> exceeds inflight "
> >> +                "queue size (%"PRIu16").\n", last_io,
> >> +                inflight_split->desc_num);
> >
> > If such error happens, shouldn't we return RTE_VHOST_MSG_RESULT_ERR
> > instead of just logging an error?
> >
> >> +        } else {
> >> +            inflight_split->desc[last_io].inflight = 0;
> >> +            rte_atomic_thread_fence(__ATOMIC_SEQ_CST);
> >> +        }
> >>           inflight_split->used_idx = used->idx;
> >>       }
> >>
> >
> > Regards,
> > Maxime


  reply	other threads:[~2021-10-14  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27  5:12 Li Feng
2021-09-01  5:01 ` Li Feng
2021-10-14  8:17 ` Maxime Coquelin
2021-10-14  8:25   ` Maxime Coquelin
2021-10-14  8:28     ` Xia, Chenbo [this message]
2021-10-18  1:01       ` Liu, Changpeng
2021-10-14 11:25   ` Li Feng
2021-10-14 11:38     ` Maxime Coquelin
2021-10-14 11:54       ` Li Feng
2021-10-14 12:40 ` [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the " Li Feng
2021-10-15  8:51   ` Maxime Coquelin
2021-10-15  9:25     ` Li Feng
2021-10-21 12:32       ` 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=SN6PR11MB350450ECC407D41E53B9182F9CB89@SN6PR11MB3504.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengli@smartx.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).