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 1A0FF42FFA; Mon, 7 Aug 2023 10:02:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADE60410D3; Mon, 7 Aug 2023 10:02:05 +0200 (CEST) Received: from smtpout30.security-mail.net (smtpout30.security-mail.net [85.31.212.34]) by mails.dpdk.org (Postfix) with ESMTP id DFB5040A8B for ; Mon, 7 Aug 2023 10:02:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id ABBD21688AE for ; Mon, 7 Aug 2023 10:02:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1691395324; bh=Y1qsngVK2WOtWatH/o0LOrTkLq+iljJPx1kIg10ZQ9I=; h=From:To:CC:Subject:Date:References:In-Reply-To; b=Y6Xt79R6BGQ54efnVlwtaBc9P1di4aIxLz4tik1+LaP+0NbZDSo8nN6djAIWrnTSk sorQgXdYtuW9+Z+uHefGMaIrWvjkFKEN63WC6auMJaMyQ0ABhLsWfbW6JOlKkbVA0r HxaNAjUElEBLcvLneKCD5zb4aEiMh6pAHEDUe3sk= Received: from fx304 (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id 8BFCE168A1E; Mon, 7 Aug 2023 10:02:04 +0200 (CEST) Received: from FRA01-MR2-obe.outbound.protection.outlook.com (mail-mr2fra01on0103.outbound.protection.outlook.com [104.47.25.103]) by fx304.security-mail.net (Postfix) with ESMTPS id EFC6A168342; Mon, 7 Aug 2023 10:02:03 +0200 (CEST) Received: from MR1P264MB1729.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:5::17) by MRZP264MB2347.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:1c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 08:02:02 +0000 Received: from MR1P264MB1729.FRAP264.PROD.OUTLOOK.COM ([fe80::77f5:4fc5:a7f9:f855]) by MR1P264MB1729.FRAP264.PROD.OUTLOOK.COM ([fe80::77f5:4fc5:a7f9:f855%7]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 08:02:02 +0000 X-Virus-Scanned: E-securemail Secumail-id: <12ed5.64d0a4fb.68ef4.0> ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYi/anv1oy5q4Bzrspqzr8yLRj/H+BwGsShkAfZwoU4uBIKTSV+ikYAwizpKvb7UKTxDDhSKnHqgaQ8NKIwQ8qk6baq0nYWAR9Y7cM31du4WnaQqDShIuoRcR6Kdb4RCGX9n104idbI0NuG/KkUVP3lheE7fAifL/GvZxNnPJk0AS2s8Y5F2ZF222+o6XZhVfmXtQptjWBPM5arGjXzxjTowtlgATGrEBVIXXoG4L9FOYNSLA9APtI3bKG7OKb/Hn0uN4FClZtO21+kdo3MWa1oK3CDm+R9GNklgRDVUNFuuV9Kwf0VFyw777x9SdHhFq29yXmd/KzN9CQkEk2BXHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BMDwqrftXgy47efmRXVogQHebHQipVaiM4qCngdqq3k=; b=UYfFEsiHlYTQsYn+AE7h8K/lLX3llkKKdzsEMLFevMg+nec3LV1+eft7brm4RrmEWijaZHvOLrZu8OAbnO0nguc/6ZipiODM+zFrSZurp06ZFC7ufKyg5Ri46uCpcW4SNi7qF9tLitg4ga28newtfjI+QeqoALJCInAZatifOgsE3PyEHXDPvVCNN06f+GQbRoTkreDnyASuDgumVztPBuTxLzMgrQzIuD/GxQzva33QLvP4Arhdu3PVmxpLhZxRHgjUT8wn7nyviWtmXlqk1OD/eVMklFRpBHRre0SmJudvTi9JXl4jdNAjRVFqjOJB131uKTjUmRRb2Socd4JOqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kalrayinc.com; dmarc=pass action=none header.from=kalrayinc.com; dkim=pass header.d=kalrayinc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalrayinc.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BMDwqrftXgy47efmRXVogQHebHQipVaiM4qCngdqq3k=; b=N9TruETA59+JOrxyhYu4C1FNv2cT4vb84LWkhOkThCXDIwfRCEnRmNHD//79xdEKxpm/TKCoZiK3Ac+t1086FsNQroIC5VX8IPVBdRUeH2eovE7rHBrPXPy2xDN9QCEx0HFNmt6YYZ29saUNBaKG3wJIXYhKEWwdvv4kIJde/gIJmsqjW9Woa4kbMGYCUUMBYhzB+Qh0VPww/71R5Q8cXDQgH+2e4dCOKE3W7gIeSOvrYI/geb/dYa7kwV88lRXuzSBYRi6oiBjItsi6htbS5CQVkc2hLqIBKeRzLrJMVu2IxfXahZ7rOUnt0kPjLhV/ztjLk6xp68a9oB8LZfjGWg== From: Julien Hascoet To: David Marchand , Olivier Matz CC: dev@dpdk.org Subject: RE: [TEST] dpdk/app/test/test_mbuf.c test_refcnt_mbuf instability + fix proposal Thread-Topic: [TEST] dpdk/app/test/test_mbuf.c test_refcnt_mbuf instability + fix proposal Thread-Index: AQHZyPXqJYRcwSX/10G/C+IoeOYWlq/ebyWAgAAI2l8= Date: Mon, 7 Aug 2023 08:02:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: fr-FR, en-GB, en-US Content-Language: fr-fr X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kalrayinc.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MR1P264MB1729:EE_|MRZP264MB2347:EE_ x-ms-office365-filtering-correlation-id: 227c8a26-5e4d-499c-aea7-08db971c951f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R5fHFqcQZ9QN250tgBuFis19XJzo9WvbbMwMt9C5zFNGvcin5NnptXHkL//Qt22/+31iIXsNHEUFgztR2zz55ieYGkUI2MpBvSmB01dRCwi8LiU3e6il1p7JFNEpzVAF7EgEUXV1MeH9qNv5rNCKIXn16fyJsFOlKRxRzmpdji2GSx4Do5S8fkIizR3B/Bc2mlV5ycZNuV5Bo4Brd8kwPNiQGU2Nvmwfm+tJaR8t9qmXuCaogh7/g96ICL7/evpsJe/j2K+KYytU3xpU7qpnpOontlCkAkHD4/mnBLmjei89GglFE4e5d6gs3DMh06wnuqInBMb20fwP5lP6C4v83MF84y+UIwln/9cUB1sqDiOLOnN40tYQanODlAIpYa9/5xb2LNFBXtEKJN5j83N3Wrl78gUAW7gZ19axKGbMaGjuN1r++B1V9JeBhdTV3fBAK+ORZaFEpgQtv+n+jjUaNZh3mjpqWyXJFIG19szg3iTqb2HumhenCPnVze4YC0F0njFXfAPg5B8IHKyUrgYDGC2arJIVo/8w/pBFNXgBzvhP41JAfprLb0j1Ox8GwfMQ9Cnw9nmmLexHqTW6qu6SL9VUAqOFBXuQLW7GQdkisHGZhUCQf0XtP4xzHH8eVare x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MR1P264MB1729.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(451199021)(1800799003)(186006)(9686003)(26005)(55016003)(6506007)(53546011)(110136005)(38100700002)(5660300002)(38070700005)(52536014)(86362001)(4326008)(2906002)(66946007)(91956017)(64756008)(66556008)(76116006)(66476007)(41300700001)(33656002)(66446008)(8936002)(8676002)(316002)(99936003)(71200400001)(7696005)(122000001)(478600001)(19627405001)(66574015)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: hE36cKajVcY2cnk2OsFfYwsuePVPIdZofdWVw8iHXmQLjMvOtTPF6vd/zTYNkDfyn3vUijaVCQHtnjd4FWcnp76R/DZi+PFJXyrThFTvLFV1uTNALliiTMWTrSI23vs0MFoOVS98WFqoQUebnzJL/RW9ELiyrGjUyRjwwAJxQtumFTMy+W3rgBrfQ0zsB2JlBiM8W6VDeBTekW//wA2KEEyA7ZLsKTY7TMcWfXAstD2bEs1sdp8xna/dzc9t6nAXtBtwNEMcKVjCm7Y01gcRzO9QxxyfraKO8/2DCm2YavwCMUgs5G9izJMcQubNd43nTnBHGLljK7187jNlHERCGxEnzZ+u3dxwJuqfRKwEsoRbnQo+8cm1aT3bDC8KF256BgzbNUGcZBJFCkzAFPe1GYr7u9yqRM2NG07yHhQq7XFn1ZF7VtRHZzF+kcnPEOsqfItKCF/NPS2r8ybRMsKECpgYsC8YXbkfPwKgTjM5TjKbxHZd2Ekokni0Mq2HOX5sQGt/1CXaJeq3GFUmF3BhSbkTe3ogwb7+MsANN3Lja4FmYMjuAjRBPWoDBIl7uckYwAFtygHf4xqg6M18gV+j99VkjdjpU4uRrClW6CX6NjZ0q4C3ZCV2pOIqgakQUefD+P0JOD/NtbV6OSyR2BENloUq07f778OJLKJ52Z4U1qLaa8pV3mFuSCTWhrtg6uaSO/21qM55jXuoJZhfCPtnxWokAFuImuI/TgqAQtaTFQT95d2x9f0O6fqH07BVGYcMEo3HU+AgBM6RbevNEBHtqTkqScsdDtT6qYRDOAkUegI3wOn6r+53/AhLV1D5ZnHNiiGQLqH5NZd5Uwo7V2F6vsvEE13KgJIG3/FXLIjFz1YjFQ8DHeveCPAhXrEAY4FeytTYNn76rYIYCmNJQ41Whx+J+z+zDQ/G0OiSM2icn8xJ7OzpBGjfgCh00ZIpmvH3 gybVNkBmm4f1RICsn6jNPGzTL8VQBw5zaLKFy2eSadThnay7W8AyfMTV9GipsXtyyzSraRSPQHbwJXMCnOLFz7FOH/ImekggiBAu8InO5AObzde76hVOtgwv9SvGj7HeC7DdJ/mphycNz+dq6xPCv1WjEX3y38kbtghjt76gp2PvNmsVb4YQpZdk5IV0X3HmbxexkAf1YAme5z6HtSxeQt5HjqauNtPC3WL4tlmDYge1iuuTESTmewZb0XhOg1VcDK1kJ5Np/YStRiv8OzjWI7FcFauPHnjTlw+Do0C44hIeZu1tOKzvYUzVWZxzeVvidC0YFJwpzEKOFXpL7fLM1U9SfjaChP4DJ4tLWReO/7Rwu1VPVGa2DkfWG8Hw+BL/clHYtdgG66iSLZXDTxZgjJSJdFmx2IM6YoB3FtfryvdVvlrGgKIlm+gQthqyXnyK9QVhMLyq/MPWqdf1MaUe4STD5LsoXzn81G0wmqugFlgdgrPg0WzqsGHDmHZI0RWenj6BZeseiby3xl/+qcvID0hsdlpL8raffl2Krq8Wi1ywMDjFh+SqObidw6z4Cwm7DT1zs4vbSsqo5lqkXJNKMaA/3K8fzcGNkFuSN/nHKwi/p1zEn1FbnfjTMGdC7JgD Content-Type: multipart/mixed; boundary=secu_8ca76acb5c97b8ab731a4125b467b7a8_part1 MIME-Version: 1.0 X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MR1P264MB1729.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 227c8a26-5e4d-499c-aea7-08db971c951f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2023 08:02:01.9362 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8931925d-7620-4a64-b7fe-20afd86363d3 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 14CP8EAcxpPzN3M17hVXuNgKmggJlrrR1UxUBWiy4w+zCKbAD9/xPHiIU7yfwMAu4UqzncttwJaocqDBJEhIiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MRZP264MB2347 X-ALTERMIMEV2_out: done Content-Transfer-Encoding: 8bit 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 This message is in MIME format. --secu_8ca76acb5c97b8ab731a4125b467b7a8_part1 Content-Type: multipart/alternative; boundary=secu_8ca76acb5c97b8ab731a4125b467b7a8_part2 Content-Transfer-Encoding: 8bit This message is in MIME format. --secu_8ca76acb5c97b8ab731a4125b467b7a8_part2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Here is a patch, I let you amend it if needed as I'm a beginner in the dpdk project Thanks ________________________________ De : David Marchand Envoyé : lundi 7 août 2023 09:26 À : Julien Hascoet ; Olivier Matz Cc : dev@dpdk.org Objet : Re: [TEST] dpdk/app/test/test_mbuf.c test_refcnt_mbuf instability + fix proposal Hello Julien, On Mon, Aug 7, 2023 at 8:19 AM Julien Hascoet wrote: > from my understanding after debugging, in test_refcnt_iter the return value of rte_ring_enqueue is not checked; leading to lack of expected mbufs at the end checks. > > Here is some fix proposal that seems to work after running endurance tests for several days: > > diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c > index b4f436b5e2..8a5d26e4f6 100644 > --- a/app/test/test_mbuf.c > +++ b/app/test/test_mbuf.c > @@ -1033,12 +1033,17 @@ 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) > + ; > + } > } 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) > + ; > } > } > rte_pktmbuf_free(m); > > Can you confirm ? This analysis looks correct (though failing to enqueue in this unit test seems strange to me). Could you send a fix with a Fixes: line in the commitlog, and copying the maintainer? Thanks. -- David Marchand --secu_8ca76acb5c97b8ab731a4125b467b7a8_part2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Here is a patch, I let you amend it if needed as I'm a beginner in the dpdk project

Thanks

De : David Marchand <david.marchand@redhat.com>
Envoyé : lundi 7 août 2023 09:26
À : Julien Hascoet <jhascoet@kalrayinc.com>; Olivier Matz <olivier.matz@6wind.com>
Cc : dev@dpdk.org <dev@dpdk.org>
Objet : Re: [TEST] dpdk/app/test/test_mbuf.c test_refcnt_mbuf instability + fix proposal
 
Hello Julien,

On Mon, Aug 7, 2023 at 8:19 AM Julien Hascoet <jhascoet@kalrayinc.com> wrote:
> from my understanding after debugging, in test_refcnt_iter the return value of rte_ring_enqueue is not checked; leading to lack of expected mbufs at the end checks.
>
> Here is some fix proposal that seems to work after running endurance tests for several days:
>
> diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
> index b4f436b5e2..8a5d26e4f6 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -1033,12 +1033,17 @@ 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)
> +                                       ;
> +                       }
>                 } 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)
> +                                       ;
>                         }
>                 }
>                 rte_pktmbuf_free(m);
>
> Can you confirm ?

This analysis looks correct (though failing to enqueue in this unit
test seems strange to me).
Could you send a fix with a Fixes: line in the commitlog, and copying
the maintainer?

Thanks.


--
David Marchand





--secu_8ca76acb5c97b8ab731a4125b467b7a8_part2-- --secu_8ca76acb5c97b8ab731a4125b467b7a8_part1 Content-Type: text/x-patch; name=0001-app-fix-silent-enqueue-fail-in-test_mbuf-test_refcnt.patch Content-Description: 0001-app-fix-silent-enqueue-fail-in-test_mbuf-test_refcnt.patch Content-Disposition: attachment; filename=0001-app-fix-silent-enqueue-fail-in-test_mbuf-test_refcnt.patch; size=1218; creation-date="Mon, 07 Aug 2023 08:01:28 GMT"; modification-date="Mon, 07 Aug 2023 08:01:31 GMT" >From 6b57da16f3eca121c91ac0c250c93d4d017eea55 Mon Sep 17 00:00:00 2001 From: jhascoet Date: Mon, 7 Aug 2023 09:54:30 +0200 Subject: [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter In case of ring full state, we retry the enqueue operation in order to avoid mbuf loss. Fixes: af75078fece ("first public release") --- app/test/test_mbuf.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index efac01806b..be114e3302 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -1033,12 +1033,17 @@ 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) + ; + } } 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) + ; } } rte_pktmbuf_free(m); -- 2.34.1 --secu_8ca76acb5c97b8ab731a4125b467b7a8_part1--