From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1940FA00C5; Mon, 6 Jul 2020 22:39:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AFAE1DD83; Mon, 6 Jul 2020 22:38:27 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 7B8441DD7E for ; Mon, 6 Jul 2020 22:38:25 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203825euoutp02198ae6b6dd4ff540c4e1911cd7ea2e32~fRFBqzTQk2670026700euoutp02W; Mon, 6 Jul 2020 20:38:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706203825euoutp02198ae6b6dd4ff540c4e1911cd7ea2e32~fRFBqzTQk2670026700euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067905; bh=q3R1NjSfULTkmVfHv5xauRfm4wQ4m9PAU/4z8Fmz1iI=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=eJTYCmXEZPipDrEcpKoJwY5ORMFK3a983OiZHaITDWDox9cRU8o/tLgAppDzrzi0p Y7RyUz9aSG8z05NlgsGg1Da6PxyMRVsmW5BznP/KEA6ndN5IqQTp1weNh1C+R2/gZf LC4cAFLMIV4+/mpzaYRIvHdNETZBQEZ3eEwoqcA8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706203825eucas1p182d0ad8656a63eb0252dc028fd7c2bd2~fRFBZuY1V0771507715eucas1p1q; Mon, 6 Jul 2020 20:38:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id E7.C6.06318.0CB830F5; Mon, 6 Jul 2020 21:38:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203824eucas1p1de6a23263f1d5289d0844cd01b699054~fRFAjOJ9O2655126551eucas1p1F; Mon, 6 Jul 2020 20:38:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203824eusmtrp2c1eb8352512080233ae8894b43ce4f23~fRFAidzzT0640206402eusmtrp2y; Mon, 6 Jul 2020 20:38:24 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-2f-5f038bc0cee9 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 68.DF.06314.FBB830F5; Mon, 6 Jul 2020 21:38:24 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203822eusmtip18ecc7128300d329c090070621ceb9a93~fRE_y1RKT1500415004eusmtip1z; Mon, 6 Jul 2020 20:38:22 +0000 (GMT) From: Ivan Dyukov To: dev@dpdk.org, i.dyukov@samsung.com, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wei.zhao1@intel.com, jia.guo@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com, mb@smartsharesystems.com, stephen@networkplumber.org, nicolas.chautru@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, radu.nicolau@intel.com, akhil.goyal@nxp.com, declan.doherty@intel.com, skori@marvell.com, pbhagavatula@marvell.com, jerinj@marvell.com, kirankumark@marvell.com, david.hunt@intel.com, anatoly.burakov@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com, jasvinder.singh@intel.com, byron.marohn@intel.com, yipeng1.wang@intel.com Date: Mon, 6 Jul 2020 23:37:26 +0300 Message-Id: <20200706203743.29416-13-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTZxjG/c6dzpqzYsYrOsyaeNniZEZN3hnwnu2YuMx//Mcb6+RY2Wg1 PeJliwtR6UhBwGKcoKuMasTqRGqhhaAyslGkKMKGQIKCxsi4KFAkXih2lIPZf9/3e57nfd58 +QRaZ+dihRTzPtliNqTqOQ1TUfe66dOaLDrps6s+xNJGB8HHD500dp98wGHW0DEK212rsNp7 lkV7VzqFOfZhCr0lNg4Huo8w+DzopbDzRoDHwpYjPAZre3g83nSGYE+oj8aCohGCTY5yFl// UcXhYKiYwZw3rQRzPfUE/dnDDJ6s9BG02kQcunSRR2dnHAa76xkMdFzn8cpoM43ljeMET/hL Cd6xhtnVH0lvii6wkrO6l5Lyf2umpbqOU7yUfdtBSWXPfZQ0eLOVk3I8LiI1PM6ipctPXnGb NFs0Cclyasp+2RK/8hvN7rJHheze/BkHn/UlppPAezYSJYC4DHoycikb0Qg6sYRAf8coFxF0 4gsC9xo/V4URAiPjF9h3iZ9LnIwqXJxItIV49TJKIGj38BEXJy6EQKZjcu5MsYwDb6iNigjR 4kY4Xz0+aWLEefC7KzzJteIK6Kg8SqkVc+HytRraRgQhaoL/+lesulIctJ17MTkTxHsC5F3J pVX/eshobZ/KRkOfX10CxDkQrjw3xX+El+42Xg1nEnhYnDFlWgWe/rt8pIwWP4bSqngVr4G3 oTougkGcAe3P3o9geuJor/iFVrEWMq061a2HmtstUxhgfGy6iiUoCB9l1ee5QWDAOUzlkbmF /3cVEeIiMXKaYjLKylKzfGCxYjApaWbj4p17TG4y8VMDb/2jPnIz9G0tEQWin67tFugkHWvY rxwy1RIQaP1M7do7gR06bbLh0A+yZU+SJ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9krpOLWeP8Tzh3nd/xxGefgaUNmwuMey9E7AL43X7+fO /ECZ7vGCUMMRsA/ETcuO+px5gnuU6185NjVtz4lcsuUCYRGojjplY//yhNLKwt5VqzuDpCWq NGFbehhR9eFa9MqhSZXRvDjQErU1kY0+8VBU0XK8ddGuE5aC+TtzNzeVUh+DGxrHnBH1sgPt SjPpf1ZOCPFq1h/XCeq/c3kv9wYDAAA= X-CMS-MailID: 20200706203824eucas1p1de6a23263f1d5289d0844cd01b699054 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203824eucas1p1de6a23263f1d5289d0844cd01b699054 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203824eucas1p1de6a23263f1d5289d0844cd01b699054 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 12/25] examples/ip_pipeline: new link status print format X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: i.dyukov@samsung.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add usage of rte_eth_link_strf function to example applications Signed-off-by: Ivan Dyukov --- examples/ip_pipeline/cli.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index d79699e2e..ca461ea0c 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -249,7 +249,8 @@ print_link_info(struct link *link, char *out, size_t out_size) struct rte_eth_link eth_link; uint16_t mtu; int ret; - + char link_speed_text[16]; + char link_status_text[10]; memset(&stats, 0, sizeof(stats)); rte_eth_stats_get(link->port_id, &stats); @@ -268,18 +269,19 @@ print_link_info(struct link *link, char *out, size_t out_size) } rte_eth_dev_get_mtu(link->port_id, &mtu); - + rte_eth_link_strf(link_speed_text, 16, "%M", ð_link); + rte_eth_link_strf(link_status_text, 10, "%S", ð_link); snprintf(out, out_size, "\n" "%s: flags=<%s> mtu %u\n" "\tether %02X:%02X:%02X:%02X:%02X:%02X rxqueues %u txqueues %u\n" - "\tport# %u speed %u Mbps\n" + "\tport# %u speed %s Mbps\n" "\tRX packets %" PRIu64" bytes %" PRIu64"\n" "\tRX errors %" PRIu64" missed %" PRIu64" no-mbuf %" PRIu64"\n" "\tTX packets %" PRIu64" bytes %" PRIu64"\n" "\tTX errors %" PRIu64"\n", link->name, - eth_link.link_status == 0 ? "DOWN" : "UP", + link_status_text, mtu, mac_addr.addr_bytes[0], mac_addr.addr_bytes[1], mac_addr.addr_bytes[2], mac_addr.addr_bytes[3], @@ -287,7 +289,7 @@ print_link_info(struct link *link, char *out, size_t out_size) link->n_rxq, link->n_txq, link->port_id, - eth_link.link_speed, + link_speed_text, stats.ipackets, stats.ibytes, stats.ierrors, -- 2.17.1