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 48AAFA00C5; Mon, 6 Jul 2020 22:28:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DCA11DCE2; Mon, 6 Jul 2020 22:27:14 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 9353D1DCDD for ; Mon, 6 Jul 2020 22:27:13 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202713euoutp028fecdf3534322598c7bf16d41716598e~fQ7P67tTD1760817608euoutp023; Mon, 6 Jul 2020 20:27:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202713euoutp028fecdf3534322598c7bf16d41716598e~fQ7P67tTD1760817608euoutp023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067233; bh=q3R1NjSfULTkmVfHv5xauRfm4wQ4m9PAU/4z8Fmz1iI=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Tyt/K07ycnbstYTCy0vlS1dvUqzmhxevImco6sT015HAq6JVm+pOMkqBTwEtXCR7G Qifc/QDf2Sko1Vq0Mf2Ib24xlxhsai8QZ3XzT0xaIuErEFPw6Uo5DcGvevwLrvIN3e 4tAuskKeAfPNidu+cejL3uZp6zhGqd8AlDSfBTbo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202712eucas1p1a9bdb8ecc390217b27856d3af601fa33~fQ7O_fqpy1287412874eucas1p1t; Mon, 6 Jul 2020 20:27:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 75.99.05997.029830F5; Mon, 6 Jul 2020 21:27:12 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202711eucas1p12fc8d5efc4eb465d9b09c2e7d2d70ad7~fQ7OjL3pw0323603236eucas1p1s; Mon, 6 Jul 2020 20:27:11 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202711eusmtrp2399d3e354d7832e43c66b57aba5a3fe7~fQ7Oibkdm3205132051eusmtrp2s; Mon, 6 Jul 2020 20:27:11 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-b0-5f03892023af Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 87.4E.06017.F19830F5; Mon, 6 Jul 2020 21:27:11 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202710eusmtip1b3677ef58ad377942ec2f494820ae140~fQ7MzBbNB1560515605eusmtip1X; Mon, 6 Jul 2020 20:27:09 +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:26:02 +0300 Message-Id: <20200706202626.28628-13-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSW0wTaRTH8820M0OxZiyynqDROlnvCrvKw9FVQSVmHoz44IMxKladgJFW tyMo+tKQXVIRkZsQQQtLYxAkAlrl4iVYlapFWNy4XMIiks0S0HKTRkG6SJ0a337nd87/nO/h 42hdNhPGHTWdlMwmQ6LAaFR3myZa1ujP0XE/Pc7isarZRrCvx05jb94/DJ4f+Y3CjooovF97 RY05bywUZuaMUlh7PZ3B972pKhwaq6Ww+4GbxcJXqSyOOftZvNBaRLB/apDGyyUfCLba7qhx 4lEDg8NTpSrMnHxN8KLjGUFXxqgK8+rrCKal8zhSXsaivXshjvU+U6G78zaLld42Gu80+whm u6oIvkybVkcvFidLrqlF+/0BSsz9o40WmzrzWTHjuY0Sa4bqKHH44WtGzHRUEPFF33lavPHv J2aXZq9m4xEp8WiyZI7YfFCTUPO2UH0id/Zpz+AmC3EHp5MgDvhIaKv2qNOJhtPx1wk4OjpZ pRgncMVXFCg+EGjy2sm3SPlnO+NnHV9G4E3xToW9BHxD8/3M8MvBbbVR/vBcvoaB2ql2yt8I 4XdA1tVUtZ9V/BIYaq7/6rX8Brg0UcYqBxbBjepG2s9BM/7J8O3AsYXQXjz+dSnwzRyU/fmJ VgIx4KpsoRQOgUGXI7BoAUzXFwf8Wfh4q51VwlYCPaW/B4aiwPGuZYY5juZXQFVDhKK3wHCr g/Fr4GdDh2eOX9MzmHO3gFa0FqxpOmVagMbnrwIawPd5lqJFcI52E+X1DwhM98ZmkUWF30+V EFJB5klJsjFekteapFPhssEoJ5niww8fN94iMx/V/b9rvI40TB1yEp4jwiytlaHjdGpDspxi dBLgaGGudutL9wGd9ogh5YxkPh5nTkqUZCeZ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p/7fhwkd3DLQgW9PT+gjo52Dw82HoinX4i6r NF40l+s1d9jdtCHNu729HA14uHLj9S39isiItiPp4RLK56vZtNBjcG/3Gk9F/a2TpVXaYug9 dzP8cObG7pKh0OGo0DUt6R1baraK5j312cqk2uSwjhDHraSLaoz0iiWLREkV+3a+PHgqy+WG hOAT5LJduJqX/wEYiSYiBwMAAA== X-CMS-MailID: 20200706202711eucas1p12fc8d5efc4eb465d9b09c2e7d2d70ad7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202711eucas1p12fc8d5efc4eb465d9b09c2e7d2d70ad7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202711eucas1p12fc8d5efc4eb465d9b09c2e7d2d70ad7 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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