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 9CBD8A00C5; Mon, 6 Jul 2020 22:39:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF6611DCFC; Mon, 6 Jul 2020 22:38:21 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 664921DCF8 for ; Mon, 6 Jul 2020 22:38:20 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203820euoutp017ee9db627bbac820c17477bdc392800d~fRE86Kph10553305533euoutp01j; Mon, 6 Jul 2020 20:38:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203820euoutp017ee9db627bbac820c17477bdc392800d~fRE86Kph10553305533euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067900; bh=sZj87uqkawQ60wf+sT4re4HeKIKPddDywVxgWZ8WdS4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=KS3eEcZVls1TgMp5KBMkxoLK+UXZuMmlo0EadYDsYEjyuys2PKH7hp76czBgKU6bq tYWHhivGaYBxgF6z3/cwT3Xe+acdwyOJaVAEnHOuJblqQD8zoHjogBBA7UeajIUz1V KoHv4ZIqpkgXW4HivtklA9PZi8/zQxZIu7t5Y6jk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203819eucas1p2709a18cdbbb209a7a9e32ec34cf79b4a~fRE8pl--m2126421264eucas1p2v; Mon, 6 Jul 2020 20:38:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C5.C6.06318.BBB830F5; Mon, 6 Jul 2020 21:38:19 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203819eucas1p194ba5cda089597317d68ba5338d12f12~fRE71x0kb2452524525eucas1p1C; Mon, 6 Jul 2020 20:38:19 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203819eusmtrp2244bd80f81b489bf41826817a747b9f0~fRE70wFy50640206402eusmtrp2v; Mon, 6 Jul 2020 20:38:19 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-2a-5f038bbb074c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 38.7E.06017.ABB830F5; Mon, 6 Jul 2020 21:38:18 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203817eusmtip1413debf2f9ac25750b266e286d244247~fRE5_0Y9H1791017910eusmtip1l; Mon, 6 Jul 2020 20:38:16 +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:24 +0300 Message-Id: <20200706203743.29416-11-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: H4sIAAAAAAAAA0WSfUxTVxjG8957e++ls8u1sPgGELOaJfNjMMeWvFnMwH3EmyxL/GP6B9nE qnfoRotrBZUlCgaRAGMbI5LJqAxUGEqKWKEwZNCFz5YRmmnRgGvYMgUVFOhEPmSUW7P/nvf3 POc855wckdWX8JHiQfNhxWI2php4LdfY9XTgtV8K2OTXbYE4sntsQKN3qljyl4zwVPAoh6Gh 2gRqbfpRQ8V/ZjFUVPyYoaaafJ4e+E9yNDHVxNDwdbdAZ70nBZpy3RXo64EyoLsL4yz9UDEN NGC7pqGnHS08TS5UclQ0dwPoG0cPUHfhY45Kmp1AufkSPfq5WqCq4Ria8vdw5L51VaDLgUGW rnkWgb7rtgP15y5pEl+W5youaOSq1jFG/v6nQVbuunVGkAt7bYx8ZcLJyJNtN3i5yFELct9o AStf+nuW36FN0m7dr6QezFAsce/s0R74o74cDtWFHZ1vmxeyoEvIhzARpTexvO+ZJh+0ol6q AZxonOHVYQbw1397QR2mAW3t/fzzJT0+H6sa1YD/lN0LpQKASxc6V1K89Cq682xM0IiQrvDY tOBjgka49AF6n2RzQc1Jr+DgWPbKSXTS2+i9OByqWIeX6tuXK0QxbJmXd0YGsV6KQd+5mZU9 UfKIWHDmvkbNv4/1k7Og6nAc73aEbheNS83nGFV/hU8afIK6OA/wTuWpUCgBHfd/F4JlrLQB 7S1xKt6GnQ2lTBCj9CIOPVwdxOyyLG4sZVWsw7xcvZo2YHuvN4QRF+dXqVjGmbJ2Rn2e64DT /iHuW1h39v+uCoBaWKOkW00pijXerByJtRpN1nRzSuy+NFMDLP9V97PugBPaFva6QBLBsErn F9lkvcaYYT1mcgGKrCFC926/e7det994LFOxpCVb0lMVqwuiRM6wRhdfOfap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izP99hEgsz0UCf/ZKr0e9rdobGLkS9iO5e1FF lMlrfW7o9iT3LFUFXgw0+47kZeknkt479xwoVxrGpl3h08cmZfvGm40XwmTOg/a8TV++dB0n DhzeWvY67YkObxlOWFb4JsQ9ubdRPpgS82hL4g7dPl+kyfWZi3ZkJy9Uv43QT8T0+k+FtKyN VlB8ula1gjTz2n9uGL1YBwMAAA== X-CMS-MailID: 20200706203819eucas1p194ba5cda089597317d68ba5338d12f12 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203819eucas1p194ba5cda089597317d68ba5338d12f12 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203819eucas1p194ba5cda089597317d68ba5338d12f12 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 10/25] examples/ioat: 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/ioat/ioatfwd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index b66ee73bc..8bf80c262 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -700,6 +700,7 @@ check_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret, link_status = 0; + char link_status_text[60]; printf("\nChecking link status\n"); RTE_ETH_FOREACH_DEV(portid) { @@ -715,15 +716,11 @@ check_link_status(uint32_t port_mask) } /* Print link status */ - 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")); + rte_eth_link_strf(link_status_text, 60, NULL, &link); + printf("Port %d %s", portid, link_status_text); + + if (link.link_status) link_status = 1; - } else - printf("Port %d Link Down\n", portid); } return link_status; } -- 2.17.1