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 E889A42B89; Wed, 24 May 2023 08:09:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2774410F9; Wed, 24 May 2023 08:09:07 +0200 (CEST) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 98BC94067E for ; Wed, 24 May 2023 08:09:06 +0200 (CEST) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-528dd896165so410158a12.2 for ; Tue, 23 May 2023 23:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684908545; x=1687500545; 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=+h0T2EqXOakQaBCco3lRaKfG6OlRenJFgzeOG0DQ8I4=; b=SMo/vdyXgBWYs0hYk0aPPh6+CHLU408f9G7e5KLcEivAqEd9aLkC1fZ/0pQ6AUQj9o uDUu6ZlYD8MWx3XoWXVltuwpc3L7AU/Jf6MKI1jcDW2yPJJLKWlZSiE6GZ+5gATGz+9B pxJwKr1pblg+EgPrs6cqbkMJ+x2h/DFlwp09ASVISCJ4CKlx7+3mYhROASD0SaoOiqlX osAUsI4glyl/d10EkCYCWXGNVszv3ISQU04YH5Jc82r1oqrW2JFkEFbjd9x/c8X5DfGp 0XAM8udjt+JYcvInRcQk3j2W+HFOCvPhEX72rT5XKusZUb2+D8e2kL25KCBoXx8r+zq+ aWLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684908545; x=1687500545; 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=+h0T2EqXOakQaBCco3lRaKfG6OlRenJFgzeOG0DQ8I4=; b=ak66QiLvjLb9NREXWJftKfdDKeUdXty6Hs/zvdrDchQcGLSd6lmZ7XZPfOKR2FhyWG uVBaqhauuAT2PB+GxYzLTeg34FEmQbgm6CzDzGa6svOLsomL4fQYvY7lepugF6BW0y7G o18A8veDnvv6AGY+tf2ZOAWA7g7VS9m1/GWLfHpmOPaIj7R/MfnLhi6KMvvGDN5oxnwm ktOVw42/HEklXQwmbefgV6WynDjZiszJjC7VcXWnhQQCO0HtXw9Xxm9iDwfZp1UIWTB0 lWBvkMJGGc2ZMd+CwhITYO3jJtIs3o5/HDORxUJem/AcQK6n7gQpOQnPIg/R9jarTOHS sd+g== X-Gm-Message-State: AC+VfDyD8mrOipHJSwkfFrMJV2bSErKo8+N9cjV3e5OPvhMt6IRreFAW v525biiV5jSbK67xvNJT6+KP62d5EbgI/JBDuD0= X-Google-Smtp-Source: ACHHUZ6s/ahJwaQlQEz7IPaK1+11JfUlJMb7EijVK+hTKyU0qI4RXgD6zT1iSm7iMUqwCCOtYLXLqZ/4Z1M+5nwPbag= X-Received: by 2002:a17:903:11c9:b0:1a9:7b5e:14ba with SMTP id q9-20020a17090311c900b001a97b5e14bamr18544270plh.29.1684908545483; Tue, 23 May 2023 23:09:05 -0700 (PDT) MIME-Version: 1.0 References: <20230331040306.3143693-1-zhirun.yan@intel.com> <20230509060347.1237884-1-zhirun.yan@intel.com> <20230509060347.1237884-5-zhirun.yan@intel.com> In-Reply-To: <20230509060347.1237884-5-zhirun.yan@intel.com> From: Jerin Jacob Date: Wed, 24 May 2023 11:38:38 +0530 Message-ID: Subject: Re: [PATCH v6 04/15] graph: add get/set graph worker model APIs To: Zhirun Yan Cc: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com, cunming.liang@intel.com, haiyue.wang@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, May 9, 2023 at 11:34=E2=80=AFAM Zhirun Yan w= rote: > > Add new get/set APIs to configure graph worker model which is used to > determine which model will be chosen. > > Signed-off-by: Haiyue Wang > Signed-off-by: Cunming Liang > Signed-off-by: Zhirun Yan > --- > diff --git a/lib/graph/rte_graph_worker.c b/lib/graph/rte_graph_worker.c > new file mode 100644 > index 0000000000..cabc101262 > --- /dev/null > +++ b/lib/graph/rte_graph_worker.c > @@ -0,0 +1,54 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2023 Intel Corporation > + */ > + > +#include "rte_graph_worker_common.h" > + > +RTE_DEFINE_PER_LCORE(enum rte_graph_worker_model, worker_model) =3D RTE_= GRAPH_MODEL_DEFAULT; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior no= tice > + * Set the graph worker model Just declaring this top of the header file enough to avoid duplicating in every functions as all functions in header is experimental. See lib/graph/rte_graph.h > + * > + * @note This function does not perform any locking, and is only safe to= call > + * before graph running. > + * > + * @param name > + * Name of the graph worker model. > + * > + * @return > + * 0 on success, -1 otherwise. > + */ > +int > +rte_graph_worker_model_set(enum rte_graph_worker_model model) > +{ > + if (model >=3D RTE_GRAPH_MODEL_LIST_END) > + goto fail; > + > + RTE_PER_LCORE(worker_model) =3D model; Application needs to set this per core . Right? Are we anticipating a case where one core runs one model and another core runs with another model? If not OR it is not practically possible, then, To make application programmer life easy, We could loop through all lore and set on all of them instead of application setting on each one separately. > + return 0; > + > +fail: > + RTE_PER_LCORE(worker_model) =3D RTE_GRAPH_MODEL_DEFAULT; > + return -1; > +} > + > +/** Graph worker models */ > +enum rte_graph_worker_model { > + RTE_GRAPH_MODEL_DEFAULT, Add Doxygen comment > + RTE_GRAPH_MODEL_RTC =3D RTE_GRAPH_MODEL_DEFAULT, Add Doxygen comment to explain what this mode does. > + RTE_GRAPH_MODEL_MCORE_DISPATCH, Add Doxygen comment to explain what this mode does. > + RTE_GRAPH_MODEL_LIST_END This can break the ABI if we add one in middle. Please remove this. See lib/crytodev for how to handle with _END symbols.