DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hascoet Julien <ju.hascoet@gmail.com>
To: david.marchand@redhat.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter
Date: Fri, 18 Aug 2023 07:16:49 +0200	[thread overview]
Message-ID: <CAOkfUEgHD2C0JHFf4ng8SV4ESbwW0J6=YqV_O_Wp1vXyftPQ=Q@mail.gmail.com> (raw)
In-Reply-To: <20230810160941.3895855-1-jhascoet@kalray.eu>

[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]

Any news on that ? Thanks

Julien

On Thu, Aug 10, 2023 at 6:09 PM jhascoet <ju.hascoet@gmail.com> wrote:

> From: Julien Hascoet <ju.hascoet@gmail.com>
>
> In case of ring full state, we retry the enqueue
> operation in order to avoid mbuf loss.
>
> Fixes: af75078fece ("first public release")
>
> Signed-off-by: Julien Hascoet <ju.hascoet@gmail.com>
> ---
>  app/test/test_mbuf.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
> index efac01806b..ad18bf6378 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -1033,12 +1033,21 @@ test_refcnt_iter(unsigned int lcore, unsigned int
> iter,
>                 tref += ref;
>                 if ((ref & 1) != 0) {
>                         rte_pktmbuf_refcnt_update(m, ref);
> -                       while (ref-- != 0)
> -                               rte_ring_enqueue(refcnt_mbuf_ring, m);
> +                       while (ref-- != 0) {
> +                               /* retry in case of failure */
> +                               while (rte_ring_enqueue(refcnt_mbuf_ring,
> m) != 0) {
> +                                       /* let others consume */
> +                                       rte_pause();
> +                               }
> +                       }
>                 } else {
>                         while (ref-- != 0) {
>                                 rte_pktmbuf_refcnt_update(m, 1);
> -                               rte_ring_enqueue(refcnt_mbuf_ring, m);
> +                               /* retry in case of failure */
> +                               while (rte_ring_enqueue(refcnt_mbuf_ring,
> m) != 0) {
> +                                       /* let others consume */
> +                                       rte_pause();
> +                               }
>                         }
>                 }
>                 rte_pktmbuf_free(m);
> --
> 2.34.1
>
>

[-- Attachment #2: Type: text/html, Size: 2895 bytes --]

  reply	other threads:[~2023-08-18  7:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  5:38 jhascoet
2023-08-09  9:18 ` David Marchand
2023-08-10  6:00 ` jhascoet
2023-08-10 15:33   ` Stephen Hemminger
2023-08-10 15:40     ` [PUB] " Julien Hascoet
2023-08-10 16:09   ` jhascoet
2023-08-18  5:16     ` Hascoet Julien [this message]
2023-08-18  6:25       ` David Marchand
2023-08-22  6:34     ` jhascoet
2023-08-22  8:34       ` Olivier Matz
2023-08-24  6:51         ` Hascoet Julien
2023-08-30 16:16       ` Thomas Monjalon
2023-08-24  7:37     ` [PATCH] app: enhance error check if " jhascoet
2023-08-09 14:14 [PATCH] app: fix silent " jhascoet
2023-08-10 15:39 jhascoet

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='CAOkfUEgHD2C0JHFf4ng8SV4ESbwW0J6=YqV_O_Wp1vXyftPQ=Q@mail.gmail.com' \
    --to=ju.hascoet@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.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).