From patchwork Thu May 19 08:48:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 68112 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3073795qge; Thu, 19 May 2016 01:49:26 -0700 (PDT) X-Received: by 10.55.132.3 with SMTP id g3mr13246194qkd.126.1463647766082; Thu, 19 May 2016 01:49:26 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i197si11318692qke.200.2016.05.19.01.49.25; Thu, 19 May 2016 01:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id C5EC96161C; Thu, 19 May 2016 08:49:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id AE79E616D2; Thu, 19 May 2016 08:48:36 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A9F8361579; Thu, 19 May 2016 08:48:29 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 74A286156A for ; Thu, 19 May 2016 08:48:28 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u4J8mQIX029696 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 May 2016 08:48:27 GMT Received: from 10.144.19.15 ([10.145.168.111]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u4J8mPeC003596 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Thu, 19 May 2016 10:48:26 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Thu, 19 May 2016 11:48:25 +0300 Message-Id: <1463647705-7056-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463647705-7056-1-git-send-email-matias.elo@nokia.com> References: <1463647705-7056-1-git-send-email-matias.elo@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 2586 X-purgate-ID: 151667::1463647707-00002418-CE8A74FE/0/0 X-Topics: patch Subject: [lng-odp] [PATCH 2/2] linux-generic: pktio: print maximum input/output queue counts in odp_pktio_print() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" The number of input/output queues may have an effect to the pktio performance, so it is useful to print the values in odp_pktio_print(). Signed-off-by: Matias Elo --- platform/linux-generic/odp_packet_io.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 15763df..ea6bfdb 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -990,6 +990,7 @@ odp_time_t odp_pktin_ts_from_ns(odp_pktio_t id, uint64_t ns) void odp_pktio_print(odp_pktio_t id) { pktio_entry_t *entry; + odp_pktio_capability_t capa; uint8_t addr[ETH_ALEN]; int max_len = 512; char str[max_len]; @@ -1005,13 +1006,14 @@ void odp_pktio_print(odp_pktio_t id) len += snprintf(&str[len], n - len, "pktio\n"); len += snprintf(&str[len], n - len, - " handle %" PRIu64 "\n", odp_pktio_to_u64(id)); + " handle %" PRIu64 "\n", + odp_pktio_to_u64(id)); len += snprintf(&str[len], n - len, - " name %s\n", entry->s.name); + " name %s\n", entry->s.name); len += snprintf(&str[len], n - len, - " type %s\n", entry->s.ops->name); + " type %s\n", entry->s.ops->name); len += snprintf(&str[len], n - len, - " state %s\n", + " state %s\n", entry->s.state == STATE_STARTED ? "start" : (entry->s.state == STATE_STOPPED ? "stop" : (entry->s.state == STATE_OPENED ? "opened" : @@ -1019,13 +1021,20 @@ void odp_pktio_print(odp_pktio_t id) memset(addr, 0, sizeof(addr)); odp_pktio_mac_addr(id, addr, ETH_ALEN); len += snprintf(&str[len], n - len, - " mac %02x:%02x:%02x:%02x:%02x:%02x\n", + " mac %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); len += snprintf(&str[len], n - len, - " mtu %" PRIu32 "\n", odp_pktio_mtu(id)); + " mtu %" PRIu32 "\n", odp_pktio_mtu(id)); len += snprintf(&str[len], n - len, - " promisc %s\n", + " promisc %s\n", odp_pktio_promisc_mode(id) ? "yes" : "no"); + + if (!odp_pktio_capability(id, &capa)) { + len += snprintf(&str[len], n - len, " max input queues %u\n", + capa.max_input_queues); + len += snprintf(&str[len], n - len, " max output queues %u\n", + capa.max_output_queues); + } str[len] = '\0'; ODP_PRINT("\n%s", str);