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 AA16945AF0; Wed, 9 Oct 2024 11:38:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BA4F4065D; Wed, 9 Oct 2024 11:38:43 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 463CA402DB for ; Wed, 9 Oct 2024 11:38:41 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4XNnqt4BrMz20pFq; Wed, 9 Oct 2024 17:38:02 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 15CE4140134; Wed, 9 Oct 2024 17:38:39 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 9 Oct 2024 17:38:38 +0800 Message-ID: <19878abe-6b2e-459d-b1de-1f87c9025d8d@huawei.com> Date: Wed, 9 Oct 2024 17:38:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] ethdev: add traffic manager query function To: Bruce Richardson CC: , References: <20241008105350.1396216-1-bruce.richardson@intel.com> <20241008144320.1632138-1-bruce.richardson@intel.com> <20241008144320.1632138-2-bruce.richardson@intel.com> Content-Language: en-US From: fengchengwen In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) 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 2024/10/9 16:07, Bruce Richardson wrote: > On Wed, Oct 09, 2024 at 08:57:41AM +0800, fengchengwen wrote: >> On 2024/10/8 22:43, Bruce Richardson wrote: >>> Add function to allow querying a node in the scheduler tree. Returns >>> the parameters as were given to the add function. Adding this function >>> allows apps to just query the hierarchy rather than having to maintain >>> their own copies of it internally. >>> >>> Signed-off-by: Bruce Richardson >>> --- > > Hi, > > thanks for the detailed review. Most comments are fine and will fix. One > reply below for just one of them though. > > /Bruce > > >>> + */ >>> +__rte_experimental >>> +int >>> +rte_tm_node_query(uint16_t port_id, >>> + uint32_t node_id, >>> + uint32_t *parent_node_id, >>> + uint32_t *priority, >>> + uint32_t *weight, >>> + uint32_t *level_id, >>> + struct rte_tm_node_params *params, >>> + struct rte_tm_error *error); >>> + >> >> Suggest this new function place after node_resume in header/impl.c(e.g. source or trace), keep them consistency > > Why do you think it should go after node resume? I deliberately placed it > after node_add function since the parameters are matching each other, > whatever parameters you provided on add, you get returned to you on query. To one object, we may have four basic operation: add/del/modify/query, I always keep this order in .c/.h file. As for the tm node case, we could treat node_suspend/node_resume as the modify operation. It is just a personal coding style. From my point of view, it's fine in that order. > >