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 67373A04C3; Tue, 11 Aug 2020 10:58:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2453C1C1DD; Tue, 11 Aug 2020 10:53:39 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id CE0221C1D2 for ; Tue, 11 Aug 2020 10:53:36 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085336euoutp01fb831d90ccafbf4d98eeffe7475c16d1~qKr7BqFdU0904509045euoutp01P; Tue, 11 Aug 2020 08:53:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085336euoutp01fb831d90ccafbf4d98eeffe7475c16d1~qKr7BqFdU0904509045euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136016; bh=Saq1UnDTMyInlHRQMQ1mmtOASs5FmeYLGJOeDi0MAGU=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=UGy3kCSEcdDMKmvdSlcASw8XtFepeFlMRowDd6v324sG/p8+XHe3tJ9B6GYwvgWmR ivxlfSZQewbATEb1Mfrwwnc+EHHzaeNb5hmULxOQcfSSvWKu7KiCidcrhQ3KHoyVfW xZtQZ6gxTfDTZq9onu+R+oIfkWKJjxt9bcJhhgZ4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085336eucas1p1d155caffdee6b1562cfd86298f67875c~qKr61O4_R1537215372eucas1p1A; Tue, 11 Aug 2020 08:53:36 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 71.C1.06456.09C523F5; Tue, 11 Aug 2020 09:53:36 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085336eucas1p239879bd738b4725f673b033e25056a30~qKr6h4mYU1211012110eucas1p2k; Tue, 11 Aug 2020 08:53:36 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085336eusmtrp17bc2e56cef0ffbeb93d48b0d571c33be~qKr6gjS1j1680216802eusmtrp1J; Tue, 11 Aug 2020 08:53:36 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-49-5f325c90d6f1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A3.6D.06017.F8C523F5; Tue, 11 Aug 2020 09:53:36 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085334eusmtip19cf7241a5333c4e7ebf2e0886ddc8992~qKr4wNptD1807218072eusmtip1X; Tue, 11 Aug 2020 08:53:34 +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:37 +0300 Message-Id: <20200811085246.28735-19-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: H4sIAAAAAAAAA0VSf0wTdxTPu7veHdXqWYx8g78vbtnMpjDM8rK5icbEW6LGmDgTsg1PvIAR KulZnRo3xKVqqcgP0Qy0ImyCxYwBpXQMjBIDavkhbAxYdLLKYqwKpdo4lKrQY9l/n5/vJS+P p42FbCy/07RHMZvkdJHVM+7Wsc738774IDmu6M85WN3uAPT9VU7j4Km7LOYEvqOw37kKmxrO 6rDgXhaFuQWjFDZU2lh8PJjN4HCwgcI7zV4Oi3uyOQy2PODwRFcJ4INxP43flz4F7HLU63Ds WiOLI+NlDOa+6AU86boB2GYfZfDULx5Aq03AwKUKDsvvLMDg4A0GvQN1HF4OddNY3x4GzG+r BuywvtYlLpZelP6ok8qbHlJS4YVuWmodOM1J9psOSqoZ9lDSyJVeVsp1OUG65cuhpaqhf9lN +iT9yh1K+s69inn5p9v0acOeITqzU/+1+4cVWeDmbcDzRFhBjpyLtoGeNwqVQHKKL1MaeQak 7ETrFHkKpKi+n7ZBVKRRc78XNKMCiP/6SVYjoYmKs4+bTLHCO8R7zBGpzxZqWNIw3kdNGtHC evLb3aFIiBHeIkWDhyNjDcJHJHCtndVWLCRVP1+N6FETelXJvQg2CgtI3/lnkaFEuM2TsT9u gVZYSxyBMZ2Go4m/zcVpeB7xFtoZrXAUSL67jtNIHpAjJU+mUquI61EnN3kPWniXVDcu1+TV pNt+jtHONIP0P5k1KdMTsMB9htZkAzlmNWppkVy92TMlExJ+OV2DErmfHaPdpxlIbb4f8mBh 8f+rSgGcEKNY1IxURY03KfuWqXKGajGlLkvZnVELE6/qfdUW9ECoZ3sLCDyI0w2ZH8cnG3Xy XnV/RgsQnhZnG9Z0eL8yGnbI+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Z7L1oQpWrzPz0Twfx5v+9wjGxTMFhSTnnSuhFj1b+J4azpm/xmY9 odmjsnQcE/cvchX3Na3oxY6dwXTp8r1cdNxS8kdFuL6NCJ4XnPj03fDzHRHa49scZd5jzclB QuIdNvP5m57WrVeLn9AnK6M9YpLqrIGhqcmPtpzUTy6+6DMafkmbftNeHrBymUd66aZei2Ey ZK9MSQmROvVq0iTo/gHh2SwFCAMAAA== X-CMS-MailID: 20200811085336eucas1p239879bd738b4725f673b033e25056a30 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085336eucas1p239879bd738b4725f673b033e25056a30 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085336eucas1p239879bd738b4725f673b033e25056a30 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 18/24] examples/l3fwd-power: 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/l3fwd-power/main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..ff862fbc8 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1945,6 +1945,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,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", (uint8_t)portid, - (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint8_t)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