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 98CA342B2C for ; Wed, 17 May 2023 16:02:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94B1040EE1; Wed, 17 May 2023 16:02:15 +0200 (CEST) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by mails.dpdk.org (Postfix) with ESMTP id D607C406B7; Wed, 17 May 2023 16:02:13 +0200 (CEST) Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-ba841216e92so1050658276.1; Wed, 17 May 2023 07:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684332133; x=1686924133; 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=zJEic7/0XtZ5qqVv+IylNU9IhOj7sb9YpLsyCtzsWpQ=; b=lTiTGuyHLDhtd3y7+62CITUM/4DB/klT11diAzgePm8wepaBu1p3tSadnEr+IJbluY N5itE46je3e2g8uCIEn9g1uFmLubP0kxBoEW7vCLCCTkiv3ICPTbypVfzSSCbnUz1QeR DB0HUekEZPxFGxXyflTkmoR2mg5mwGzwTJDVuWTnjlRD0wVFvlPukprB0SxUxwZvvVE1 xMzbmp/38jbeX9OZPprvMkNIxRXHrZ3e1zEZ9DTLcg3Bb0gUbmqg9mQ0Ywpm3Jmuqa0S M3UVoI5JaIUY+ocm6JxxUZfLJT+w9dnRXHH5qHbmhouV7Mbjl+BnMdItwFz4hz6XLgxD 0Uzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684332133; x=1686924133; 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=zJEic7/0XtZ5qqVv+IylNU9IhOj7sb9YpLsyCtzsWpQ=; b=bcPPszL7vEtAnTBjS8o6FEe1R7jXwN6yTdkij6ZUdVgjG/eJBd3GUmR18byY8gzzv4 2zB/4YFPRSr1lYnp9MRkSMw1Ugxv9hGFbECFWCy8BeYAsk6DIWQHw01UbUNH5m00XLY5 oCD4+q+IlUf/b+Co2EA5GffqF2EI7OE9yrCVl5JH1YBkiqV/oIQJiWklrLGLSs6Z0gLc m4t/xQQTapBuKemAXSQpGuK3XN13nv+k9kJEdBwvbphm+NePpBriDXoBtmoqiYxvKbnm yawaXlpE8PcgPKA8iNZIe8Ue/sg8cq+LUKnOQa+2UJ/Qj5f7jWPzhic4Ga2GfqQEckQH CTkQ== X-Gm-Message-State: AC+VfDwvGwTK2WKO+4K7/Ml399/kH6Djotsfx6XeRs61uc3VFlMckR57 cua1pVx2vrSyvKuO/SXCxVcSo4T2ZfuCK1e5/7rGC652xGI/BA== X-Google-Smtp-Source: ACHHUZ7nxHIVZxMKGu56+H1c91FseAjaX/fTQ3LCyFJhRFI3aFkVlVleCwWOgW/omi8Tw3Jd/6w2iaiNGyimimWO6Bk= X-Received: by 2002:a05:7500:e14f:b0:105:7248:42ca with SMTP id qb15-20020a057500e14f00b00105724842camr41588gab.22.1684332133067; Wed, 17 May 2023 07:02:13 -0700 (PDT) MIME-Version: 1.0 References: <20230412195637.450033-1-erik.g.carrillo@intel.com> In-Reply-To: <20230412195637.450033-1-erik.g.carrillo@intel.com> From: Jerin Jacob Date: Wed, 17 May 2023 19:31:46 +0530 Message-ID: Subject: Re: [PATCH] eventdev/timer: move buffer flush call To: Erik Gabriel Carrillo Cc: jerinj@marvell.com, dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Apr 13, 2023 at 1:26=E2=80=AFAM Erik Gabriel Carrillo wrote: > > The SW event timer adapter attempts to flush its event buffer on every > adapter tick. If events remain in the buffer after the attempt, another > attempt to flush won't occur until the next adapter tick, which delays > the enqueue of those events to the event device unecessarily. typo: unecessarily Updated the git commit as follows and applied to dpdk-next-net-eventdev/for-main. Thanks eventdev/timer: fix buffer flush The SW event timer adapter attempts to flush its event buffer on every adapter tick. If events remain in the buffer after the attempt, another attempt to flush won't occur until the next adapter tick, which delays the enqueue of those events to the event device unnecessarily. Move the buffer flush call so that it happens with every invocation of the service function, rather than on every adapter tick, to avoid the delay. Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter") Cc: stable@dpdk.org Signed-off-by: Erik Gabriel Carrillo > Move the buffer flush call so that it happens with every invocation of > the service function, rather than on every adapter tick, to avoid the > delay. > > Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter") > Cc: stable@dpdk.org > > Signed-off-by: Erik Gabriel Carrillo > --- > lib/eventdev/rte_event_timer_adapter.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_ev= ent_timer_adapter.c > index 23eb1d4a7d..427c4c6287 100644 > --- a/lib/eventdev/rte_event_timer_adapter.c > +++ b/lib/eventdev/rte_event_timer_adapter.c > @@ -855,17 +855,18 @@ swtim_service_func(void *arg) > sw->n_expired_timers); > sw->n_expired_timers =3D 0; > > - event_buffer_flush(&sw->buffer, > - adapter->data->event_dev_id, > - adapter->data->event_port_id, > - &nb_evs_flushed, > - &nb_evs_invalid); > - > - sw->stats.ev_enq_count +=3D nb_evs_flushed; > - sw->stats.ev_inv_count +=3D nb_evs_invalid; > sw->stats.adapter_tick_count++; > } > > + event_buffer_flush(&sw->buffer, > + adapter->data->event_dev_id, > + adapter->data->event_port_id, > + &nb_evs_flushed, > + &nb_evs_invalid); > + > + sw->stats.ev_enq_count +=3D nb_evs_flushed; > + sw->stats.ev_inv_count +=3D nb_evs_invalid; > + > rte_event_maintain(adapter->data->event_dev_id, > adapter->data->event_port_id, 0); > > -- > 2.23.0 >