From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 482EFA0C4C; Wed, 1 Sep 2021 07:01:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D3774013F; Wed, 1 Sep 2021 07:01:29 +0200 (CEST) Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) by mails.dpdk.org (Postfix) with ESMTP id 673CE40041 for ; Wed, 1 Sep 2021 07:01:28 +0200 (CEST) Received: by mail-vs1-f44.google.com with SMTP id x137so1466627vsx.1 for ; Tue, 31 Aug 2021 22:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DWpbNOn2FxHH+rDfeR/O4hgtaLfaawdERNdV+tQbhw0=; b=KmRsmkkCxa0SwDNxukIEDrcUYGjnVojpMNYhJEynibxzjKaUfEXIlkLBJ5td0LPbUl QsmYM5HvrxHBBv2GrIVjgb66MIVNYJhsjBiincN4ZR4RPRsv1SA7Q7WzCWNF0TaDRTBb zZNifqusPaWEGq0mnfW6qzCOvCE8+BA/mXjXQ4pSVWGg+csIKO05cibFyinYll/FsIzG XSjzhTaVHZ5AlLToL8WAVvyTKIfFisRfmHXrAsP4XepiChFOsEahnw2aPAuAoY9t74MF BssN6izKSFQWuGz9yVVV1lQcNu9jareZIa5XKpYz0gEd0nLm1pw/i5CpnSqo7vKZPtR5 DzFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DWpbNOn2FxHH+rDfeR/O4hgtaLfaawdERNdV+tQbhw0=; b=PEKVHD8XmGgtw5kkVAdMRmskgfuEANJHd3tzg6tD2ButGlv17xjvj4j5m+DpHWwQaY Qb8DaWZnzcMmpYThy3rx3pRyhrOV4ijVVofJOIa3oENv7EtIUsy0SSkb3qS04ciDYtG7 HnRuH3x1sB3e5FMcDPUr9FPYYzZnuoOLL2kCxhgcnrJ+lLHhUr4n4x45ntqjToCR2g6s NpQbX4yLneH8Tbe/mqH0EvGOlyxwslVatvqv5AfAZql2Dvkn7zpat7WFjslUV3ppPwON Mck3MwJePezVDGA/gnCAIYyVrC2MrJDrbKKrl64lXrbOGGH035moh1ZRpwClo3/UdgG3 a2xw== X-Gm-Message-State: AOAM532DyN8R9B9zHObfi+nfH2sksmYgAKzSrYSsNLFwpiFILWbXXO0v gJjeOIrZMv67DZg6cgLrR8l/Y8JJljvJIOjEBf1jyw== X-Google-Smtp-Source: ABdhPJyBj4PmyEgJrjb2EftSnCkuQ8DHjx0snYPjv1reoQU4uFbtrhDHONEoHzXwjfjLmeL1XnhwARxd4Ey5nUrzS6Q= X-Received: by 2002:a67:cf47:: with SMTP id f7mr22038125vsm.15.1630472487753; Tue, 31 Aug 2021 22:01:27 -0700 (PDT) MIME-Version: 1.0 References: <20210827051241.2448098-1-fengli@smartx.com> In-Reply-To: <20210827051241.2448098-1-fengli@smartx.com> From: Li Feng Date: Wed, 1 Sep 2021 13:01:16 +0800 Message-ID: To: Maxime Coquelin , Chenbo Xia Cc: dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ping... BTW, how could I retrigger the failure CI? The failure is not about this pa= tch. Thanks, Feng Li Li Feng =E4=BA=8E2021=E5=B9=B48=E6=9C=8827=E6=97=A5=E5= =91=A8=E4=BA=94 =E4=B8=8B=E5=8D=881:16=E5=86=99=E9=81=93=EF=BC=9A > > When getting reqs from the avail ring, the id may exceed inflight > queue size. Then the dpdk will crash forever. > > Signed-off-by: Li Feng > --- > 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_ne= t *dev, > last_io =3D inflight_split->last_inflight_io; > > if (inflight_split->used_idx !=3D used->idx) { > - inflight_split->desc[last_io].inflight =3D 0; > - rte_atomic_thread_fence(__ATOMIC_SEQ_CST); > + if (unlikely(last_io >=3D inflight_split->desc_num)) { > + VHOST_LOG_CONFIG(ERR, "last_inflight_io '%"PRIu16= "' exceeds inflight " > + "queue size (%"PRIu16").\n", last_io, > + inflight_split->desc_num); > + } else { > + inflight_split->desc[last_io].inflight =3D 0; > + rte_atomic_thread_fence(__ATOMIC_SEQ_CST); > + } > inflight_split->used_idx =3D used->idx; > } > > -- > 2.31.1 > Li Feng =E4=BA=8E2021=E5=B9=B48=E6=9C=8827=E6=97=A5=E5= =91=A8=E4=BA=94 =E4=B8=8B=E5=8D=881:16=E5=86=99=E9=81=93=EF=BC=9A > > When getting reqs from the avail ring, the id may exceed inflight > queue size. Then the dpdk will crash forever. > > Signed-off-by: Li Feng > --- > 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_ne= t *dev, > last_io =3D inflight_split->last_inflight_io; > > if (inflight_split->used_idx !=3D used->idx) { > - inflight_split->desc[last_io].inflight =3D 0; > - rte_atomic_thread_fence(__ATOMIC_SEQ_CST); > + if (unlikely(last_io >=3D inflight_split->desc_num)) { > + VHOST_LOG_CONFIG(ERR, "last_inflight_io '%"PRIu16= "' exceeds inflight " > + "queue size (%"PRIu16").\n", last_io, > + inflight_split->desc_num); > + } else { > + inflight_split->desc[last_io].inflight =3D 0; > + rte_atomic_thread_fence(__ATOMIC_SEQ_CST); > + } > inflight_split->used_idx =3D used->idx; > } > > -- > 2.31.1 >