On Thu, May 2, 2024 at 1:27 AM Abdullah Sevincer <abdullah.sevin...@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.sevin...@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 buffers > * being sent with event > */ > +#ifndef DLB2_BYPASS_FENCE_ON_PP > #define DLB2_BYPASS_FENCE_ON_PP 0 /* 1 == Bypass fence, 0 == 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 <= 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 runtime? > > diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.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 > condition 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.build > index 515d1795fe..77a197e32c 100644 > --- a/drivers/event/dlb2/meson.build > +++ b/drivers/event/dlb2/meson.build > @@ -68,3 +68,15 @@ endif > headers = files('rte_pmd_dlb2.h') > > deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci'] > + > +if meson.version().version_compare('> 0.58.0') > +fs = import('fs') > +dlb_options = fs.read('meson_options.txt').strip().split('\n') > + > +foreach opt: dlb_options > + if (opt.strip().startswith('#') or opt.strip() == '') > + continue > + endif > + cflags += '-D' + opt.strip().to_upper().replace(' ','') > +endforeach > +endif > diff --git a/drivers/event/dlb2/meson_options.txt > b/drivers/event/dlb2/meson_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 = 0 > +DLB_HW_CREDITS_CHECKS = 1 > +DLB_SW_CREDITS_CHECKS = 1 > -- > 2.25.1 >