From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0CDF7440E7;
	Mon, 27 May 2024 17:30:46 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id EEF67402D4;
	Mon, 27 May 2024 17:30:43 +0200 (CEST)
Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com
 [209.85.160.179])
 by mails.dpdk.org (Postfix) with ESMTP id 1BBA3402C5
 for <dev@dpdk.org>; Mon, 27 May 2024 17:30:43 +0200 (CEST)
Received: by mail-qt1-f179.google.com with SMTP id
 d75a77b69052e-43fc100549cso8290461cf.0
 for <dev@dpdk.org>; Mon, 27 May 2024 08:30:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716823842; x=1717428642; darn=dpdk.org;
 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=TJuzzHVWaQu7KzQCRmwzyxjmcgeOwroICyfQqCVAgTE=;
 b=i2+4Pfb4ozeAxcB+1FQ7EdAl1SNTA/0Kqj6SUQTkYkjsrUqv+ASyuyM5H0bAC+OUef
 6SyrEXLNZdSqzIzOAbxYNL5HV0nzcHXwgn8FUohgNwmWtU3ttLwQKLhrRiKg7uScMwlz
 nwBC9dKg+9cAdcjNth5K3bWupFvn8VV3FS1pzaLnsXLov9mDe8qweZXH3kieTUklykzd
 2bXyc0PczGrAa+RO+S05UfZ/LQdGJiGYWOGJypNs6dnOb+bQ7DfeYwyOsGgEKxt2G2xI
 xqaotdvjPKfMpQlmnHS+RD2soWde/Q9Q/PpeuQULe0JIgMCi/et0tPsg9JAKJZNmoOiZ
 2AlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716823842; x=1717428642;
 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=TJuzzHVWaQu7KzQCRmwzyxjmcgeOwroICyfQqCVAgTE=;
 b=N4hqjpdgSy86Gu/Ty9avf3WsXgBTsBQiq1VlYSXNUOvFA7x7RAfCeXxBWVJOPa4sxx
 16z2y2H6By2Q2mkpgZ93CdKcgkzj93kL7nxo0M0aMX0oYe7OlByfoiSE48x0RSFYembH
 mY8sH0nDzITalkEdP878y08Ube3swhRb+uR2+JtwreROJIHfqbLYVj+ttN9zmi3Jvd8L
 EV81OS8RoTWIEbl8/4muMmfnj5utKSUFDGsHj30VDSCAXYYx/pU23OH/AsehCzfk4JEL
 l7MM4Y46NFYJKC/QC06582yudprUc6RkTyv8J3Otp/lk8/W+uodXc+pjGZ+o4qmL+5vt
 QrsA==
X-Gm-Message-State: AOJu0Yw5ntLwRLjPpKn61HFeY2B1pftD6U5rTh9vG3O+ErnT6S9N2SHV
 w+lwdLjI4DbQLYsZBnJbjkR6B05QZeXcPzBGUPqYQLnL/BQLe4Xoxl7yUSrHQlKqNaEl9RE5yP6
 RFql5KDl7C9Sldj4EviG4ZTvOUzY=
X-Google-Smtp-Source: AGHT+IHGe6x4dmjbOKO/w4s98ZxEGJeXlFHvNnK/XdE2+aHFYachhhVYqhBMLDM1XaY6xojvJvdh+w6CwTlkRjkbwzI=
X-Received: by 2002:ac8:5714:0:b0:43d:eba9:6fcc with SMTP id
 d75a77b69052e-43fb0e7a38amr115361131cf.18.1716823842342; Mon, 27 May 2024
 08:30:42 -0700 (PDT)
MIME-Version: 1.0
References: <20240501194620.1199357-1-abdullah.sevincer@intel.com>
 <20240501194620.1199357-4-abdullah.sevincer@intel.com>
In-Reply-To: <20240501194620.1199357-4-abdullah.sevincer@intel.com>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Mon, 27 May 2024 21:00:16 +0530
Message-ID: <CALBAE1NsnNjK3Uca7EX3j4nmCCM7gsVB5v1YE3=q81mTPqutnA@mail.gmail.com>
Subject: Re: [PATCH v4 3/3] event/dlb2: enhance DLB credit handling
To: Abdullah Sevincer <abdullah.sevincer@intel.com>, 
 "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: dev@dpdk.org, jerinj@marvell.com, mike.ximing.chen@intel.com, 
 tirthendu.sarkar@intel.com, pravin.pathak@intel.com, 
 shivani.doneria@intel.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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Thu, May 2, 2024 at 1:27=E2=80=AFAM Abdullah Sevincer
<abdullah.sevincer@intel.com> wrote:
>
> This commit improves DLB credit handling scenarios when
> ports hold on to credits but can't release them due to insufficient
> accumulation (less than 2 * credit quanta).
>
> Worker ports now release all accumulated credits when back-to-back
> zero poll count reaches preset threshold.
>
> Producer ports release all accumulated credits if enqueue fails for a
> consecutive number of retries.
>
> In a multi-producer system, some producer(s) may exit early while
> holding on to credits. Now these are released during port unlink
> which needs to be performed by the application.
>
> test-eventdev is modified to call rte_event_port_unlink() to release
> any accumulated credits by producer ports.
>
> Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
> ---
>  app/test-eventdev/test_perf_common.c |  20 +--

1) Spotted non-driver changes in driver patches, Please send
test-eventdev changes as separate commit with complete rational.
2) Fix CI issues http://mails.dpdk.org/archives/test-report/2024-May/657683=
.html



>  drivers/event/dlb2/dlb2.c            | 203 +++++++++++++++++++++------
>  drivers/event/dlb2/dlb2_priv.h       |   1 +
>  drivers/event/dlb2/meson.build       |  12 ++
>  drivers/event/dlb2/meson_options.txt |   6 +
>  5 files changed, 194 insertions(+), 48 deletions(-)
>  create mode 100644 drivers/event/dlb2/meson_options.txt
>

>
>  static inline uint64_t
> diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
> index 11bbe30d7b..2c341a5845 100644
> --- a/drivers/event/dlb2/dlb2.c
> +++ b/drivers/event/dlb2/dlb2.c
> @@ -43,7 +43,47 @@
>   * to DLB can go ahead of relevant application writes like updates to bu=
ffers
>   * being sent with event
>   */
> +#ifndef DLB2_BYPASS_FENCE_ON_PP
>  #define DLB2_BYPASS_FENCE_ON_PP 0  /* 1 =3D=3D Bypass fence, 0 =3D=3D do=
 not bypass */
> +#endif
> +
> +/* HW credit checks can only be turned off for DLB2 device if following
> + * is true for each created eventdev
> + * LDB credits <=3D DIR credits + minimum CQ Depth
> + * (CQ Depth is minimum of all ports configured within eventdev)
> + * This needs to be true for all eventdevs created on any DLB2 device
> + * managed by this driver.
> + * DLB2.5 does not any such restriction as it has single credit pool
> + */
> +#ifndef DLB_HW_CREDITS_CHECKS
> +#define DLB_HW_CREDITS_CHECKS 1
> +#endif
> +
> +/*
> + * SW credit checks can only be turned off if application has a way to
> + * limit input events to the eventdev below assigned credit limit
> + */
> +#ifndef DLB_SW_CREDITS_CHECKS
> +#define DLB_SW_CREDITS_CHECKS 1
> +#endif
> +

> +
> +static void dlb2_check_and_return_credits(struct dlb2_eventdev_port *ev_=
port,
> +                                         bool cond, uint32_t threshold)
> +{
> +#if DLB_SW_CREDITS_CHECKS || DLB_HW_CREDITS_CHECKS


This new patch is full of compilation flags clutter, can you make it runtim=
e?

>
> diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_pri=
v.h
> index dc9f98e142..fd76b5b9fb 100644
> --- a/drivers/event/dlb2/dlb2_priv.h
> +++ b/drivers/event/dlb2/dlb2_priv.h
> @@ -527,6 +527,7 @@ struct __rte_cache_aligned dlb2_eventdev_port {
>         struct rte_event_port_conf conf; /* user-supplied configuration *=
/
>         uint16_t inflight_credits; /* num credits this port has right now=
 */
>         uint16_t credit_update_quanta;
> +       uint32_t credit_return_count; /* count till the credit return con=
dition is true */
>         struct dlb2_eventdev *dlb2; /* backlink optimization */
>         alignas(RTE_CACHE_LINE_SIZE) struct dlb2_port_stats stats;
>         struct dlb2_event_queue_link link[DLB2_MAX_NUM_QIDS_PER_LDB_CQ];
> diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.bu=
ild
> index 515d1795fe..77a197e32c 100644
> --- a/drivers/event/dlb2/meson.build
> +++ b/drivers/event/dlb2/meson.build
> @@ -68,3 +68,15 @@ endif
>  headers =3D files('rte_pmd_dlb2.h')
>
>  deps +=3D ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
> +
> +if meson.version().version_compare('> 0.58.0')
> +fs =3D import('fs')
> +dlb_options =3D fs.read('meson_options.txt').strip().split('\n')
> +
> +foreach opt: dlb_options
> +       if (opt.strip().startswith('#') or opt.strip() =3D=3D '')
> +               continue
> +       endif
> +       cflags +=3D '-D' + opt.strip().to_upper().replace(' ','')
> +endforeach
> +endif
> diff --git a/drivers/event/dlb2/meson_options.txt b/drivers/event/dlb2/me=
son_options.txt


Adding @Richardson, Bruce   @Thomas Monjalon   to comment on this, I
am not sure driver specific
meson_options.txt is a good path?



> new file mode 100644
> index 0000000000..b57c999e54
> --- /dev/null
> +++ b/drivers/event/dlb2/meson_options.txt
> @@ -0,0 +1,6 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2023-2024 Intel Corporation
> +
> +DLB2_BYPASS_FENCE_ON_PP =3D 0
> +DLB_HW_CREDITS_CHECKS =3D 1
> +DLB_SW_CREDITS_CHECKS =3D 1
> --
> 2.25.1
>