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 0372C43095; Fri, 18 Aug 2023 12:27:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1DD540ED9; Fri, 18 Aug 2023 12:27:34 +0200 (CEST) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by mails.dpdk.org (Postfix) with ESMTP id 6C45540395 for ; Fri, 18 Aug 2023 12:27:33 +0200 (CEST) Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-79ddb7fae73so176886241.3 for ; Fri, 18 Aug 2023 03:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692354453; x=1692959253; 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=tgPo2sRTiAOrCkZSZeTcadD624rar+lTHe8lH2vrAu0=; b=T7oK3yG4XAT6le0wdsDI8b5qRJgRYcIEGjHzHFFZpoIoSr0n0Y9vg7ngQJwQxy+1hu 9YODv/wzCJhF6R8zX0Ezlu6j6jl2/kDjoytM6lS+CIrJjX/w+kUvGIuiYPbiHtjb5n9p ntjbljRjARmM5amLJiik70Fu6wQaU/dSh7s6g/trNccin3qTcEuKwADv5U3vuC5rDGSo prI9sb9QgiOVbJ0rX0L0z3FcYNb7urL81E4xT9SUu0RvDonGjHIOr9GhRCdLJSy/BWah v7sbDYR7jTKOdaZCvwBC8gfJlfQkR42wuWKWDh3GAvX9FGTss1E5Dy9w/9/k9SjPdaWp 08Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692354453; x=1692959253; 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=tgPo2sRTiAOrCkZSZeTcadD624rar+lTHe8lH2vrAu0=; b=WSLodCuxVd7P+DkwLvPlJCRu/t3THFvcH2CddAcbBfoWpt9VVUF5e0ntRbww3bheSg civ5uzFiDINrGgjXrb2NbgWIogbnzNp53msqVeWp7eHZlOYh4MwhVVXTNvIg9i0iSZXm Nfq5Vuf3sECL1pcqAbOXBDqYndtWLnW8bRkSnHiIcqlI76HIIRe4TrE7f17U+pVhoGAA 0uX4Lgr53RfRaSEerjN/t9frlpegMOEDMdt6zY/ApgJZ7VLE33DoOc35XsrDfpyq08cz DxZl/O6xxwPLVMIqaTFLKDvtstvik0s5VixXvOHqOl5CiBr91/wy8YIa4kifMhm0KsJw AWpw== X-Gm-Message-State: AOJu0Yww/81Yn3/3/4MJbkxwD7AByp/dgtWZHBQp0bi9WJJ3jhuWAcLp r18jONIi2kYSfXqWU9OCxZR9D2uB85d06j8hc1Y= X-Google-Smtp-Source: AGHT+IHE0fytd0rKQlM7z0+XY6Kbxk3WqSVPBqTlo3DUzwNjev60GShOaZlJ4v1H9zfDmXh02nrjgwu6fOsI1Yva46M= X-Received: by 2002:a67:e297:0:b0:445:202:d278 with SMTP id g23-20020a67e297000000b004450202d278mr2229364vsf.32.1692354452616; Fri, 18 Aug 2023 03:27:32 -0700 (PDT) MIME-Version: 1.0 References: <20230809142617.6482-1-pbhagavatula@marvell.com> <20230809142617.6482-2-pbhagavatula@marvell.com> In-Reply-To: <20230809142617.6482-2-pbhagavatula@marvell.com> From: Jerin Jacob Date: Fri, 18 Aug 2023 15:57:06 +0530 Message-ID: Subject: Re: [RFC 1/3] eventdev: introduce link profiles To: pbhagavatula@marvell.com Cc: jerinj@marvell.com, sthotton@marvell.com, timothy.mcdaniel@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, mattias.ronnblom@ericsson.com, liangma@liangbit.com, peter.mccarthy@intel.com, harry.van.haaren@intel.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com, s.v.naga.harish.k@intel.com, anatoly.burakov@intel.com, dev@dpdk.org 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, Aug 9, 2023 at 7:56=E2=80=AFPM wrote: > > From: Pavan Nikhilesh > > A collection of event queues linked to an event port can be > associated with a unique identifier called as a profile, multiple > such profiles can be created based on the event device capability > using the function `rte_event_port_link_with_profile` which takes > arguments similar to `rte_event_port_link` in addition to the profile > identifier. > > The maximum link profiles that are supported by an event device > is advertised through the structure member > `rte_event_dev_info::max_profiles_per_port`. > By default, event ports are configured to use the link profile 0 > on initialization. > > Once multiple link profiles are set up and the event device is started, > the application can use the function `rte_event_port_change_profile` > to change the currently active profile on an event port. This effects > the next `rte_event_dequeue_burst` call, where the event queues > associated with the newly active link profile will participate in > scheduling. > > An unlink function `rte_event_port_unlink_with_profile` is provided > to modify the links associated to a profile, and > `rte_event_port_links_get_with_profile`can be used to retrieve the > links associated with a profile. in rte_flow APIs, similar concept is called as template. I think "why" part is missing in the comment and programming guide. i.e improving performance by creating template/profile in slow path for faster link/unlink operation. > > Signed-off-by: Pavan Nikhilesh Some suggestion on API name to have proper prefix and keeping verb as last. rte_event_port_profile_link_set() rte_event_port_profile_link_get() rte_event_port_profile_unlink() rte_event_port_profile_switch() > Please start with heading for this new block > +An application can also use link profiles if supported by the underlying= event device to setup up > +multiple link profile per port and change them run time depending up on = heuristic data. > + > +An Example use case could be as follows. > + > +Config path: > + > +.. code-block:: c > + > + uint8_t lowQ[4] =3D {4, 5, 6, 7}; > + uint8_t highQ[4] =3D {0, 1, 2, 3}; Please remove Hungarian notation. > + > + if (rte_event_dev_info.max_profiles_per_port < 2) > + return -ENOTSUP; > + > + rte_event_port_link_with_profile(0, 0, highQ, NULL, 4, 0); > + rte_event_port_link_with_profile(0, 0, lowQ, NULL, 4, 1); > + > +Worker path: > + > +.. code-block:: c > + > + uint8_t empty_high_deq =3D 0; > + uint8_t empty_low_deq =3D 0; > + uint8_t is_low_deq =3D 0; > + while (1) { > + deq =3D rte_event_dequeue_burst(0, 0, &ev, 1, 0); > + if (deq =3D=3D 0) { > + /** > + * Change link profile based on work activity on current > + * active profile > + */ > + if (is_low_deq) { > + empty_low_deq++; > + if (empty_low_deq =3D=3D MAX_LOW_RETRY) { > + rte_event_port_change_profile(0, 0, 0); > + is_low_deq =3D 0; > + empty_low_deq =3D 0; > + } > + continue; > + } > + > + if (empty_high_deq =3D=3D MAX_HIGH_RETRY) { > + rte_event_port_change_profile(0, 0, 1); > + is_low_deq =3D 1; > + empty_high_deq =3D 0; > + } > + continue; > + } > + > + // Process the event received. > + > + if (is_low_deq++ =3D=3D MAX_LOW_EVENTS) { > + rte_event_port_change_profile(0, 0, 0); > + is_low_deq =3D 0; > + } > + } As far programming document is concerned, we don't need to put such complicated logic here. We can put some comments something like =E2=80=9CFind the profile ID to swi= tch=E2=80=9D uint8_t profile_id_to_switch =3D app_find_profile_id_to_switch(); rte_event_port_profile_switch(.., profile_id_to_switch ); > > diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c > index 60c5cd4804..580057870f 100644 > --- a/drivers/event/dlb2/dlb2.c > +++ b/drivers/event/dlb2/dlb2.c > @@ -79,6 +79,7 @@ static struct rte_event_dev_info evdev_dlb2_default_inf= o =3D { > RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK | > RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT | > RTE_EVENT_DEV_CAP_MAINTENANCE_FREE), > + .max_profiles_per_port =3D 1, > }; > > struct process_local_port_data > diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa= _eventdev.c > index 4b3d16735b..f615da3813 100644 > --- a/drivers/event/dpaa/dpaa_eventdev.c > +++ b/drivers/event/dpaa/dpaa_eventdev.c > @@ -359,6 +359,7 @@ dpaa_event_dev_info_get(struct rte_eventdev *dev, > RTE_EVENT_DEV_CAP_NONSEQ_MODE | > RTE_EVENT_DEV_CAP_CARRY_FLOW_ID | > RTE_EVENT_DEV_CAP_MAINTENANCE_FREE; We are always adding CAPA for new eventdev features. Please add RTE_EVENT_DEV_CAPA_PROFILE_LINK or so. > @@ -131,6 +131,11 @@ EXPERIMENTAL { > rte_event_eth_tx_adapter_runtime_params_init; > rte_event_eth_tx_adapter_runtime_params_set; > rte_event_timer_remaining_ticks_get; > + > + # added in 23.11 > + rte_event_port_link_with_profile; > + rte_event_port_unlink_with_profile; > + rte_event_port_links_get_with_profile; Missed the API to switch the profile. > }; > > INTERNAL { > -- > 2.25.1 >