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 7A96EA034F; Wed, 10 Nov 2021 19:56:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C7CA4113C; Wed, 10 Nov 2021 19:56:58 +0100 (CET) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id 426D740DDA for ; Wed, 10 Nov 2021 19:56:56 +0100 (CET) Received: by mail-io1-f54.google.com with SMTP id v23so3972335iom.12 for ; Wed, 10 Nov 2021 10:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6JkCaQsI0oS4dhDxRGxrU30Cc0appBTWgJgLW3CRW7U=; b=mY/HgkBinMDDwYVhLkZO2aZP0yJB1GihNDlhvegiYYUB6zRD8DKZ40oBmZOHY0DxFr YO/EyUDKJ9qJF7wksENvwtL6T1ZMYJuQ9tPlxhz/xpB2jbf0iVp0PR/xt4xn2FNVTFNw Gz4jJsCQ3nKKXikwLLYaI/uVTFtNkhboYAeZPwOr0ZQNxFoU+0YQoty/vYlZ6XE6umC6 WEofu/MiWgKc5SFKw81oU4Wh15lnHEQVDfzOA8LJpTFGE5afx0UF1I1wZaAZrD2xpJtZ Dp2ccxHoDeR8cKvNw+S3rNb4xPJIPxc2fP3MkAyOPuKF0iO865iZkAiuQJ+GlrRxqU4t xQYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6JkCaQsI0oS4dhDxRGxrU30Cc0appBTWgJgLW3CRW7U=; b=t7sEjo6dtLgazVCHfKu/hLQSwMoPYzKluyShJO6OAX2B4fp2qSed31ed8iPMjriLEj Ynimrr4zIZLKmgu0FF1qgEW1UrSHgwUmqrzbW348imnOzbrk/lasRZ956GnSiCkoRVLz qIf9ooNDstOpA4bOD/NzBj2hsPLeISopoScKaHjiIUHFN2D/BqJ9p7hIuqib9SR7RNOA L7Ez4NeexAizHPebc65KlgGG5jkIn23ifL3WnwE6xPQQTvaips2+lVSOPGXIcw6indPn 8X4sB3g8de25YqQZ8t03kFdRfYVFGcfJi7Rse34nD/S99965f575BXm8E7ib8aNxe385 vB3g== X-Gm-Message-State: AOAM532ollZ735a9YX7wcOuKHdaUczGSr0bY85YCB1d4XdoeFEOq7AMI eV+dJzwyZOcL855C311AVHk8pf+Lozll8cigT28= X-Google-Smtp-Source: ABdhPJxXpiLm7V0F35LgCeCb1CH3GYnBKrlVtdNvosRFncGv8WRFfQES/vCkkIB9MOZpP8JBHMfFzD6wEL+zBmndXwg= X-Received: by 2002:a6b:7803:: with SMTP id j3mr816886iom.185.1636570615600; Wed, 10 Nov 2021 10:56:55 -0800 (PST) MIME-Version: 1.0 References: <20211110111400.21475-1-mattias.ronnblom@ericsson.com> In-Reply-To: From: Jerin Jacob Date: Thu, 11 Nov 2021 00:26:29 +0530 Message-ID: Subject: Re: [PATCH v2] eventdev: fix Rx adapter stalls on event device backpressure To: "Jayatheerthan, Jay" Cc: "mattias.ronnblom" , "Kundapura, Ganapati" , "jerinj@marvell.com" , "dev @ dpdk . org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Nov 10, 2021 at 4:53 PM Jayatheerthan, Jay wrote: > > Looks good. Thanks for posting this change! > > Acked-by: Jay Jayatheerthan Changed the subject to: eventdev/eth_rx: fix stalls on event device backpre= ssure Applied to dpdk-next-net-eventdev/for-main. Thanks > > > -----Original Message----- > > From: Mattias R=C3=B6nnblom > > Sent: Wednesday, November 10, 2021 4:44 PM > > To: jerinjacobk@gmail.com; Jayatheerthan, Jay ; Kundapura, Ganapati > > ; jerinj@marvell.com > > Cc: dev @ dpdk . org ; mattias.ronnblom > > Subject: [PATCH v2] eventdev: fix Rx adapter stalls on event device bac= kpressure > > > > In the Eventdev Ethernet RX Adapter, correctly handle the case where > > the circular enqueue buffer head and last index point to the same > > element. > > > > This bug may be triggered in case there is backpressure from the event > > device to the RX adapter. > > > > v2: > > * Corrected bug description > > > > Fixes: 8113fd15e229 ("eventdev/eth_rx: make enqueue buffer circular") > > Cc: ganapati.kundapura@intel.com > > > > Signed-off-by: Mattias R=C3=B6nnblom > > --- > > lib/eventdev/rte_event_eth_rx_adapter.c | 22 ++++++++++++++-------- > > 1 file changed, 14 insertions(+), 8 deletions(-) > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte= _event_eth_rx_adapter.c > > index 56318b5a6f..809416d9b7 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > @@ -777,19 +777,25 @@ rxa_flush_event_buffer(struct event_eth_rx_adapte= r *rx_adapter, > > struct eth_event_enqueue_buffer *buf, > > struct rte_event_eth_rx_adapter_stats *stats) > > { > > - uint16_t count =3D buf->last ? buf->last - buf->head : buf->count= ; > > + uint16_t count =3D buf->count; > > + uint16_t n =3D 0; > > > > if (!count) > > return 0; > > > > - uint16_t n =3D rte_event_enqueue_new_burst(rx_adapter->eventdev_i= d, > > - rx_adapter->event_port_id, > > - &buf->events[buf->head], > > - count); > > - if (n !=3D count) > > - stats->rx_enq_retry++; > > + if (buf->last) > > + count =3D buf->last - buf->head; > > + > > + if (count) { > > + n =3D rte_event_enqueue_new_burst(rx_adapter->eventdev_id= , > > + rx_adapter->event_port_id= , > > + &buf->events[buf->head], > > + count); > > + if (n !=3D count) > > + stats->rx_enq_retry++; > > > > - buf->head +=3D n; > > + buf->head +=3D n; > > + } > > > > if (buf->last && n =3D=3D count) { > > uint16_t n1; > > -- > > 2.25.1 >