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 C06BAA00C5; Mon, 6 Jul 2020 22:29:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EF2C1DD15; Mon, 6 Jul 2020 22:27:31 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 19D8B1DD13 for ; Mon, 6 Jul 2020 22:27:30 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202729euoutp02c5776c98b489ca95361f08defbbdb4fc~fQ7fS3GZ01760117601euoutp023; Mon, 6 Jul 2020 20:27:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202729euoutp02c5776c98b489ca95361f08defbbdb4fc~fQ7fS3GZ01760117601euoutp023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067249; bh=FZgu+DseHLusxJkCwaRQ1GfffzIWoM6QnM8E1SGa7oc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=vK16U1hbO/sgc3h1qZ/LABzdOHvGRuouI+AwhrGvSq/6t0Zzv/Z1U6sTN03EQZ54H qQ5JwPMFOLkLSDH+aQHPgOvgeVURKk/jD+jhpjUE4Wag/DhuOot9e68YQPJtqWn/lo RXbl6WJEkwONdHyiiQpm7oIb9HC3uhAFO2LjrQas= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706202728eucas1p27bad5b671aa96e3508e2fff06a8fd49e~fQ7eRVyaG3131931319eucas1p25; Mon, 6 Jul 2020 20:27:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 9E.96.06318.039830F5; Mon, 6 Jul 2020 21:27:28 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706202727eucas1p2b575e02cd42371084aaf970887fad4da~fQ7dFfUee0116301163eucas1p2r; Mon, 6 Jul 2020 20:27:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202727eusmtrp2e17ac4291a46978c0d2ade2eb1e88706~fQ7dEu_Bq3205132051eusmtrp2z; Mon, 6 Jul 2020 20:27:27 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-3f-5f0389304843 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 6E.4E.06017.F29830F5; Mon, 6 Jul 2020 21:27:27 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202725eusmtip155eb32bd544424679d71ddead1f9db76~fQ7bS5rvY1791017910eusmtip1D; Mon, 6 Jul 2020 20:27:25 +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:26:08 +0300 Message-Id: <20200706202626.28628-19-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0wTWRTGvTPT6dBQMlRZz6oBbWKyvngEoicbFZ9xYtQYE82GRLHqBIyA 2gqKrxRRtiKiFpTobgqWGBGNgDxaSTFYDQWqsjTKw0UWia7IKihKFtlil3FK/O87v++79zu5 uRytMbPTuN0pB0R9ii5Jy6qYmoYvLQsiT9Pxke2+uVj2yEKwt7uYxp78Fyye+XCSwo7SWHTY fleg+S8jhbnmjxTaSrJZfNdzgsGBIRuFXXVuJV7xnFDikPONEs+2/EbwjbefxstFnwi2WKoV +OV+LYuDXiuDuaPPCJ6raiToyvnIYP5dO8GsbB4/3LiuxOKuUBzqaWTQ3VmpxFvDrTRWPxoj eMFVRvBxlk+xbJYwWnRNIRQ73lJC3tVWWmjovKQUcposlFAxYKeEwXvPWCG3qpQIzb1naOHm qxF2oypOtXiXmLQ7TdRHLN2uSiy4/YLss6oOna65RBlJvzKbBHDAx8DJtjw6m6g4DV9CoNc9 4B8+E+jL97Hy8InAA89rxcQRq6OPlrSGv07gqitRDg0TGDMXspLB8j+B22ShJGMKX8GCzdtO ScZkfh20tnURSTP8bPgjx8NIWs3/DPdHCvxLhcHN8vpvDQHj/OFgJSu3hUJ74WdKzjRycKMl Rtar4HVfs3+7ydDvqvLfMwN8dwv9+SPw7512pbQQ8CYC3dZT/lAsVP3zZFxzHM3PgbLaCBkv h4yuEVbCwAdBx/tgCdPj0lxTQMtYDaYsjZzWQn2Tx48Bxv4LlLEA+c4K/1PVESj6Nfw8Cbvy vaqIkFIyVUw1JCeIhugU8WC4QZdsSE1JCN+5N/kOGf+p7q+uYTu5593hJDxHtIHqHo6O1yh0 aYb0ZCcBjtZOUa947N6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ubtao o9TREKOOjoiOWAKKmdJc1pkoY/VaM5/K8xm86f8dwUjkmYjJ6JNHSGYxhvjylav2ac90rUuV zLSb+ss9xc4450bcsmNtf058gkpPjW8bPORwqVTDfBu1J9R73mPpfX6lXjc/L+5uS2uHLCEV Dux/H9a5ve+9/v6hfYHFc0saZy9WV0/zjHR6Pzg0l6U/q387EhftRVneDaO67/GryetZyjwF JSRr1QtJk6D9C1j+yyEIAwAA X-CMS-MailID: 20200706202727eucas1p2b575e02cd42371084aaf970887fad4da X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202727eucas1p2b575e02cd42371084aaf970887fad4da X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202727eucas1p2b575e02cd42371084aaf970887fad4da References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 18/25] examples/l3fwd-graph: 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-graph/main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index c70270c4d..cd8e3aad1 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -599,6 +599,7 @@ check_all_ports_link_status(uint32_t port_mask) struct rte_eth_link link; uint16_t portid; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -623,16 +624,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", - portid, link.link_speed, - (link.link_duplex == - ETH_LINK_FULL_DUPLEX) - ? ("full-duplex") - : ("half-duplex\n")); - else - printf("Port %d Link Down\n", 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