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 B09A141B90; Tue, 31 Jan 2023 17:44:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F30A41138; Tue, 31 Jan 2023 17:44:52 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2085.outbound.protection.outlook.com [40.107.6.85]) by mails.dpdk.org (Postfix) with ESMTP id 2016340041 for ; Tue, 31 Jan 2023 17:44:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D96hpcIl9rJiDbYTOi+Kzg7W4BXZ/ATxC6XZE1Z9lsw=; b=5GHzbrbhtYBvXmGTuQyWDONJfPpFdlN+BUek0Y9ITN2YkBxEyD9iNLxIxSbaOEuB4lyVorsMixw8nmi4qzuPazSXiYcg55b/3hH8D1T2k07cq8rEBwIxVugeXQdfpKFNZfUHqZYOcmZKhN/XgSZLZyJZwEsrXkO0CTtHuAg+FKY= Received: from AS8P189CA0017.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::12) by DB5PR08MB10309.eurprd08.prod.outlook.com (2603:10a6:10:4a9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.30; Tue, 31 Jan 2023 16:44:39 +0000 Received: from AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31f:cafe::c) by AS8P189CA0017.outlook.office365.com (2603:10a6:20b:31f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 16:44:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT011.mail.protection.outlook.com (100.127.140.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Tue, 31 Jan 2023 16:44:38 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Tue, 31 Jan 2023 16:44:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f178144c1afb7b62 X-CR-MTA-TID: 64aa7808 Received: from 8e60ab6f6865.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A8649956-894F-4F11-88E0-275C03FF9902.1; Tue, 31 Jan 2023 16:44:31 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8e60ab6f6865.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 31 Jan 2023 16:44:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MFsudL+vzpKqjN1peV88LO1B3u3VEjDMgSGefbRa7TY7JvLGDbm4sS+Di+bMVVVGl7vvHmAxUC5aJ3N2KnAM+/hpZ/B7PsCpJ41BTSiGrjczj9MeSqd2FqmxGNDekqWx2yvASLbU/S2+g6yKR3Os1/aXNeqd8m0a8UCUz1waXsdx/8u+nIHAAXMcTKMrYqfFGAxEl+b62Pdqrqtn7m4veUjZSDRttIk/6lxaCx+6hNIi9UTOKy52D5ppDK6y4QkBVI2Pb+tGMZNPbUofacvhxK52PSnI54QWBePiEEPNSA3+wp0jkgVHA2TLWnsufVhca8hLL4g7SaIxdIjq0lwyFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D96hpcIl9rJiDbYTOi+Kzg7W4BXZ/ATxC6XZE1Z9lsw=; b=XdAlJxMr/ZY3NmXe52tOPE5uKNE+A+A9xXg7vlOKqMUDxLVoZzLSrsIkliRNt9rBWCvJzkEnlK/eI5XtNUkzjQCQv2fSHZuTocO4TOLoiJFVr5JqaZsaiOrf/s4M0etdzmbV64+a6BVhJO6llez+hGYzdvJZOo6BmDIiE2Ozw8cFmAe6A4xR/oGeWRpQLGTM5RtMynjNheEDpx5tLUaILV6dEHii00plocXoapBWDIfxMtXKzqfmUViGGSUoGlvI9SvK/l9sJAzZztBhmylnSycAiF0fUUglC9DEdA654iXS90y+zRomoexKFsXVYnCIvAZH5U8Em9HmGcwhsiGcvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D96hpcIl9rJiDbYTOi+Kzg7W4BXZ/ATxC6XZE1Z9lsw=; b=5GHzbrbhtYBvXmGTuQyWDONJfPpFdlN+BUek0Y9ITN2YkBxEyD9iNLxIxSbaOEuB4lyVorsMixw8nmi4qzuPazSXiYcg55b/3hH8D1T2k07cq8rEBwIxVugeXQdfpKFNZfUHqZYOcmZKhN/XgSZLZyJZwEsrXkO0CTtHuAg+FKY= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB3PR08MB8938.eurprd08.prod.outlook.com (2603:10a6:10:43f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 16:44:30 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f8c8:b4b6:c041:ac9d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f8c8:b4b6:c041:ac9d%6]) with mapi id 15.20.6043.038; Tue, 31 Jan 2023 16:44:29 +0000 From: Honnappa Nagarahalli To: Jie Hai , "konstantin.v.ananyev@yandex.ru" , "dev@dpdk.org" CC: "liudongdong3@huawei.com" , nd , nd Subject: RE: [PATCH v3 1/2] ring: add ring list telemetry cmd Thread-Topic: [PATCH v3 1/2] ring: add ring list telemetry cmd Thread-Index: AQHZNRvfkz9Dj2aHhECdrXaAkxvGr664tKzQ Date: Tue, 31 Jan 2023 16:44:29 +0000 Message-ID: References: <20230117130333.8707-1-haijie1@huawei.com> <20230131022841.10775-1-haijie1@huawei.com> <20230131022841.10775-2-haijie1@huawei.com> In-Reply-To: <20230131022841.10775-2-haijie1@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: EA5181CEAA32C84CA7593BD8A44D0948.0 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: DBAPR08MB5814:EE_|DB3PR08MB8938:EE_|AM7EUR03FT011:EE_|DB5PR08MB10309:EE_ X-MS-Office365-Filtering-Correlation-Id: d139d451-022a-4e5d-e05d-08db03aa71b7 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gTD6vG2lTtvbaaJ6LvQ0Fb75rS+zKfd6SIAT/bDA0uYE7P4IeBqI0jK3ZkwVJYcL9BZSILBtyhZXLlL+eWTuJ/CkbfgcXn7j3EQeNJ8YQWw6S4FevXbyOUQjCCJFV91cv0YieJNZZOmSu5Wd5YhKkRkU5u82M3aNEvRsfT989xsojnLwWfeQabJGh04WFgJkEPcFTC0MWkfmGqLhs/aUmtXyGPV1ajtc0O4+PaTlNfPDejeiuq3K5mWBCplA9Z1I8uY1/1bPLqA21zJFu8WgVaUwscTEQX8aM2WA5L+e1O5jVlvjLGaa3tIeLgM9ng/Pt9tpPXqtb+USnqLmX4BckJohuWyztHH0vJXz+y1yBkfsVC30vSTwByuCPAdfZTgGk2vXa4MMkNd6IznuBL0eNgi3AiVGrGj2f0PGkUuKRhasNS+3wGvT6963onxRfK3sSGGmFdodhDGPleHhRnvkbX6RwESKxPVKF9kckovIj4s285LSN9pw97MdwywADKKoEG9Ye3G5DLGuSIqNjgSvs/NK2rCb2oAwKpx/PxmABcQQpcQJy5eCBuUNNIwR03BMMf3xjHqa5VHKKM4tAf1b8+Te5AScXPDFjoUzYPVdeyppxMLPWd3K3qfML1IawIR2qHdc5YU2cVDV6/wiovpz3NSGqDSeT3/1udir1UPjZKIXVqXQgvIgpaXaWCVvbksuMi+9gQVyGybEl8clvlLjZY/1gDehbt6elg16QkczcS4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(346002)(396003)(39860400002)(376002)(366004)(451199018)(5660300002)(8936002)(52536014)(2906002)(6506007)(55016003)(83380400001)(86362001)(41300700001)(9686003)(53546011)(66556008)(33656002)(76116006)(64756008)(8676002)(110136005)(54906003)(478600001)(66446008)(4326008)(66946007)(66476007)(26005)(186003)(71200400001)(7696005)(38100700002)(38070700005)(316002)(122000001)(23180200003); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8938 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d90583d7-833b-40b7-4a3e-08db03aa6c4d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r0Di41chJSRbZL/AWHXuBquX3dw/BAH7r8h+gQ/hgo4h9rrR5EFJ8zZeJhDb2PAwjd/YqV5/IcZi1eo/CBNozclLBdBNBapq3gzxeXPtJnbu4UgcdfmNNhqxryLVMoiyyKsGvojucc6g6OI5lQRNtmujevav+Cj7sgX6TngEuF1epZBACGx01sPOMBzKv0Tb/HAP6LImnineoo9aTtCJuULiXIX2XBSSN3BrFLe5GbCJe8o08EkhF4owK9ck2vsCxZ582ZQgNHdSRubdqF/VWcBOhMyJ5l0/XdndPa0elmZICjiMx6etFJc3FOsVcv5NsluvSQF9QtCYYJqb5EY9CRJa1D3AFqQalEXucs4bUtfr9b0phMJs2ZOd6as5ebOfuhqPhclHGr/kstR6unVkGbv2dw1bDJSCiMVsQjoFTL+b7nqyBe5AACOdsEhqD3K9fG9+1C+i9iadmhulujqhNvR9BKFQqUAjsf0gktgMZZ5Dtzh+yD7+s5yJqiw7/6JW5bVmsnM6hmW2L2Agx3Xg5saZK87er1iXP62e2ByyKUXSfXqNN/y6LYiA0VVVBcuDxZO9B5YP8ePfIPBYtDgg4E68Zt+AvCnk9x0Y0acveFHvQPLbFMSdl7g1lgL3OBB0ysQXQTbOWwNVFHyLQNnV5Aam/qno61EEPhNV56JA5yQ0J9UUckyPr/pQs6vrgqDm7RnIf2AZNp452uJFmM1l/k3/9hh0nsDLHn79H0pfcUc= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(376002)(346002)(136003)(396003)(451199018)(40470700004)(46966006)(36840700001)(26005)(8936002)(41300700001)(47076005)(55016003)(86362001)(336012)(4326008)(83380400001)(82310400005)(81166007)(82740400003)(356005)(36860700001)(316002)(8676002)(70206006)(54906003)(6506007)(40460700003)(478600001)(70586007)(53546011)(33656002)(7696005)(9686003)(40480700001)(110136005)(2906002)(186003)(52536014)(5660300002)(23180200003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 16:44:38.9631 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d139d451-022a-4e5d-e05d-08db03aa71b7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10309 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 Few minor comments inline. Otherwise, Reviewed-by: Honnappa Nagarahalli > -----Original Message----- > From: Jie Hai > Sent: Monday, January 30, 2023 8:29 PM > To: Honnappa Nagarahalli ; > konstantin.v.ananyev@yandex.ru; dev@dpdk.org > Cc: liudongdong3@huawei.com; haijie1@huawei.com > Subject: [PATCH v3 1/2] ring: add ring list telemetry cmd How about "ring: add telemetry cmd to list rings" >=20 > This patch supports the list of rings with telemetry cmd. Add a telemetry command to list the rings used in the system. > An example using this command is shown below: >=20 > --> /ring/list > { > "/ring/list": [ > "HT_0000:7d:00.2", > "MP_mb_pool_0" > ] > } >=20 > Signed-off-by: Jie Hai > Acked-by: Konstantin Ananyev > --- > lib/ring/meson.build | 1 + > lib/ring/rte_ring.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 41 insertions(+) >=20 > diff --git a/lib/ring/meson.build b/lib/ring/meson.build index > c20685c689ac..7fca958ed7fa 100644 > --- a/lib/ring/meson.build > +++ b/lib/ring/meson.build > @@ -18,3 +18,4 @@ indirect_headers +=3D files ( > 'rte_ring_rts.h', > 'rte_ring_rts_elem_pvt.h', > ) > +deps +=3D ['telemetry'] > diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c index > cddaf6b2876f..e6aac332d88f 100644 > --- a/lib/ring/rte_ring.c > +++ b/lib/ring/rte_ring.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include >=20 > #include "rte_ring.h" > #include "rte_ring_elem.h" > @@ -419,3 +420,42 @@ rte_ring_lookup(const char *name) >=20 > return r; > } > + > +static void > +ring_walk(void (*func)(struct rte_ring *, void *), void *arg) { > + struct rte_ring_list *ring_list; > + struct rte_tailq_entry *te; > + > + ring_list =3D RTE_TAILQ_CAST(rte_ring_tailq.head, rte_ring_list); > + rte_mcfg_tailq_read_lock(); > + > + TAILQ_FOREACH(te, ring_list, next) { > + (*func)((struct rte_ring *) te->data, arg); > + } > + > + rte_mcfg_tailq_read_unlock(); > +} > + > +static void > +ring_list_cb(struct rte_ring *r, void *arg) { > + struct rte_tel_data *d =3D (struct rte_tel_data *)arg; > + > + rte_tel_data_add_array_string(d, r->name); } > + > +static int > +ring_handle_list(const char *cmd __rte_unused, > + const char *params __rte_unused, struct rte_tel_data *d) { > + rte_tel_data_start_array(d, RTE_TEL_STRING_VAL); > + ring_walk(ring_list_cb, d); > + return 0; > +} > + > +RTE_INIT(ring_init_telemetry) > +{ > + rte_telemetry_register_cmd("/ring/list", ring_handle_list, > + "Returns list of available ring. Takes no parameters"); } ^^= ^^ rings > -- > 2.33.0