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 9CB1645C98; Wed, 6 Nov 2024 17:31:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D9B342E73; Wed, 6 Nov 2024 17:31:19 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mails.dpdk.org (Postfix) with ESMTP id 28183402B2 for ; Wed, 6 Nov 2024 17:31:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730910678; x=1762446678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SAUt8IfV5rm5yllagBkmjKcw2Yoyul39grcnQF25BiE=; b=VnJzgt+4VOdtCJ/4leaWiumbd/OEYDorw7S6Qt/tfTonJvXrtgASYBpB djsTBwI07yB1fhF06deIPj0QkY0PFQ2YN5/x0wLR6nRGXbGYda/RBw9t5 Id1mDf79b4M8+a1SppI8QscJer73uVVTh+Gab3kpTp6LtKD1ZdYnM7IDG aY1UdstlTBKpRbTfVHWx+9GAXglf2+Ecs6gXosAAMEV6LbiIv6KnqIWp1 Zv9cCy1lhGXCCin9F3gED+gPegUf91F1LDx/XQDf1VIlLu0BlzxUM+Rvp G36LBRQVLD+Bdt0mqQB/sBl4cgkvVo6uF5gEXxQKlaya6RJ+4crDZMC/D w==; X-CSE-ConnectionGUID: bXqAqPuDTCaqsI7pIikZ0Q== X-CSE-MsgGUID: 5aL+GHW6ShyM6LZpwiDZRw== X-IronPort-AV: E=McAfee;i="6700,10204,11248"; a="33560659" X-IronPort-AV: E=Sophos;i="6.11,263,1725346800"; d="scan'208";a="33560659" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2024 08:31:17 -0800 X-CSE-ConnectionGUID: Co51GYugR2qm5jCDdl2dqQ== X-CSE-MsgGUID: sugkk0M3Qeedvgi1dvlSdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,263,1725346800"; d="scan'208";a="84589243" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by orviesa010.jf.intel.com with ESMTP; 06 Nov 2024 08:31:14 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Jerin Jacob Subject: [PATCH v2 1/2] eventdev: add device info telemetry command Date: Wed, 6 Nov 2024 16:31:05 +0000 Message-ID: <20241106163106.1114932-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241106163106.1114932-1-bruce.richardson@intel.com> References: <20241106160750.1093172-1-bruce.richardson@intel.com> <20241106163106.1114932-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The eventdev telemetry support did not have a command for showing basic info about each eventdev device, such as the name and driver in use. Add this callback to allow telemetry user to determine which eventdev device is which. Signed-off-by: Bruce Richardson --- lib/eventdev/rte_eventdev.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index ca295c87c4..23631ff3f6 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1725,6 +1725,41 @@ handle_dev_list(const char *cmd __rte_unused, return 0; } +static int +handle_dev_info(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t dev_id; + struct rte_eventdev *dev; + char *end_param; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + dev_id = strtoul(params, &end_param, 10); + if (*end_param != '\0') + RTE_EDEV_LOG_DEBUG( + "Extra parameters passed to eventdev telemetry command, ignoring"); + + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); + dev = &rte_eventdevs[dev_id]; + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_int(d, "dev_id", dev_id); + rte_tel_data_add_dict_string(d, "dev_name", dev->dev->name); + rte_tel_data_add_dict_string(d, "dev_driver", dev->dev->driver->name); + rte_tel_data_add_dict_string(d, "state", + dev->data->dev_started ? "started" : "stopped"); + rte_tel_data_add_dict_int(d, "socket_id", dev->data->socket_id); + rte_tel_data_add_dict_int(d, "nb_queues", dev->data->nb_queues); + rte_tel_data_add_dict_int(d, "nb_ports", dev->data->nb_ports); + rte_tel_data_add_dict_uint_hex(d, "capabilities", dev->data->event_dev_cap, + sizeof(dev->data->event_dev_cap) * CHAR_BIT); + + return 0; +} + static int handle_port_list(const char *cmd __rte_unused, const char *params, @@ -2030,6 +2065,8 @@ RTE_INIT(eventdev_init_telemetry) { rte_telemetry_register_cmd("/eventdev/dev_list", handle_dev_list, "Returns list of available eventdevs. Takes no parameters"); + rte_telemetry_register_cmd("/eventdev/dev_info", handle_dev_info, + "Returns basic info about an eventdev. Parameter: DevID"); rte_telemetry_register_cmd("/eventdev/port_list", handle_port_list, "Returns list of available ports. Parameter: DevID"); rte_telemetry_register_cmd("/eventdev/queue_list", handle_queue_list, -- 2.43.0