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 0E2BA42F79; Fri, 18 Aug 2023 09:22:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6AB640ED9; Fri, 18 Aug 2023 09:22:58 +0200 (CEST) Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) by mails.dpdk.org (Postfix) with ESMTP id 6FD6340395 for ; Fri, 18 Aug 2023 07:17:01 +0200 (CEST) Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-56d6dfa8b52so388355eaf.3 for ; Thu, 17 Aug 2023 22:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692335820; x=1692940620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NRe04H2toKDfEDGiV0ihgLExtnIgFKmb0pf8Ux8YCoM=; b=XqCT2eBwy2wzvYGRY0GMGQB4wV0E8eZ5iVZ9vtlVTMs9rlW3K48iFwGw98wswYOny0 3ccvvtEv/KXlZVKYiBs8Z1luSWFIkKcwouzMg5Jd0NRwSEzKERpz2GfE+A8OT0ldwzKH 5eY4e6ECEcRtKsNNIFtjuO+a6YDZcTNcxFV6pac6UT2TkfjYN3uBcddbOdgKvd1ON9sU CqK7s5PQsO1dRagF/7asAu7BnImUgcoe88JYhYOqXaDSuKpbU3IN+e6puTWXmdV+u9O/ ht3+CTRugcLevn2Pk7Y0Tl3OSQaQJLCt0ROJdhhxKQiHivd2k0tnW4KekUDY7XUG8Cj5 RhYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692335820; x=1692940620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NRe04H2toKDfEDGiV0ihgLExtnIgFKmb0pf8Ux8YCoM=; b=Os1O5lW3q4DIJPVtlW2QhSVxq3QgBD6TANeltq5dSZeBjofNeP0xq+Ab/OnnKnofhW 2EUM+eYdWQnjwSoc92Qk7AZmTj6AUDfzrFrr3M/Ba16x1TqaErmOQEF1OE23RSAg2IsZ PC6U0jmKJcZ/np3p3xTdCutwDurHof/1m17EKz1pO08DiTztZWkbfSMiiOiaiUXjotNq W8WHwRLCgeZPcUoB4q7OovXTL5Fijl0T6j9wlgeS5uGznKtJqGhoesgVIvivcY0Ka/IS 9OW8qwNda1wpzbvn4FtVEiin9fc/jkAlbtIFDxEzGBHWqtgwX34TRT5+NYjGt2x7ALph 60Fw== X-Gm-Message-State: AOJu0YxsmZdv/ljFGxJqGjWRdB3kY3pLqoS65R48MU8bS62oj9fYSAv/ D3K4yc0IALd4W21cjcjWhi702PQpxrnXCYoTQQY= X-Google-Smtp-Source: AGHT+IFSr9rJK4vWNYX4+U+zLK9CJY3jdW9D/dNimzctiuVgr5oocBLHruf+AO+sZsvn1PbJS3rzajY1R4So6hswihs= X-Received: by 2002:a05:6358:c11:b0:137:8c47:ba55 with SMTP id f17-20020a0563580c1100b001378c47ba55mr1929479rwj.1.1692335820509; Thu, 17 Aug 2023 22:17:00 -0700 (PDT) MIME-Version: 1.0 References: <20230810060030.3759835-1-jhascoet@kalray.eu> <20230810160941.3895855-1-jhascoet@kalray.eu> In-Reply-To: <20230810160941.3895855-1-jhascoet@kalray.eu> From: Hascoet Julien Date: Fri, 18 Aug 2023 07:16:49 +0200 Message-ID: Subject: Re: [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter To: david.marchand@redhat.com Cc: dev@dpdk.org Content-Type: multipart/alternative; boundary="0000000000006c153d06032ba301" X-Mailman-Approved-At: Fri, 18 Aug 2023 09:22:58 +0200 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 --0000000000006c153d06032ba301 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Any news on that ? Thanks Julien On Thu, Aug 10, 2023 at 6:09=E2=80=AFPM jhascoet wro= te: > From: Julien Hascoet > > 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 > --- > 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 +=3D ref; > if ((ref & 1) !=3D 0) { > rte_pktmbuf_refcnt_update(m, ref); > - while (ref-- !=3D 0) > - rte_ring_enqueue(refcnt_mbuf_ring, m); > + while (ref-- !=3D 0) { > + /* retry in case of failure */ > + while (rte_ring_enqueue(refcnt_mbuf_ring, > m) !=3D 0) { > + /* let others consume */ > + rte_pause(); > + } > + } > } else { > while (ref-- !=3D 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) !=3D 0) { > + /* let others consume */ > + rte_pause(); > + } > } > } > rte_pktmbuf_free(m); > -- > 2.34.1 > > --0000000000006c153d06032ba301 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj5BbnkgbmV3cyBvbiB0aGF0ID8gVGhhbmtzPC9kaXY+PGRpdj48 YnI+PC9kaXY+PGRpdj5KdWxpZW48YnI+PC9kaXY+PC9kaXY+PGJyPjxkaXYgY2xhc3M9ImdtYWls X3F1b3RlIj48ZGl2IGRpcj0ibHRyIi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