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 9C0AFA00C5; Mon, 6 Jul 2020 22:40:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D7BDF1DDBA; Mon, 6 Jul 2020 22:38:50 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 5ABC61DD68 for ; Mon, 6 Jul 2020 22:38:46 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203846euoutp01c88580e41129cc742b45556a14841fbd~fRFVIR-6j1241012410euoutp01E; Mon, 6 Jul 2020 20:38:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203846euoutp01c88580e41129cc742b45556a14841fbd~fRFVIR-6j1241012410euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067926; bh=O8BZcOjmjjfyos4EN+drgkw7ydPT/VazCurM2vsSk0g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=SHy/2RF9hhfTdt+ocMXP7OA3dB9TANhNUeBuaK+0VdYNeOR2NUmiPDSEaJ/YX+xYl GUnwWO0sBdmsvI5AEnMSfVINJYOxB2906Uo7ek077RagAVJrkY4tvLp2yfta3ATGT+ j0v8Jo7l+R7nknWQeS9AyEs/QlU0i/meIQsjBMv8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203845eucas1p24c3a55a9bc8eac98170f2c2ec1159daf~fRFUCQ4471728517285eucas1p2C; Mon, 6 Jul 2020 20:38:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 3F.C6.06318.4DB830F5; Mon, 6 Jul 2020 21:38:44 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203843eucas1p2207dc76350211e49c4b81af097499c8a~fRFS6J0VV2126821268eucas1p2E; Mon, 6 Jul 2020 20:38:43 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706203843eusmtrp158e60cc8697ecb3a32cc60b8cc64d987~fRFS5RpV12965829658eusmtrp1s; Mon, 6 Jul 2020 20:38:43 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-48-5f038bd45bb8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 53.EF.06314.3DB830F5; Mon, 6 Jul 2020 21:38:43 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203841eusmtip1ec46653a3bdfb367282da652eff8f2cc~fRFRI2Sb-1791017910eusmtip1r; Mon, 6 Jul 2020 20:38:41 +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:33 +0300 Message-Id: <20200706203743.29416-20-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: H4sIAAAAAAAAA0WSfUxTVxjGc+69vfdSrbkWEl5xEdcMs5kIbpDsjW4yjZr7h8nMosxsbKzT GyACslbwg38qAUKgQ60EJ1OEVod8BAZUPowQ1kRaVpFP+cgUqxIRN0QrVZACo9wa/3ve3/M+ 5zk5OTytLmRD+MSUo5IuRZukYZVMY8ds96aBfDpus+fNVqy9XULw0aiFRlfhfRbzX2RROFwZ jTebLirQ9MBAYYHpJYVN1/JY/M+VyeBzdxOF91qdHBb3ZXLoto1z+Gv37wTHvc9ovFD6imB3 yXUFzv51g8Upr5nBgrd3CZ62OgjajS8ZLGxpJpiTJ+CLinIOLffWodvlYNA50sBhtaeXxuu3 5wmetdcS7MpZVHz1ofi29KpCtNycoMRzZb202DFSxInGzhJKrHveTIlTbXdZscBaScS/H+XT YtXYDLtX+Z3yi0NSUmK6pIvY9pMy4Ypjhk4tUh4vu2BRGEg2n0cCeBCiYKq0jcsjSl4tXCNw 6skwIw/TBB4PLvidVwQyy9zUu0iBrUEhG+UEzK/7/YOHwILFQXxbrPAxOHNLKJ8RJNSx0OQd Wo4HCntgxlmzrBkhDEaHB2mfVglboMpdw8kVoVD1Z/sS5/mAJX7pVogPq4V1MHR5evlMEHp4 uJQ56L/STpjqeOrPBsIzu9WvPwDnOSMj6wx4Uz/EyeFcAqPmbP9SNFj/vcP5ymjhE6i9ESHj 7ZDlMrI+DMIqGJ5c7cP0kjQ1nqdlrILcHLW8rYH2zj4/BpifWyljERZHyln5eVoJdE1OkjMk tPh9VykhlSRYStMnx0v6yBTpWLhem6xPS4kPP3gkuZ4s/VXngt3TTNq8P9uIwBPNSpWLp+PU Cm26/kSyjQBPa4JUO7qc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o5 VhOq0YJOow3RhqwE9Tx5JtuwW8Em6M3CAUFIFUz/6wjGR5mOsgLFrUxehP/19nS7oJpKWhtY Devnx6jfZ4QX7/edisppObB5Y+U+35Dnj6fWyXrrIsWKTZlKWZB/wPYlybcPuo/n/twwK+eD VuV+xs3dHL9MZ9eVRttjLEcib+6IWhCwq7O8NvokLtV+XVw0p9ZUt+1V3oYXCyMu21RsTX3V n4B4NSUm6jVLSZOo/wvXqKOPBwMAAA== X-CMS-MailID: 20200706203843eucas1p2207dc76350211e49c4b81af097499c8a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203843eucas1p2207dc76350211e49c4b81af097499c8a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203843eucas1p2207dc76350211e49c4b81af097499c8a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 19/25] examples/l3fwd-power: 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/l3fwd-power/main.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..ba6bab4a5 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1945,6 +1945,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,9 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf("Port %d Link Up - speed %u " - "Mbps - %s\n", (uint8_t)portid, - (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint8_t)portid); + rte_eth_link_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1