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 055E6A0528; Sat, 11 Jul 2020 12:46:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD6AE1DA4C; Sat, 11 Jul 2020 12:44:58 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 62FAB1DA31 for ; Sat, 11 Jul 2020 12:44:57 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104457euoutp0101482f25537403fe54f6f8c0bfc43fc4~grNSaT60E0814408144euoutp01e; Sat, 11 Jul 2020 10:44:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200711104457euoutp0101482f25537403fe54f6f8c0bfc43fc4~grNSaT60E0814408144euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464297; bh=m59DocdpBmz6zpeYlI/lYCa1xdU/4ezlcOeXWIanCQY=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=niSx7cym8ZAY31gC0gjU7XZmy9AD8nBBik185zbP8R0yKxGDRyO6CwBoyJqP6oRiw CYypq0jBsdVOMvwoHSxoupFdutrrKm+SqEnHj5BRQCnaiiWIhRoVRzfsr3KrEo1DA3 ZOIKWOnF1+V2bUPLZVyRPP2fY88/FXPFLI/yT7Ms= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200711104456eucas1p1f5cdafa2fa1088166650b5a8f993a145~grNSIcXsv1619116191eucas1p1t; Sat, 11 Jul 2020 10:44:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id AB.1F.05997.828990F5; Sat, 11 Jul 2020 11:44:56 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200711104456eucas1p18d73e4e8c5def14db58fe74697ea4356~grNRgg_A_1619116191eucas1p1s; Sat, 11 Jul 2020 10:44:56 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104456eusmtrp18c3ef6ce903ee94522504a05af9f71d6~grNRfe3Rj2954729547eusmtrp17; Sat, 11 Jul 2020 10:44:56 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-4e-5f09982824fe Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F4.17.06314.828990F5; Sat, 11 Jul 2020 11:44:56 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104454eusmtip1d95fa1c7554bf2c3c43b572a09fd3b47~grNPr7LvG1304313043eusmtip1j; Sat, 11 Jul 2020 10:44:54 +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: Sat, 11 Jul 2020 13:43:58 +0300 Message-Id: <20200711104414.15422-12-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe1BMcRTH53fv3Xtvq+XaMp3xzMV4jTczx2O8pj/uDH80/jHDkMWVR61m V95mGpS1EjYikdUOZTOTHpQlsjPa2JQ1UpkiMQjVlkVUaLtr/Pc5n3O+vzNz5sfT2lR2KL9F v0M26HUxIqtmbpX/rJ4y4VxQ1HTbmRmYV5lJsPmVjcam040sHvMeprDOvgjvFl9QoeV1AoUp lg4Ki3PMLH5pOshgW2cxhQ2lbg7PPzvIYafzA4fHqzMIfuj5RGO69SvB6sybKvz5wMFie08W gym/agieKKog6EruYPD07RKCSWYBvdeyObQ1jMTOpgoG3fWFHF7/5qHxZmUvwVOuPIJPkv6o Fo+WflmvqCTb3RZKSr3soaXy+jROSn6USUn5bSWU1H6vhpVSiuxEetx8jJZy33WxkepV6gUb 5ZgtO2XDtIXr1Jt9J5u5uPSBu3NzMkgC8QwwkyAehNnw0FHHmoma1wo5BNrsVbRS+Ah02xIo pfhKwON5w/6LvHU85/ysFbIJNL4IVvgbgftZK/3MChPAbcrsD4cK+SwU99RS/kaIsBxOpGXT fmaEcdD44KLKzxphHrhS7bSyYBTk3ijr56A+39v+lFYWjITaS77+R0Go5CHXdJVRAhHwtsTF KRwCn1xFAR4O7tTkwMw++FFQyylhE4FXWYmBoUVQ9Lmqj3meFiZCnmOaopeAz1HWr0EYCHWt g/2a7kPLrbO0ojVgStIq0yKUPXoW0AC93cGKluBMlyVw0FICHYfO0ifJqPP/d1kJsZMwOd4Y Gy0bZ+rlXVONulhjvD566obtsQWk76u6f7t8JcTRs95JBJ6IwRqrjo/SqnQ7jXtinQR4WgzV LH3iXqvVbNTt2SsbtkcZ4mNko5MM4xkxTDMrq2WN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CQgByVHD9gGL8gm/a11E57mRC6bP/li Mvz4zr6iGU2668C6+MYHn7bk7wwePtS+q9XevvVR2Dbn/qCeY36hh33jfm0IjhjqDSFWTIl2 S512vpxd7XI0xK9UZ5UKdK5/9uam4PtZAwnOE3tjE+up+IJn9LKbipQdRFVZ2qY9+cvXvNO8 VRBCmla1BucF7V/2WCdmCQMAAA== X-CMS-MailID: 20200711104456eucas1p18d73e4e8c5def14db58fe74697ea4356 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104456eucas1p18d73e4e8c5def14db58fe74697ea4356 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104456eucas1p18d73e4e8c5def14db58fe74697ea4356 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 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