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 B1D8CA0526; Fri, 10 Jul 2020 09:06:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 90E8E1C1A6; Fri, 10 Jul 2020 09:03:29 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 9E1261C119 for ; Fri, 10 Jul 2020 09:03:27 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070327euoutp0214466577d6c8ef7d1d9f25275081660f~gUinDgiFb1750117501euoutp02P; Fri, 10 Jul 2020 07:03:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070327euoutp0214466577d6c8ef7d1d9f25275081660f~gUinDgiFb1750117501euoutp02P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364607; bh=O8BZcOjmjjfyos4EN+drgkw7ydPT/VazCurM2vsSk0g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=hZQbmHpL420NYMIHIZw7UEfrbneFjQsO1HnquME2jhNK6O5Sibar6CrWa8VuGe3hP mnMJ3iK6fLplxLQZuyFFC53aeDhPTm7PU/wRpY56OaceXsJdfJJvYoBLX321FEn36n eWXiXBnyFKKm6bj20d4ce4PQwTXvo+qtDd6jGZTk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070327eucas1p26f3e9c71c2625aecb0b3486b50712a15~gUim26Dug2517925179eucas1p2d; Fri, 10 Jul 2020 07:03:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 53.51.06318.FB2180F5; Fri, 10 Jul 2020 08:03:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710070326eucas1p247203620422acdb424626c9f77eb225f~gUimdq4yZ2518525185eucas1p2d; Fri, 10 Jul 2020 07:03:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070326eusmtrp122521f3c9a9d6ff2f9789f0a89b3ad13~gUimc3J6N1176811768eusmtrp1r; Fri, 10 Jul 2020 07:03:26 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-e4-5f0812bf9828 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C0.A4.06314.EB2180F5; Fri, 10 Jul 2020 08:03:26 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070324eusmtip1c16cbe48e6aaa1453f49c28d26d5f8f7~gUikp7Mwq1592215922eusmtip1W; Fri, 10 Jul 2020 07:03:24 +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:17 +0300 Message-Id: <20200710070226.6045-20-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: H4sIAAAAAAAAA0WSe0yTZxTG8373Nta8frp4whaMjZq5eQ38cZYYnQtZPqMYNXFbzBA6/VKd gKQF0bkIXiC1YtVaNF5SkeoUdGMqQlVAaJBbEYSNURLnKjESrwUUFVY2qV+N//3O85znfZKT V2JllxAjbUzPVC3pplSjoOcqGobbZ9+UpeR5hb+JWNbqJth7z8Ni0PW3gPv69zAYKF2EVZUn eXT+k8ugwznAYOV5u4BPg7s4fD5YyeDdar+Ixzt3iTjo6xNxf/sJgn3hxyweK3pBsN19lcfh uusChsLFHDpGuggeKG8i2FgwwKHrmpdgvp1if8k5ET13Y3Ew2MShv+eKiBeHOli82jpK8FBj GcHb+f/zX05VRorO8oqn6hGjHD7dwSoNPUdEpaDZzSiXnnsZJVTTJSiO8lKitPTuY5ULD94I K/Rr9AvWq6kbt6iWuQtT9BvONL1hM47ot54+5uFzSZ5kJzoJaDzs3N0l2Ilekul5Ar/+YeO0 4SWBg213RG14QWDnnofs+0jPcAWvGecIOOpquIgh0yECT71JERbop+C3uZnI0iR6SYDKcDcT MSbSZdDZV8tHmKPTobq/l0TYQL+AAfsvotYwBS78XvuuTTem59mLRa0gFrpPvXz3KNBWCQIX A4wWSACHsyUangiPG8uj/An4DxdwGm+H15e7RS1sI3CvOC+6tAjKn7SNsSSxdCaUXZ+ryYuh JVRPIjLQ8RB4NiEis2PorDjKarIBbPmytm2E2ubOqAww+u84TVZgpNARvWgVgSs2L3OQTDn+ oauIkFIyWc2ypplVa1y6mj3HakqzZqWb56zbnHaZjP1V/3+NQ15SE/7BR6hEjOMMKaNCssyb tli3pfkISKxxkuGr2/61smG9adtPqmVzsiUrVbX6yMcSZ5xsiCt+lCRTsylT3a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4Q62nJ7e84dLGDZ4Edb kiO5iWhbwGiQZ/guU37cmE+Y5Ajak96YXHCePfy+5LlHf4vydFPazMk5maZbHhkyMvj7ltwU Zv8kDc//GrC7Z7T9wtvJLdnGdfJQbMq1bDZJxotDtv1Mf6l5ZR8JGtp7sirYHFZxCM+O58gu mJMUlBClVm0m9YL6HyKUW6gJAwAA X-CMS-MailID: 20200710070326eucas1p247203620422acdb424626c9f77eb225f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070326eucas1p247203620422acdb424626c9f77eb225f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070326eucas1p247203620422acdb424626c9f77eb225f References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 19/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- examples/l3fwd-power/main.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..ba6bab4a5 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,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", (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_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