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 6744B423B4; Thu, 12 Jan 2023 08:06:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D85340A7D; Thu, 12 Jan 2023 08:06:47 +0100 (CET) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by mails.dpdk.org (Postfix) with ESMTP id D95F0400EF for ; Thu, 12 Jan 2023 08:06:45 +0100 (CET) Received: by mail-vs1-f47.google.com with SMTP id d66so5727987vsd.9 for ; Wed, 11 Jan 2023 23:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0KiVBmUKw39i5AdPIPKYYjV8+fUkyHD7KfK9ZB1bca8=; b=M3NrMZPJAvFhwWm6cHQRnlf/YyqbeUDUKpoQcGkrQCuip4fLXfHbRy7BaTV0Mt0jU2 PrR9QdQl1kWSlQQEIZlGQpsV2GU8Udfb+WaGH4Gr+aVjjaBsOYyC+6UROErpNTL3+SMY vXRDLhc9iFSHyXODTUHXX44wJoDHqbRnBHlZKtQwGAp6mNmCa1jVaiBB0oMzBRFIWFrJ Ehn1qgm2zP+QHM4KUOTJstCR/20bYc+TGKmPoDfTp9O5IKyGOyYxqTrhbg36eRa52QNs 6LllSidS6DB1rc9R/SPzcSyvE4ccdbsXgICumrvRRLsgRixFQQiJVobY7JqS2wNH76pr MjkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=0KiVBmUKw39i5AdPIPKYYjV8+fUkyHD7KfK9ZB1bca8=; b=bxJxwaCsT9ZMjzR/6V9RRHjwm2a0L8pTWwLN9BI9FvkmzeUTV0fOvZNuoPwIPTkdhy ZauHpVgF/5A/O05583xxtOuP0KeShT0e8IeTRR4CSvnI1QN2sNkGow88W1vANrej3ug4 5w7W9D1fq+P1vTv29jva+2Oq/UcfxNp4Po1Ff9+Pr1y+Ho+8NSPWNgybXmjztiLmxMx/ Kn/KoYdoHpcvp5JN7aRk7R1QZ/DgVhfoGUzMRA7+h6lXrMaEbv/L/SZYnaeDFNch9/IT oCwFL61TEUjZ/bfhLYAFIR4bGrPqzgWpp/UbljiWb6nuwoCGUNyRmRJvzEex5vpY7r4y iX0g== X-Gm-Message-State: AFqh2kr/Owjkn2EKqwGqzhubvnDlqKVDCeavwwQdQ6DGVYea/mpOhNAR oDwXUYB7Ix++0dwqvLwM0J/H3PZhIbnAuDm7gOE= X-Google-Smtp-Source: AMrXdXtPsqlzOxga6pvKNyM+AR3hircDMDwoL5UVgtxLJ6OvsyYxxIXZ676U2rG9O6rQymXvjkTf/R8MMWb5GIdC0sY= X-Received: by 2002:a05:6102:3e1a:b0:3d0:c091:87c8 with SMTP id j26-20020a0561023e1a00b003d0c09187c8mr1694335vsv.31.1673507205125; Wed, 11 Jan 2023 23:06:45 -0800 (PST) MIME-Version: 1.0 References: <20230102051444.1263632-1-s.v.naga.harish.k@intel.com> <20230104064145.2600261-1-s.v.naga.harish.k@intel.com> <20230104064145.2600261-4-s.v.naga.harish.k@intel.com> In-Reply-To: <20230104064145.2600261-4-s.v.naga.harish.k@intel.com> From: Jerin Jacob Date: Thu, 12 Jan 2023 12:36:18 +0530 Message-ID: Subject: Re: [PATCH v6 4/4] eventdev/timer: change eventdev reconfig logic To: Naga Harish K S V Cc: jerinj@marvell.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com, dev@dpdk.org, jay.jayatheerthan@intel.com Content-Type: text/plain; charset="UTF-8" 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, Jan 4, 2023 at 12:12 PM Naga Harish K S V wrote: > > When rte_event_timer_adapter_create() is used for creating adapter > instance, eventdev is reconfigured with additional > ``rte_event_dev_config::nb_event_ports`` parameter. > > This eventdev reconfig logic is enhanced to increment the > ``rte_event_dev_config::nb_single_link_event_port_queues`` > parameter if the adapter event port config is of type > ``RTE_EVENT_PORT_CFG_SINGLE_LINK``. In general, the change is OK. Some comments, > With this change the application is no longer need to configure the What happens to existing application? Will it a) Fail at runtime b) Fail at compile time c) Need to change application code to make existing application working d) Change the application code to get this enhancement This is to understand what need to be updated in doc/guides/rel_notes/release_23_03.rst If it is (d), Please update doc/guides/rel_notes/release_23_03.rst to make sure end user know this enhancement is added. If not (d), it is kind of application breaking scenario and make it as (d). > eventdev with ``rte_event_dev_config::nb_single_link_event_port_queues`` > parameter required for timer adapter when the adapter is created > using above mentioned api. > > Signed-off-by: Naga Harish K S V > Acked-by: Abhinandan Gujjar > --- > v2: > * fix build error in documentation > v3: > * update doxygen > v4: > * fix programmer guide > v5: > * update doxygen as per review comments > v6: > * fix adapter cretae logic with correct event port id > --- > --- > doc/guides/prog_guide/event_timer_adapter.rst | 18 +++++++++++++++ > lib/eventdev/rte_event_timer_adapter.c | 23 +++++++++++-------- > lib/eventdev/rte_event_timer_adapter.h | 14 +++++++++++ > 3 files changed, 45 insertions(+), 10 deletions(-) > > diff --git a/doc/guides/prog_guide/event_timer_adapter.rst b/doc/guides/prog_guide/event_timer_adapter.rst > index d7307a29bb..b5cd95fef1 100644 > --- a/doc/guides/prog_guide/event_timer_adapter.rst > +++ b/doc/guides/prog_guide/event_timer_adapter.rst > @@ -139,6 +139,24 @@ This function is passed a callback function that will be invoked if the > adapter needs to create an event port, giving the application the opportunity > to control how it is done. > > +Event device configuration for service based adapter > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +When rte_event_timer_adapter_create() is used for creating > +adapter instance, ``rte_event_dev_config::nb_event_ports`` is > +automatically incremented, and the event device is reconfigured with > +additional event port during service initialization. > +This event device reconfigure logic also increments the > +``rte_event_dev_config::nb_single_link_event_port_queues`` > +parameter if the adapter event port config is of type > +``RTE_EVENT_PORT_CFG_SINGLE_LINK``. > + > +Application no longer needs to account for the > +``rte_event_dev_config::nb_event_ports`` and > +``rte_event_dev_config::nb_single_link_event_port_queues`` > +parameters required for timer adapter in event device configuration, > +when the adapter is created using the above-mentioned API. > + > Adapter modes > ^^^^^^^^^^^^^ > An event timer adapter can be configured in either periodic or non-periodic mode > diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c > index a0f14bf861..66554f13fc 100644 > --- a/lib/eventdev/rte_event_timer_adapter.c > +++ b/lib/eventdev/rte_event_timer_adapter.c > @@ -88,7 +88,20 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, > rte_event_dev_stop(dev_id); > > port_id = dev_conf.nb_event_ports; > + if (conf_arg != NULL) > + port_conf = conf_arg; > + else { > + port_conf = &def_port_conf; > + ret = rte_event_port_default_conf_get(dev_id, (port_id - 1), > + port_conf); > + if (ret < 0) > + return ret; > + } > + > dev_conf.nb_event_ports += 1; > + if (port_conf->event_port_cfg & RTE_EVENT_PORT_CFG_SINGLE_LINK) > + dev_conf.nb_single_link_event_port_queues += 1; > + > ret = rte_event_dev_configure(dev_id, &dev_conf); > if (ret < 0) { > EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id); > @@ -99,16 +112,6 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id, > return ret; > } > > - if (conf_arg != NULL) > - port_conf = conf_arg; > - else { > - port_conf = &def_port_conf; > - ret = rte_event_port_default_conf_get(dev_id, port_id, > - port_conf); > - if (ret < 0) > - return ret; > - } > - > ret = rte_event_port_setup(dev_id, port_id, port_conf); > if (ret < 0) { > EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n", > diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h > index cd10db19e4..e21588bede 100644 > --- a/lib/eventdev/rte_event_timer_adapter.h > +++ b/lib/eventdev/rte_event_timer_adapter.h > @@ -212,6 +212,20 @@ typedef int (*rte_event_timer_adapter_port_conf_cb_t)(uint16_t id, > * > * This function must be invoked first before any other function in the API. > * > + * When this API is used for creating adapter instance, > + * ``rte_event_dev_config::nb_event_ports`` is automatically incremented, > + * and the event device is reconfigured with additional event port during > + * service initialization. This event device reconfigure logic also increments > + * the ``rte_event_dev_config::nb_single_link_event_port_queues`` > + * parameter if the adapter event port config is of type > + * ``RTE_EVENT_PORT_CFG_SINGLE_LINK``. > + * > + * Application no longer needs to account for > + * ``rte_event_dev_config::nb_event_ports`` and > + * ``rte_event_dev_config::nb_single_link_event_port_queues`` > + * parameters required for Timer adapter in event device configuration > + * when the adapter is created with this API. > + * > * @param conf > * The event timer adapter configuration structure. > * > -- > 2.25.1 >