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 0AD54A00C5; Mon, 6 Jul 2020 22:29:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A94F51DD29; Mon, 6 Jul 2020 22:27:33 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 858231DCD0 for ; Mon, 6 Jul 2020 22:27:31 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202731euoutp01281b328b8ae5956f4a8768a669faf844~fQ7gnmrIK2593425934euoutp01i; Mon, 6 Jul 2020 20:27:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706202731euoutp01281b328b8ae5956f4a8768a669faf844~fQ7gnmrIK2593425934euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067251; bh=O8BZcOjmjjfyos4EN+drgkw7ydPT/VazCurM2vsSk0g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=k9NcxmsJzy/HwjhUpSJwavP0x+JklGxdqrdqQ2vvPdcLaoTwY40f32W36XYTgTfEU 8bfk9D2har68qhLQWzbsL9ZqglQwp9zuoFA1vAyuO1o7svmh26HTN8w9wuvGsWErnl bNv/Ik8ylHZdjmTsdL+ECHs6OhssX4dpnlN9hXAk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202730eucas1p18b6ca3b076c7bebbaf64c55e375fbd1b~fQ7gBpneS0787207872eucas1p1a; Mon, 6 Jul 2020 20:27:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4A.99.05997.239830F5; Mon, 6 Jul 2020 21:27:30 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202730eucas1p1112175f892b58de011b4002fd66b0d36~fQ7fpygnU0478404784eucas1p15; Mon, 6 Jul 2020 20:27:30 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202730eusmtrp2d73e885c9e40013e337ca0596c3b3491~fQ7fowoJY3205132051eusmtrp20; Mon, 6 Jul 2020 20:27:30 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-c6-5f03893244e4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B1.BF.06314.239830F5; Mon, 6 Jul 2020 21:27:30 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202728eusmtip17a7245de4ff52ca9275e1bd8b7049f93~fQ7duxfGT1560515605eusmtip1b; Mon, 6 Jul 2020 20:27:28 +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: Mon, 6 Jul 2020 23:26:09 +0300 Message-Id: <20200706202626.28628-20-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfUxTZxTGPffe3ntpKHlXP3jDUGN1UxcRPzZ3tsz5EZ130z/252JUqHID ClTTChPNTMOUsIKoQDAyg0C3yNCFoUU+Vgw0hBZbQYykoCioMwRUPkuGtY5Rbo3/Pef3POc8 yZtXZLWFfJR40HBUNhr0KTpezd1sfd0es+4XNm6NO+djrPKUAD59bGWxv/ARjzmjpxjsrtyE 9tpLKszvMzOYlz/GYG2FhceX/ZkcDo/XMtjb6Baw+F6mgOOOAQHPdPwKOBAYYvFi6QRgR0mN Cl83N/A4EijnMM/fBXjW5gJ05o5xWFhfB5hlITj6xxUBrb2LcLzfxaG754aA1yY7WazxvAU8 76wCvJM1rdq8RPKX/q6SrPZBRioo62Sl1p4iQcptK2Gk6uE6Rhq51cVLebZKkG4/zWGlq/9M 8d+rd6u/SpBTDqbLxtiv49VJv7mm2CNF6mNlF60qM5wWLRAmUvIp9Xv9nAXUopZUAK0PtIQG H1DbzxZBGSaA5t1uVL1bcXSb2aDWkitAe+7vUkKTQK/d7ZsN8WQFdWeXMEFjHqnmaW3AywSN uWQXPdXVzAU1Rz6ir8qLhaDWkC9p3yW3oDQsplf/apptCJvhLSM3eKVtEfVe9s0epcQjUvtg Da8sbKPPK9pB0XPpkNMWOhRNp+svM4o+Qf+97hWU5Wygj8tPh0KbqO1F+4wWRZaspFUNsQre QjP/HJrFlETQ7lcfBDE7I/NvXmAVrKHZWVolraNNbfdCmNK3b8IVLNECX0foERuBeuodcA4W F7/vKgWohEg5zZSaKJvWGeQfV5v0qaY0Q+LqA4dTr8PMX3X/5/TVQUNgvwOICLpwTTbPxmlV +nRTRqoDqMjq5mm23nHv02oS9BnHZePhOGNaimxyw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LtPMsrtrFw82rF/oibXcjniuzl8qdfW E7cblox324oOmqa5BymO2Tg/39nlq4ht+rDy0QynRZ23zE4Tu6Snw0tszoGslOjija1u7/Zo d+7JePZNfT0kTTm4T948EH9v/NFup9oRrcUvvdua2PdDWQWW/ZaUru3+r9RM/5noKI+GxtBK BSVqNao1pFHU/AWVd/nHBwMAAA== X-CMS-MailID: 20200706202730eucas1p1112175f892b58de011b4002fd66b0d36 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202730eucas1p1112175f892b58de011b4002fd66b0d36 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202730eucas1p1112175f892b58de011b4002fd66b0d36 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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