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 2FD49A04C3; Tue, 11 Aug 2020 10:57:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B451F1C1C8; Tue, 11 Aug 2020 10:53:34 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1F1341C1BF for ; Tue, 11 Aug 2020 10:53:33 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085332euoutp02bcad0a2bdaaed3cf02f9bf33ac64011c~qKr3h5o8F0724507245euoutp02k; Tue, 11 Aug 2020 08:53:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085332euoutp02bcad0a2bdaaed3cf02f9bf33ac64011c~qKr3h5o8F0724507245euoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136012; bh=b/FcqPCd9j+W8IX9nJTt/R8XFTRep+NsEaK9WjFu1tY=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=VVrYLOcBxe7lsEH2pmLgy4R9mqBsKR4gW+8pat+7/MSP0nuz2uY/xR2+ZpD36hNUR 2JB9uHy4wfM68IJiI05PBzW96g2lYv2ZkFXKNJ43Gqlvu2H+kqPIFxWZDwQi16UbtS 1x/LFG7fmGwmfc86LIqzMMWdjCDP+sSb5OsYVsfw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200811085332eucas1p2c4185cb372c143918b7594b9da54fca9~qKr3WAV_Q1587515875eucas1p2Z; Tue, 11 Aug 2020 08:53:32 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id E4.FD.06318.C8C523F5; Tue, 11 Aug 2020 09:53:32 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085332eucas1p2a859ec9426e0c58abbda7c1bd4ef1b44~qKr24xnnP0327403274eucas1p2R; Tue, 11 Aug 2020 08:53:32 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085332eusmtrp1a229f74050a2364864686d10e05728ec~qKr235hOw1680216802eusmtrp1G; Tue, 11 Aug 2020 08:53:32 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-33-5f325c8c5e1a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DF.5D.06017.C8C523F5; Tue, 11 Aug 2020 09:53:32 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085330eusmtip136deace1e04cac37513d983beaf841c3~qKr1F9LfY1748717487eusmtip1U; Tue, 11 Aug 2020 08:53:30 +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: Tue, 11 Aug 2020 11:52:35 +0300 Message-Id: <20200811085246.28735-17-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0xTZxjOd87pOYdqzbGY8AaNxibNZJm3yfSNDJ1mm+cHP5Zlf7YxSzeP IELBFvDywzBdmGKHpVSnYiqXMCpgEOXa4GWNWOVwkU7CJdw0RgNORJTFsqK2nBr/PZf3ed8n Xz6e1trZaH6PKUsym4xpOlbNNN72d622Jn5qWNdQp8faDifBhyPlNI45hlk8MfUbhf1VW7G1 6bwK7aO5FBbYX1DY5Mpn8d+xIwxOTjdROHRN5vCc7wiH054nHP7RXUzwSWCCxrMlLwl2OxtU 6P/bzeLzQBmDBbO9BE/W3yHotb5g0NHSTDAvX8Cpi5Uclg8tx+mxOwzKA1c5rJnpobGhY45g obeWYGfeW9UXK8XZkgqVWN46TolFpT20eHvgNCda7zopsW6ymRKfX+9lxYL6KiK2PzxBi9WP XrPfqH9Qf75LStuTI5nXbklSp/SdraAyneoDl/oHVbnEyueTCB6EWJjw3VPlEzWvFVwELnSe pxXyioDP18sq5CWBHrubex+5P9hGFKOSQIt3OJyfCeZripjQFCusAvmYkwoZS4Q6FpoCfUHC 85HC1zBi3xiCjKCHEZs5BDXCZhj7NUXZvwKqL9+kQzgiKFcXj85jrbAc+i68mt8Iwi0e5nra KSXwJchuZ7hcJEx468N4GchFVkYJ/E6gsPEqpxAbgaPFz8JTW6H+aRcXakELMVDrXqvI2+D4 tDxfGYRF0P9scUimg9De+CetyBo4lqdVpnVw864vLAPM/b9QkUXw951ilfrXgm8ox9vIinMf TpUQUkWipGxLerJk2WCS9q+xGNMt2abkNb9kpF8hwZ8qv/HONJPrgZ89ROCJbqEmM269Qasy 5lgOpnsI8LRuiWZ7p7xTq9llPHhIMm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9FqdoNivTSFbg2X0VGclb/A87G85X8Oo7x8E1HS0Rm/bZ25BeXrdVlhfgvnJX2S3MPy eVNhWc4pw4ZKXfyOyDB3LXn1wZ3rJon+0tCSvqZidjLX1DOh08iv8+lT3sP5DVfyDCddLu7B 4KG4Tce5ddmX4UTxEfuhmZSwiLs6PmRB+7PFP7G3b0vkYnH2ENaR+cMmzXDpFOz33lgFIRg4 lT9uEbh/bwFcCwYDAAA= X-CMS-MailID: 20200811085332eucas1p2a859ec9426e0c58abbda7c1bd4ef1b44 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085332eucas1p2a859ec9426e0c58abbda7c1bd4ef1b44 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085332eucas1p2a859ec9426e0c58abbda7c1bd4ef1b44 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 16/24] 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_to_str function to example applications Signed-off-by: Ivan Dyukov --- examples/l2fwd/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..b229a760a 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[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -594,14 +595,10 @@ 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_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1