From patchwork Wed Aug 9 14:14:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jhascoet X-Patchwork-Id: 130044 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91E3143019; Wed, 9 Aug 2023 16:15:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3802A40691; Wed, 9 Aug 2023 16:15:29 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id E847E400D6 for ; Wed, 9 Aug 2023 16:14:04 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-4fe0e34f498so11402897e87.2 for ; Wed, 09 Aug 2023 07:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691590444; x=1692195244; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=d9Q09I0LtHFmXf2vFpeusB0iurOxqBmRKJhdrl0c+rk=; b=DK6gr8zfcYiXqF8t08LxdqiLpPIGOCrPEFA0FWR1OPcKqwERb4iKxR5IXQI4P0qlQB oXZfqt/ODHrv25Ky3l5sXnydWCjqUSZpG0zM1fa/Tv46tw/o9BZpU9EXtfICjH/fiTbP aILQAANBa1DgHuY1s/OPqmvjipyrTXqZSqxbpgxp4IrBIfwIqyT90EpQtKk2axL6+fHw 4ekvFPGZGrKTPHBVfBxhc+7zVkY8xbeM2BDKYniovXVjlJckFjivNdHCRmkQChX7MsPi TkBllj0w2C3MZ9rVlluR7hmpNxpuo+/gnaF9DLSRT7Mi5LfMOZ+S7SFsad0VMmIkFopJ 5DeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691590444; x=1692195244; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d9Q09I0LtHFmXf2vFpeusB0iurOxqBmRKJhdrl0c+rk=; b=EiZ576wJkz1dKbU994CptHqx0x75fM3nooZecfJ8n/6ieiogrohZlBt8AhzztRHwdU jC+/hFoNS3f03k2tcLLC5xwYe+wHyEM8tbSA4T1rPi1Sbiuq4SUGyf2qzuZxr0dPKeTQ KN8VOK3cQ3IJya+xc0f3URP9GeaFCQCcG7X+A962maaYIw2UdTAB78A+DkcoUkfyZioS UvPUBCmbZxAkiraLzv89nOuUpBejYNVgvDQJ70Qq9z4KrI29eCZYNynyTJhPaeYYuO2Z IrKOa2RjyK3E4Eh3z9F5QiXwlv94NQMpuMZXxkENrV5+t48pBXb+klEDqK1pgvD/rnRq euWg== X-Gm-Message-State: AOJu0YzrcZBO8LFV06lYVwE8nOZpyTfDlaJT3aYzK8wkmedq36l/PMxR vgDfFVAOanlPKnN407Mu/7s= X-Google-Smtp-Source: AGHT+IFLwKuLrih5SqBvpnefmNmE+8pMNC6rdkup61UuUwiQguqDEOzerZzy6YMrG32mHxU2jMf+yQ== X-Received: by 2002:ac2:5f4e:0:b0:4fb:81f2:4228 with SMTP id 14-20020ac25f4e000000b004fb81f24228mr1695739lfz.31.1691590443875; Wed, 09 Aug 2023 07:14:03 -0700 (PDT) Received: from coolup54.lin.mbt.kalray.eu ([217.181.231.53]) by smtp.gmail.com with ESMTPSA id dy9-20020a05640231e900b0052284228e3bsm8043705edb.8.2023.08.09.07.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 07:14:03 -0700 (PDT) From: jhascoet X-Google-Original-From: jhascoet To: david.marchand@redhat.com Cc: dev@dpdk.org, Julien Hascoet Subject: [PATCH] app: fix silent enqueue fail in test_mbuf test_refcnt_iter Date: Wed, 9 Aug 2023 16:14:01 +0200 Message-Id: <20230809141401.3702943-1-jhascoet@kalray.eu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 09 Aug 2023 16:15:28 +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 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 | 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);