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 C9203A04C3; Tue, 11 Aug 2020 10:56:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 17F531C139; Tue, 11 Aug 2020 10:53:25 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id BDF7D1C13A for ; Tue, 11 Aug 2020 10:53:23 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085323euoutp020ee43345abd8c484ec24b97bd423f170~qKrugxEQR0711807118euoutp022; Tue, 11 Aug 2020 08:53:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085323euoutp020ee43345abd8c484ec24b97bd423f170~qKrugxEQR0711807118euoutp022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136003; bh=m59DocdpBmz6zpeYlI/lYCa1xdU/4ezlcOeXWIanCQY=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=c8jnwDpUT6oa1ivfdo+jh6MXzFpY/4e2drEt2rebt+FzG75WTwhZSJMlEubo2rRs8 KU89tCnkXPPnePipIqLndZuYO38pklNwx0ni1t1ZnNKdK/Gqgn1upYfvAmXsQc8V+u WZv6j8jD+utXqhISNpPyQad4uSyj9r4Im3lB8Vvg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085322eucas1p1354d2345a6ead2aa65e840bfad0a78bb~qKruOvAIB1585315853eucas1p1B; Tue, 11 Aug 2020 08:53:22 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 6A.ED.06318.28C523F5; Tue, 11 Aug 2020 09:53:22 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085322eucas1p25b30133706c03257172cd3348f7feb7d~qKrtxQ1DY0327003270eucas1p28; Tue, 11 Aug 2020 08:53:22 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200811085322eusmtrp25cfbffb2889daa41df15a26d8b062b3e~qKrtwE4Ym2198021980eusmtrp2U; Tue, 11 Aug 2020 08:53:22 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-0b-5f325c82b7c6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 90.1B.06314.28C523F5; Tue, 11 Aug 2020 09:53:22 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085320eusmtip17543bd08263709779dde1aebf25b1878~qKrr5huyT1666316663eusmtip1H; Tue, 11 Aug 2020 08:53:20 +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: Tue, 11 Aug 2020 11:52:30 +0300 Message-Id: <20200811085246.28735-12-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSf2wTdRjG895d726VkrOQ8DplwyZmTLHjV/BVUcCYeIkalmAiM8BW5bIt bmNp2RTjH7Mzkwy2lbJpoK7rWIS5uoyyri1kYF2EDjucW0BGRLY0CgEcbKVTtxWw7ZX43+d9 nvd53zfffEVW38xniqUVuxVzhanMwGs537nZ4eet21YXrgwfXE09Q06gyLUOliaaf+dp39Tn DI11baB+/9caso/XMNRon2bI31nP018TVo7uRP0MXT0dFujwqFWg6MANgRqGHUA34rdYOuS6 BzTs7NPQ7A+neLobP8JR49wloCbvIFBo/zRHzScDQHX1Ek19e0ygjqtZFJ0Y5Ch8pVeg72ZG WOobug90INQDdKHuoWbj0/Kc6xuN3NF/k5EPto+w8rkrXwry/vNORvbcCTDy3TOXeLnR2wXy T5F9rOz+418+X/uedv1Opay0WjHnvVqkLYnZIkLloYUfuzsdUAMjj9VDhojSWvw1GufqQSvq pU7Af1qbIWnopRhgw+h61bgHGJnqEx4lYlYbrxrHAOfdtYxazABedLWk4ry0HMN7nSljseTh 0R+/zCSNRdJb2BQ4yiWZk57B7smZFOukl3AkMM2qK7LRfTyY4oyE7naMs+pNWXi5LZYaitKQ iD2nOkANvI4NnphG5UV4K+RN3/oUPjzZlg58AXjA1yuohQ2w1jGZ7tqA3ts/J1gUWSk3MTVP lTfhib/n2KSM0kIcm3w8KbMJtPu+Sss63FunV7sNGDw/mpYR788vUFHG1sYX1fc5DRi0Wxkb ZB/+f5ULoAuWKFWW8mLFsqZC+choMZVbqiqKjR/sKj8Bib8afhCaCcCZ+PsDIIlgWKCrfHlV oV5jqrbsKR8AFFnDYt1rF8I79Lqdpj2fKOZdheaqMsUyAE+KnGGJbs2Rm9v1UrFpt/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n9RFf2bJes8prjQPQxTVSR ob439clRe3Wd/2RA7P5lk3U7FT5sc/4a+5rnk3Fwu2TlpoH1p77scvKRrW5/91mLjUpnimdD jA8f3cxsCHyVGXXE8XjwqjHEs/HVWS9T+NC7Q1prSVXGBal/5gSHW4ZW+O0wnoxqif5kz0mP kRF8kpoJwPW8+h+moVL9CQMAAA== X-CMS-MailID: 20200811085322eucas1p25b30133706c03257172cd3348f7feb7d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085322eucas1p25b30133706c03257172cd3348f7feb7d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085322eucas1p25b30133706c03257172cd3348f7feb7d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 11/24] 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_to_str 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..236553aae 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_to_str(link_speed_text, 16, "%M", ð_link); + rte_eth_link_to_str(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