From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6F0B0A0096 for ; Mon, 3 Jun 2019 19:39:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F30221BBDB; Mon, 3 Jun 2019 19:36:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 5DD4B1BA46 for ; Mon, 3 Jun 2019 19:36:17 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x53HKlnJ000910; Mon, 3 Jun 2019 10:36:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=uuAWpODr4c90c+VEhbp0zSjtxG2l8N7Wn2smT9xS8lI=; b=LFlMRBjv8Tg9F6F7Zp+2orZ1eMI8KUR8IGIIr9QsT2VrkN9enbuLJ0na6TIkuSxxnhRU ONyKB6iidIzvOhcBfD2YnDoZ98xRzDVexg85eUHD0TcONkRgbklgvAllLC/4KpQA2KTr KVuOBkr1kc5XCJX6qC/hFKnCFP187PYCXwGmo9cS3dmzIl0xoBJviK7u+beweqhM5WR4 PgBzoo5Uwm9cxLDP9RFrCSdWaTishHy6WoSXeolzhj7tb3aUuKwWVPS4HztsIxDQ/gMO fkaf/FnBnQ2do5XYmivvfOBIHty/XyfUc4W1tDH6ydQGUiFWL9RqnrrLWOFkDYPuCpeN OA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2sw2wmhdpr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2019 10:36:16 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 3 Jun 2019 10:36:15 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 3 Jun 2019 10:36:15 -0700 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56]) by maili.marvell.com (Postfix) with ESMTP id 379493F7040; Mon, 3 Jun 2019 10:36:10 -0700 (PDT) From: Anoob Joseph To: Jerin Jacob , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Anoob Joseph , Narayana Prasad , , Lukasz Bartosik , Pavan Nikhilesh , Hemant Agrawal , "Nipun Gupta" , Harry van Haaren , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Liang Ma Date: Mon, 3 Jun 2019 23:02:29 +0530 Message-ID: <1559583160-13944-30-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559583160-13944-1-git-send-email-anoobj@marvell.com> References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-03_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 29/39] eventdev: add routines to display the eventmode conf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Adding routines to display the eventmode configuration. This gives an overview of the devices used with the configuration. Signed-off-by: Anoob Joseph Signed-off-by: Lukasz Bartosik --- lib/librte_eventdev/Makefile | 1 + lib/librte_eventdev/meson.build | 1 + lib/librte_eventdev/rte_eventdev_version.map | 1 + lib/librte_eventdev/rte_eventmode_helper.c | 3 + lib/librte_eventdev/rte_eventmode_helper.h | 11 ++ lib/librte_eventdev/rte_eventmode_helper_prints.c | 161 ++++++++++++++++++++++ 6 files changed, 178 insertions(+) create mode 100644 lib/librte_eventdev/rte_eventmode_helper_prints.c diff --git a/lib/librte_eventdev/Makefile b/lib/librte_eventdev/Makefile index de2b322..103d1e9 100644 --- a/lib/librte_eventdev/Makefile +++ b/lib/librte_eventdev/Makefile @@ -24,6 +24,7 @@ LDLIBS += -lrte_mbuf -lrte_cryptodev -lpthread # library source files SRCS-y += rte_eventdev.c SRCS-y += rte_eventmode_helper.c +SRCS-y += rte_eventmode_helper_prints.c SRCS-y += rte_event_ring.c SRCS-y += rte_event_eth_rx_adapter.c SRCS-y += rte_event_timer_adapter.c diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build index 73cd89e..ce7a483 100644 --- a/lib/librte_eventdev/meson.build +++ b/lib/librte_eventdev/meson.build @@ -12,6 +12,7 @@ endif sources = files('rte_eventdev.c', 'rte_eventmode_helper.c', + 'rte_eventmode_helper_prints.c', 'rte_event_ring.c', 'rte_event_eth_rx_adapter.c', 'rte_event_timer_adapter.c', diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map index e156fa0..8b78a68 100644 --- a/lib/librte_eventdev/rte_eventdev_version.map +++ b/lib/librte_eventdev/rte_eventdev_version.map @@ -132,4 +132,5 @@ EXPERIMENTAL { rte_eventmode_helper_print_options_description; rte_eventmode_helper_parse_args; rte_eventmode_helper_initialize_devs; + rte_eventmode_helper_display_conf; }; diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c index 191eb77..a333c4a 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -802,6 +802,9 @@ rte_eventmode_helper_initialize_devs( return -1; } + /* Display the current conf */ + rte_eventmode_helper_display_conf(mode_conf); + /* Stop eth devices before setting up adapter */ RTE_ETH_FOREACH_DEV(portid) { diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h index 1ae6a15..d4941be 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.h +++ b/lib/librte_eventdev/rte_eventmode_helper.h @@ -101,6 +101,17 @@ int32_t __rte_experimental rte_eventmode_helper_initialize_devs( struct rte_eventmode_helper_conf *mode_conf); +/** + * Display event mode conf + * + * Parse the conf and display the current configuration. + * + * @param mode_conf + * Configuration of the mode in which app is doing packet handling + */ +void __rte_experimental +rte_eventmode_helper_display_conf(struct rte_eventmode_helper_conf *mode_conf); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eventdev/rte_eventmode_helper_prints.c b/lib/librte_eventdev/rte_eventmode_helper_prints.c new file mode 100644 index 0000000..3114d29 --- /dev/null +++ b/lib/librte_eventdev/rte_eventmode_helper_prints.c @@ -0,0 +1,161 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (C) 2019 Marvell International Ltd. + */ + +#include +#include + +#include +#include "rte_eventmode_helper_internal.h" + +static void +rte_eventmode_display_operating_mode(struct eventmode_conf *em_conf) +{ + char sched_types[][32] = { + "RTE_SCHED_TYPE_ORDERED", + "RTE_SCHED_TYPE_ATOMIC", + "RTE_SCHED_TYPE_PARALLEL", + }; + RTE_EM_HLPR_LOG_INFO("Operating mode:"); + + RTE_EM_HLPR_LOG_INFO("\tScheduling type: \t%s", + sched_types[em_conf->ext_params.sched_type]); + + RTE_EM_HLPR_LOG_INFO(""); +} + +static void +rte_eventmode_display_event_dev_conf(struct eventmode_conf *em_conf) +{ + int i; + char print_buf[256] = { 0 }; + char queue_mode[][32] = { + "", + "ATQ (ALL TYPE QUEUE)", + "SINGLE LINK", + }; + + RTE_EM_HLPR_LOG_INFO("Event Device Configuration:"); + + for (i = 0; i < em_conf->nb_eventdev; i++) { + sprintf(print_buf, + "\tDev ID: %-2d \tQueues: %-2d \tPorts: %-2d", + em_conf->eventdev_config[i].eventdev_id, + em_conf->eventdev_config[i].nb_eventqueue, + em_conf->eventdev_config[i].nb_eventport); + sprintf(print_buf + strlen(print_buf), + "\tQueue mode: %s", + queue_mode[em_conf->eventdev_config[i].ev_queue_mode]); + RTE_EM_HLPR_LOG_INFO("%s", print_buf); + } + RTE_EM_HLPR_LOG_INFO(""); +} + +static void +rte_eventmode_display_rx_adapter_conf(struct eventmode_conf *em_conf) +{ + int i, j; + int nb_rx_adapter = em_conf->nb_rx_adapter; + struct rx_adapter_conf *adapter; + struct adapter_connection_info *conn; + char print_buf[256] = { 0 }; + + RTE_EM_HLPR_LOG_INFO("Rx adapters configured: %d", nb_rx_adapter); + + for (i = 0; i < nb_rx_adapter; i++) { + adapter = &(em_conf->rx_adapter[i]); + RTE_EM_HLPR_LOG_INFO( + "\tRx adaper ID: %-2d\tConnections: %-2d\tEvent dev ID: %-2d" + "\tRx core: %-2d", + adapter->adapter_id, + adapter->nb_connections, + adapter->eventdev_id, + adapter->rx_core_id); + + for (j = 0; j < adapter->nb_connections; j++) { + conn = &(adapter->conn[j]); + + sprintf(print_buf, + "\t\tEthdev ID: %-2d", conn->ethdev_id); + + if (conn->ethdev_rx_qid == -1) + sprintf(print_buf + strlen(print_buf), + "\tEth rx queue: %-2s", "ALL"); + else + sprintf(print_buf + strlen(print_buf), + "\tEth rx queue: %-2d", + conn->ethdev_rx_qid); + + sprintf(print_buf + strlen(print_buf), + "\tEvent queue: %-2d", conn->eventq_id); + RTE_EM_HLPR_LOG_INFO("%s", print_buf); + } + } + RTE_EM_HLPR_LOG_INFO(""); +} + +static void +rte_eventmode_display_link_conf(struct eventmode_conf *em_conf) +{ + int i; + struct rte_eventmode_helper_event_link_info *link; + char print_buf[256] = { 0 }; + + RTE_EM_HLPR_LOG_INFO("Links configured: %d", em_conf->nb_link); + + for (i = 0; i < em_conf->nb_link; i++) { + link = &(em_conf->link[i]); + + sprintf(print_buf, + "\tEvent dev ID: %-2d\tEvent port: %-2d", + link->eventdev_id, + link->event_portid); + + if (em_conf->ext_params.all_ev_queue_to_ev_port) + sprintf(print_buf + strlen(print_buf), + "Event queue: %-2s\t", "ALL"); + else + sprintf(print_buf + strlen(print_buf), + "Event queue: %-2d\t", link->eventq_id); + + sprintf(print_buf + strlen(print_buf), + "Lcore: %-2d", link->lcore_id); + RTE_EM_HLPR_LOG_INFO("%s", print_buf); + } + RTE_EM_HLPR_LOG_INFO(""); +} + +void __rte_experimental +rte_eventmode_helper_display_conf(struct rte_eventmode_helper_conf *mode_conf) +{ + struct eventmode_conf *em_conf; + + if (mode_conf == NULL) { + RTE_EM_HLPR_LOG_ERR("Invalid conf"); + return; + } + + if (mode_conf->mode != RTE_EVENTMODE_HELPER_PKT_TRANSFER_MODE_EVENT) + return; + + if (mode_conf->mode_params == NULL) { + RTE_EM_HLPR_LOG_ERR("Invalid mode params"); + return; + } + + /* Get eventmode conf */ + em_conf = (struct eventmode_conf *)(mode_conf->mode_params); + + /* Display user exposed operating modes */ + rte_eventmode_display_operating_mode(em_conf); + + /* Display event device conf */ + rte_eventmode_display_event_dev_conf(em_conf); + + /* Display Rx adapter conf */ + rte_eventmode_display_rx_adapter_conf(em_conf); + + /* Display event-lcore link */ + rte_eventmode_display_link_conf(em_conf); +} + -- 2.7.4