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 8C129A04C3; Tue, 11 Aug 2020 10:56:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFDB51C1AE; Tue, 11 Aug 2020 10:53:30 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 443BE1C1AC for ; Tue, 11 Aug 2020 10:53:29 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085329euoutp023819595dc158ae112228790e93ba8b33~qKrz9B69L0724507245euoutp02i; Tue, 11 Aug 2020 08:53:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085329euoutp023819595dc158ae112228790e93ba8b33~qKrz9B69L0724507245euoutp02i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136009; bh=TIVv8jtUIUUjQpoFfPW2Uq8iZzgFgtt0hRv53s5mn9E=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=QIz+BFgN5yLKISsMXbAqkTottqXkHIFS4H5TXJuCCGF96B0ca7UTORcbH40js5qAY U67cQ/z1ColW+nKB4kEjBAyMNRwF5+40G2GG8qBairbIAv1YhtkeR/teQLRxX8Y43Z 6yJMXzh0Vimz2vcM7CkuNzveR4nL3WuZvpeInSNM= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085328eucas1p1a595187467c0e452ae6b4910081f00ba~qKrzvuYJU1187911879eucas1p1l; Tue, 11 Aug 2020 08:53:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id E8.B1.06456.88C523F5; Tue, 11 Aug 2020 09:53:28 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085328eucas1p27b1c8ff1901fd75ecb06c180c6c29d3d~qKrzWYdlW0326103261eucas1p2G; Tue, 11 Aug 2020 08:53:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085328eusmtrp1403886d7881a93cd1ba41bf44ddb80e0~qKrzVZ_NI1667616676eusmtrp1l; Tue, 11 Aug 2020 08:53:28 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-2f-5f325c8862bb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FB.5D.06017.88C523F5; Tue, 11 Aug 2020 09:53:28 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085326eusmtip1b58954b18ffcddf2a9844274905dc2ec~qKrxdCkPs1792217922eusmtip1L; Tue, 11 Aug 2020 08:53:26 +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:33 +0300 Message-Id: <20200811085246.28735-15-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: H4sIAAAAAAAAA0WSfUwTdxjH87u73h2NNbfq4hMwMJu4TI127MU86qIMSXZL/IP5h8kWFA65 gAqIPVCZyQKoiBUR8G2CwQqZYLEiWgoSRQRDYW3XgQElYUCMWsCJimAUYYxyNf73eb4vz5P8 8uNp/Wk2mN+Rmi6bUqVkA6tlHG3vvCvzYr6K/bLy6EqscZcRfNRfQePgqX9YPPbyEIUPrRvw Vv15DRYPZFFYUPyKwvoqM4v/DuYwODpWT2HfbReHJV05HI61+Dg87i0l6JsaofGc5TVBb1md Bt/dbWTxxVQ5gwWT3QRP2NsJOvNfMXjqZgPBXLOALy9XcljRF4pjg+0MunpvcHhlopPGOvc0 wSJnDUFP7owmYok4aflDI1bcGqbEkxc7abGt9wwn5neUUWLtaAMlvmjqZsUCu5WIfz46RovV j9+y0dpftN8lyMk79som4/o4bZJn1Mak2bX7h4a6uSxylTeTIB6Eb8DiuMyZiZbXC1UE+t78 rlGHcQLW8WxGHV4TuORzMR8qJw63BlKVBJqzhwP9CQIj169x/hQrfAGuvDLKbywUalmon3pA +Y0FwiYw20pZPzPCUijptM3pOmEtlLd20OqJMKi+1jzHQbN6denAHOuFUHhwYXxuKQhuHp4U v2XVQhQM3XNzKi+AEac9wIvBdTKfUQtHCBQ5bnDqUEjgYOnzQGoD2J/9Ncs8TwvLoKbR6EcQ voec5hgV58PD55/4w/QsFjvO0qqsg7xcvbrDAM0dXQEZYPr9PFUWwXPUF3is2wRmauu4QhJW 8vGUhRArWSRnKCmJshKeKu9bpUgpSkZq4qrtu1Ouk9nP6vrPOdZAJrriW4jAE8M8Xdq68Fi9 RtqrZKa0EOBpw0JdpMe1Ta9LkDJ/lU27Y00ZybLSQk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tH11w7pLL2q1810zItxw 45X1c9ona+/N7Uu6E2d7vNc1G5MdZ5SJS1bNWz8rTHerL3Wduf3+Z0/VSS789GLnos7qeIWf 1Xdk1zdNYF3aOaWWjARrpCLWsnlNW8Lo3ZtsPx6yR5vuhCYp4uiDju7iQ1sWFuocjpzcN7+e iAVKQtBq2PG4UdD8Bbhh3CcJAwAA X-CMS-MailID: 20200811085328eucas1p27b1c8ff1901fd75ecb06c180c6c29d3d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085328eucas1p27b1c8ff1901fd75ecb06c180c6c29d3d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085328eucas1p27b1c8ff1901fd75ecb06c180c6c29d3d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 14/24] examples/l2fwd-crypt: 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-crypto/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 827da9b3e..da3b12f4f 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -1734,6 +1734,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); @@ -1753,14 +1754,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_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1