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 9FDEEA0526; Fri, 10 Jul 2020 09:05:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 42EC31DC44; Fri, 10 Jul 2020 09:03:23 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 9C2401DB1B for ; Fri, 10 Jul 2020 09:03:22 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070322euoutp022d754b87cc8f08dfec0861607098ceea~gUiiZ_aDN1750117501euoutp02O; Fri, 10 Jul 2020 07:03:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070322euoutp022d754b87cc8f08dfec0861607098ceea~gUiiZ_aDN1750117501euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364602; bh=mj3hE/gu7NzVbUKqiHTNl/YjUhTA6ayvrigfQL+Dyrc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=WaR7HUvxEcHvbcgSae+OZG/mFNe+alA0FlXV6qXMMbOgGXxyh3nyq+ozCb4Tx77NS aqhnXTFdKTlcSy5L4dWX4dXYoE1P5siax5OUsfduG7r7CWtElZycivyRP+xtfV1TOd HUiZbagO6fL/Y7S3BGAd1jAj0lzQZB3H494kr28o= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710070322eucas1p12e261afd9e4899bb4b3927c38e2fb987~gUiiLFCfP2360423604eucas1p1y; Fri, 10 Jul 2020 07:03:22 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 0E.41.06318.AB2180F5; Fri, 10 Jul 2020 08:03:22 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070321eucas1p12d981060206d2964c72c0884e7415e6a~gUihwJF1L2360423604eucas1p1x; Fri, 10 Jul 2020 07:03:21 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070321eusmtrp1a6f5f0fa537baa911b16c512c4ffbe60~gUihp9BEp1113611136eusmtrp1M; Fri, 10 Jul 2020 07:03:21 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-d9-5f0812baecab Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8B.14.06017.9B2180F5; Fri, 10 Jul 2020 08:03:21 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070319eusmtip138d080059e8d235fb47f979376f24675~gUifzBtHp1336213362eusmtip1d; Fri, 10 Jul 2020 07:03:19 +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: Fri, 10 Jul 2020 10:02:15 +0300 Message-Id: <20200710070226.6045-18-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTYRjuO+fsnONocVqCLxZFg8DsZjd4LelmyPkT9COiorJpB5PctC3N tEAqTZZZ2ejeslloli1rNpOZ5Q+1tkqLmJXaMiu0m/NSaZrpzqJ/z/vc3o+Xj6fVZjaUT9Tv lgx6bZKGVTJ36waezqlS87ERZy/QaHNbCLa3FdHoNbeyeKT7EIXNpcvR6bigwIK3WRTmF/go dJSYWPziPcDgtx4HhS3VLg7PPT/AYU/tJw6PPjtP8NNQF41nC3sJPrNUKHDgYRWL34esDOYP viR4zN5AsD7Px6D5XiXBHJOA3deKOSxqmYo93gYGXa/ucHijv4nGCvcwwRP1NoJPckYUK6aL g4VXFWKRs5MST15uosW6V6c4Me+RhRLLv1VS4vf7L1kx315KxMftR2jxescvdq1ykzJqu5SU mCYZ5i3bptzx4r2dTfkYlF5s8zBZ5A1nIjwPwiIYaWRMRMmrhRICNccqaHnoI+Dp9CnkoZeA /aGFNZEgf8JZ3RgQigm4D3speegnUHbrEjfmYoUwcOVa/EKwUM6CY8hDjQmThBjIrivzVzHC DKi+85YewyohEm52/KTlFdPg+q0Hfhw0ymebrP5StTAVPJf6/KUgNPJQ8cPByIHVUJn1J/C+ SdBVb+dkPAVcJ/MCnkz4edvDyeFcAm3W7IBpOdg/P/WfgxZmgq1qnkyvBFfhVVa+0gRo/jpx jKZHYcHd07RMqyA3Ry27NfDg0fMADTD8e7xMi9DQnB84lpOAo9zKHSfTzv3fVUhIKQmRUo26 BMm4UC/tmWvU6oyp+oS58cm622T0r7r+1PdXkvtDcbVE4IlmvGrbMBurVmjTjHt1tQR4WhOs WvXEtVWt2q7dmyEZkmMNqUmSsZZM5hlNiGqhtXOLWkjQ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D1frfbHnW1V2oAvZHDvyETi wrd3Cx0T5tL73Yv33D3U1t8lhuu3et2xL4hafoQqL316OnJ0+ebms7t2+3X1bY198mbTrsiH Pts3uqUzOer8Gt3SqYQhr5XZ1iSh8uLwtEi5bxvN+eMaKykPXOYvd/TF7EzVdPouKEipWFOg 7j3np6AEnVYVQBoF7V+4rdO1CQMAAA== X-CMS-MailID: 20200710070321eucas1p12d981060206d2964c72c0884e7415e6a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070321eucas1p12d981060206d2964c72c0884e7415e6a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070321eucas1p12d981060206d2964c72c0884e7415e6a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 17/25] examples/l2fwd: 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/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..9d5f7307e 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -571,6 +571,7 @@ check_all_ports_link_status(uint32_t port_mask) 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); @@ -594,14 +595,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")); - 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