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 B8C60A0526; Fri, 10 Jul 2020 09:04:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 643011DDB1; Fri, 10 Jul 2020 09:03:11 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id CA8C61DDB1 for ; Fri, 10 Jul 2020 09:03:09 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070309euoutp01533ed3a9c79d7e33ebc055118cf86770~gUiWeZ7Jc2059620596euoutp01Y; Fri, 10 Jul 2020 07:03:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200710070309euoutp01533ed3a9c79d7e33ebc055118cf86770~gUiWeZ7Jc2059620596euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364589; bh=q3R1NjSfULTkmVfHv5xauRfm4wQ4m9PAU/4z8Fmz1iI=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=P89OWLX1c7BhmHPDnIsIOYXpw7T0tRBoIZVCyb5J6nPZr4Aewqm4K05AlvwzkiTiy O0nCm9z4rkz1JESPMyJxD5hMUfkVtkbvZNHWHvxyj4Bk44nrg/eQmLhFUN0zGw52Qv 4nJ3OH7tsHiBaAS6JtO8mSCbrCQZxHlgNsGs1tAY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070309eucas1p2c340f84e50498a3550ab581b38f787f1~gUiWBbCZ_2518125181eucas1p2R; Fri, 10 Jul 2020 07:03:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 46.4F.06456.DA2180F5; Fri, 10 Jul 2020 08:03:09 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070308eucas1p1fe7a14edec5a90560e8e4f9284ce1796~gUiVpVVDa1630516305eucas1p1S; Fri, 10 Jul 2020 07:03:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070308eusmtrp14bab06aaa1dcd7f9aed7eb6b620e3de1~gUiVn40GM1176811768eusmtrp1P; Fri, 10 Jul 2020 07:03:08 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-0d-5f0812ad6a29 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F2.94.06314.CA2180F5; Fri, 10 Jul 2020 08:03:08 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070306eusmtip107231c90cb33a6f31a8d464bf9bed110~gUiT3GddH1602216022eusmtip1K; Fri, 10 Jul 2020 07:03:06 +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: Fri, 10 Jul 2020 10:02:10 +0300 Message-Id: <20200710070226.6045-13-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfUzMcRzHfX/PHWc/x/QdyZwhNg9h9mHyNNmPNbP5i03nh98u9GB3Qgw3 o9qVc8qYkFyI1HpwXLUkN3pw5ZTVYeQ0k0J1Pank4a7fmf/en9f78/58vvvsy5GqdGYKtzf2 oKSLFaPVjIJ6WDXknJ+v4jSL3rbQUFCXiaC1JZsE94X3DKR0nybgde5qKLddpSHtg4EAU5qH ANsdIwPf3Kco6OyxEfDukYOFjMZTLPTY21g467yCoG2kg4TLWb0InJkPaBh6UsZA14iFAtNw E4Jz1hoE1akeCi6UliBINPLQfTeHhex3wdDjrqHA8eY+C3n9DSQ8qPuF4Hx1AYL6xD/0mhnC cNYtWsgubyeE9BsNpFD15iIrpNZmEkJRZwkhdFU0MYLJmouE560ppHDv0yCzRbFdsXKPFL33 kKRbuGqnIqroYwZ9IH38ke8dYQbkGGtEARzml+LmqhzSiBScir+DcIrpMSMXfQjf+Gig5KIX 4YHaPvZfpPDpI9qnVXwOwqU//Yl+r25vJXwGw4dgR3Im4TMm8UUMto24Ro2JfASuz3MyPk3x s7DH4hmdquSX497HBlreMB3fK6wkfTrAy88YLay8LRi7rveNDsV8HYfzBwykHFiPuwadlKwn 4o5qq/+pQdiRnurnx/CPYhcrh5MRbrGc8TetxtavL7ya40h+Li4oWyjjtfhmUh7jw5gfj19/ n+DDpFemPbxEyliJkxNVcrcaV9Y2+jHGv36Ok7GAv7huI/k+5d4jPrtGmtH0jP+7shDKRYFS vD5GK+lDY6XDC/RijD4+Vrtgd1xMMfJ+Vcfv6p4S1N+4y454DqnHKUv+MBoVLR7SJ8TYEeZI 9STlunpHpEq5R0w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A6QrZRkM60xUiZRZeCTeT6V1//vw0TiIBPaVWHLJs19mcZPNxq3bGbSM50J Bz9Yzxf87M9Y6h/eH23SpazPebzJmtCXtYMrcrV1YW1NHROb/+aX1j9Z0erupXdufNXJz8bb z6h/lzvffT3qTgx5VmC71TaosseJywYutcZ16ollyUOmSU2C1GCMWuU5oEy1BA+Uxtg8LXVq GSGoVYpNuF5Q/QPBSpDhBwMAAA== X-CMS-MailID: 20200710070308eucas1p1fe7a14edec5a90560e8e4f9284ce1796 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070308eucas1p1fe7a14edec5a90560e8e4f9284ce1796 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070308eucas1p1fe7a14edec5a90560e8e4f9284ce1796 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 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