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 D0762427E3; Mon, 20 Mar 2023 17:55:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0404410D0; Mon, 20 Mar 2023 17:55:08 +0100 (CET) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by mails.dpdk.org (Postfix) with ESMTP id 4F57E40A80 for ; Mon, 20 Mar 2023 17:55:07 +0100 (CET) Received: by mail-vs1-f41.google.com with SMTP id d2so4831911vso.9 for ; Mon, 20 Mar 2023 09:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679331306; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uGS2wZc6tzOEdBD+BNzHi6BwcMziYeRPo4rQPsUBdQg=; b=ICVordJRG6iF72Onxas0mydXzUvRcRI2yR48vhB+sdQOf9Q7uISatNv0yRDokp7KcY adeNuBmpZf7Iqwv+TlWEYcryOZfH9/W0hrs5ca3J26aqm9huZ+VleothQNHMcibfJoGI dD/J2bKZn+nGoopWekndF5xIEO1FIjnALQHvSUTN4qqMW6wHsG/px6iOrAip5XfQzgBr m2XMWY913V2dDrr7+/8w/2nK3TIn6jNdgg26xwgLoDXYD+/7lefUJt6CIx7v2kanCBH/ HIRNVxDOGB2e1dsvFOh5Q0JaDSoWlS3pUTHnudwLz4CMWZ2/QLt6xTKwQnRmWVzYN/k4 ct2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679331306; h=content-transfer-encoding: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=uGS2wZc6tzOEdBD+BNzHi6BwcMziYeRPo4rQPsUBdQg=; b=EbVad2/VqrsZhddEOSRoLZJyLK0aieo0wc0abDWo9Hi13AStm2vS/c8JuUxjmNXAlU zXtsmXcHJQMgeN8gD/pgrht3Ivd90ww3u7yCUYbPmDpnVavBcaicMShNuuovkBLuUWS7 l2oraXLjLXtHRIuz91mEDIfA3gWmDKstOV+YpUcKiWZ9kB+31J+2AigL5Fyini6Uff7t PrJL8EmdhnAW6qAKDXJYpHnfRWdE1b4A+7BSirroxIeDV5t47Oea/Sb2gj1HiiznbFqg XbSYmirlumqk1/ak7s1sDWZAXPSg0EgtscD2+t1yhUCqDgra3M+JaxiF0m+eVFU4dN9U 8nmg== X-Gm-Message-State: AO0yUKUA1SHOLOgvCYWLSWy1m6kKMdkn0LU+PyL7rQADDfjRvNr3Ls18 DASu+1HigwwRq8Fu6fCJiEHAbDPJUU+7+Q4B+n4= X-Google-Smtp-Source: AK7set/BpddR0AmIalfPp8fFQ/Mqv0whlTXz9vHvASUi7eP0YSKZF/GlC3i1CWZIo1XaIH9mC1mPnhi6yza5FHG2WTA= X-Received: by 2002:a67:d284:0:b0:416:f1ea:1001 with SMTP id z4-20020a67d284000000b00416f1ea1001mr4268141vsi.5.1679331306531; Mon, 20 Mar 2023 09:55:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jerin Jacob Date: Mon, 20 Mar 2023 22:24:40 +0530 Message-ID: Subject: Re: [PATCH v1] eventdev/timer: use loop to check for timeout events To: Shijith Thotton Cc: erik.g.carrillo@intel.com, jerinj@marvell.com, dev@dpdk.org, pbhagavatula@marvell.com 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, Mar 15, 2023 at 1:31=E2=80=AFPM Shijith Thotton wrote: > > Replaced sleep with a function to dequeue timer expiry events until > either the expected number of events have been dequeued or the specified > time has elapsed. This change closely esembles the behavior of the > tested systems. > > Signed-off-by: Shijith Thotton > -#define MAX_TRIES num_evtims > - int sum =3D 0; > - int tries =3D 0; > - bool done =3D false; > - while (!done) { > - sum +=3D rte_event_dequeue_burst(evdev, TEST_PORT_ID, evs= , > - RTE_DIM(evs), 10); > - if (sum >=3D num_evtims || ++tries >=3D MAX_TRIES) > - done =3D true; > - > - rte_delay_ms(10); Please change git comments as Fix and add Fixes: tag as it it removing non deterministic sleep based approach for verification. > - } > - > - TEST_ASSERT_EQUAL(sum, num_evtims, "Expected %d timer expiry even= ts, " > - "got %d", num_evtims, sum); > - > - TEST_ASSERT(tries < MAX_TRIES, "Exceeded max tries"); > - > - rte_delay_ms(100); > + n =3D timeout_event_dequeue(evs, RTE_DIM(evs), WAIT_TICKS(ticks))= ; > + TEST_ASSERT_EQUAL(n, num_evtims, "Expected %d timer expiry events= , got %d", > + num_evtims, n);