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 48401A00C5; Mon, 6 Jul 2020 22:40:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5CDA1DD9F; Mon, 6 Jul 2020 22:38:38 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1FB5F1DD15 for ; Mon, 6 Jul 2020 22:38:37 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203836euoutp02b66f094a00d8309f50c18e1b2db1346e~fRFMfcQvJ1760817608euoutp02Z; Mon, 6 Jul 2020 20:38:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706203836euoutp02b66f094a00d8309f50c18e1b2db1346e~fRFMfcQvJ1760817608euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067916; bh=srhawFEXUKW2qnG3XOlQI1DTOaaunL+pDywNZ8YTyIM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Ef0GElAmFi4dkdOdXBlRmj494+NHGd5KYQCLAVh+UzKkAwZd+ISgpzBaViN4ArHOV DHQyM9HGusDCgQai7nZO3OrjAtiuZBe1KBEcVYx/j2Hkj32WDJfKVECkcXkPCrkwLw zcDk0JM3jD5zXUPYcnjGNhuTSJZR4jtmtV9xnTyU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203836eucas1p28f1b735175efef95455248ed33380608~fRFL7jL3P1729817298eucas1p26; Mon, 6 Jul 2020 20:38:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 1D.C6.06318.CCB830F5; Mon, 6 Jul 2020 21:38:36 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203835eucas1p1ec5020cd607b45703a3b41144182d52c~fRFK7QLoH2656126561eucas1p1A; Mon, 6 Jul 2020 20:38:35 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203835eusmtrp2719686d1a793e2b32b3e9d23f86031c8~fRFK6cqKA0640206402eusmtrp25; Mon, 6 Jul 2020 20:38:35 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-3f-5f038bcc3061 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DD.7E.06017.BCB830F5; Mon, 6 Jul 2020 21:38:35 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203833eusmtip1ed22dd5d7f14593c05e27e328aacb6bf~fRFJJrCQV1791017910eusmtip1p; Mon, 6 Jul 2020 20:38:33 +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:30 +0300 Message-Id: <20200706203743.29416-17-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: H4sIAAAAAAAAA0VSWUwTURT1zUxnhsbqWIxc0UBs3Ddc440aUaNmoib64ZeJ1lHGaoSKrbh+ SBAJAWSpRBS1RVDBSkSwUAQklUQWW0U0BDGIDe64IGhd60IZjH9nu+e8j8fTWgsbyu807pVN Rilax6qZivrvzTM8qbR+1ruy4VjisRLs6iyg0Zv9hMXUj4kUPrJHYo3zrAotT+MpTLf0Uugs SmHxnTeBwQ99Tgo7bro5zH2QwGFf3SsOjzefIfjK303j6bxPBJut5Sr8fquKxR5/PoPpP1oJ ZjgaCTak9TKYfaOSYFKKgB8vF3JY0BGGfd5GBt3t1zks9rXQWO75RTCroYTg3aQ/qqXjxB95 F1ViQc0bSjxxvoUW69tPcmJak5USSz9UUmJPbSsrpjvsRLzTlUqLV55/Y9erN6oXR8nRO/fJ poglW9Q7/IUuOtaqPpBRa6XiSRafQoJ4EOZBx5dukkLUvFYoIuCzZLAK+UzAnduoUsgnApfa U+l/JzVH/bRiFBJwVlQPEh+B4qZ2JpBihcngTrZSAWOkUMqC099GBYxgYS2cynGpApgRJsDp L9cGsEZYCJl3ehhlIhyuXHP1t/J8UL9+7nZoQNYKYdBm+zzQCYKHh2NptoEMCCvg1mVJOQ2G 7gYHp+Cx8OeGjVLwYfha1sYpt8kEOvOPDYYiwfH2HhfooYUpUFIVocjLIOHhBUqpHwaP3o8I yHQ/tFTkDK5qIDlJq6R14Gp6MCgD/Po5VJFFeJlpUymPv0ng4e2JmSQ89/9UHiF2EiLHmWMM snmuUd4/0yzFmOOMhpnbdseUkf6f6v7d4Ksktf6tdUTgiW6oxsvTeq1K2mc+GFNHgKd1IzXL 77o3azVR0sFDsmm33hQXL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ZFL57gsjv/fh1F+IXkoSzu6Jxfn08d23d6UsqgyryLf HnovMW7Lzi6/6zuUTw4GJKJlJdorYldbbtMUXeReqHHMNrnucpdfBptze/0r40R2/66YQ7rl G0db65fN6ZzyXKrtZ7NnJdstMwcH03/stTUE2eLnVt6djLG4Y5MsNRURcUE9toRtrqd9ZR+X 3FcSQqpOvRTnBd1fNUwivAUDAAA= X-CMS-MailID: 20200706203835eucas1p1ec5020cd607b45703a3b41144182d52c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203835eucas1p1ec5020cd607b45703a3b41144182d52c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203835eucas1p1ec5020cd607b45703a3b41144182d52c References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 16/25] examples/l2fwd-event: 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/l2fwd-event/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 4fe500333..3e6d1c311 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -366,6 +366,7 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[60]; printf("\nChecking link status..."); fflush(stdout); @@ -389,14 +390,9 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - port_id, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", port_id); + rte_eth_link_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", port_id, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1