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 D094CA04C3; Tue, 11 Aug 2020 10:56:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B86A01C19C; Tue, 11 Aug 2020 10:53:27 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 9285F1C191 for ; Tue, 11 Aug 2020 10:53:25 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085325euoutp023f3734bc6de5334e4a5d3aba5a5bd56e~qKrwbM9R70681906819euoutp027; Tue, 11 Aug 2020 08:53:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085325euoutp023f3734bc6de5334e4a5d3aba5a5bd56e~qKrwbM9R70681906819euoutp027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136005; bh=2YRxl3RkBrUYoDHIpEwq3S3SIsgsWy/LjzHhR+mNsQg=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Kmf4E0da6neRxLbjfs2JTfDN60LU7okwbD9zPy+kvhAqM6mqJRVrDHo4lXs3H9K/F HW+D+NcJHARdQyrAk5vtzv75KIN3V3+ODw/tTN64iHntvpY0rFrOT5c4BHp48VSZ7G Z6U4Ulo8DHuKgGLKUV9gpBYxOVHyYa9ULqzlM/0c= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200811085324eucas1p22e2d9bfab88bea4d8c51a009da12069e~qKrwHBeeG0929809298eucas1p2G; Tue, 11 Aug 2020 08:53:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C4.B1.06456.48C523F5; Tue, 11 Aug 2020 09:53:24 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085324eucas1p26b6e10bd94763582538fbad8603427d2~qKrvoasGv1587115871eucas1p2D; Tue, 11 Aug 2020 08:53:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200811085324eusmtrp24acd453506ef68772cc896cf0abb690b~qKrvnZjRJ2198021980eusmtrp2Y; Tue, 11 Aug 2020 08:53:24 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-22-5f325c84f920 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 43.1B.06314.48C523F5; Tue, 11 Aug 2020 09:53:24 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085322eusmtip16545f104a5b6a7736e5314e6ee07a1ae~qKrtyBexP1748717487eusmtip1R; Tue, 11 Aug 2020 08:53:22 +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:31 +0300 Message-Id: <20200811085246.28735-13-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: H4sIAAAAAAAAA0VSfUwTdxj2vbveHQ3FW9XwAxWyJsaPBBX0jzdjglsWc0vcYqZ/GJ1inRcg AmJLnbLNMGRAKitYCQRrCpMYKzgZpXyKG+MPPiyIlBBAUaqSERyCoF1AEcZxXfbf8z7P+/Hk ycvTWisbyiempEmGFH2SjlUzdW1zPRFZX0fFbfe1RGFVlx3w2ZNyGr2Fj1m8+CqLwsGKWGyu v6pC60gGhRbrNIX1DjOLE95MBidn6ikcvuvm8Ionk8OZ1jEOf+6xAY7Nv6CxpOw1YI+9VoVz fzaxODV/jUHL237AfFcHYHveNIOFjQ2A2WYBX928wWH5cBjOeDsYdA/VcHjL10tjbdd7wEvt VYDd2Yuq3R+Kb8uuq8Ty5nFKvPxLLy22DRVxYl6nnRKrJxsocer3fla0uCpAvPfsIi1Wjs6y +9SH1B+fkJISz0iGbTHH1AmTjeGpz9Vnc9tCMqCXNwPPE2EnyXIGmUHNawUHkLyiYtoMAUvF GyDOprWK8BrIxJ0+RhbkgYePHrGKcAPIgLeEVgofkNJxJyt3scIm4s61U7KwWqhmSf38ACUL q4S9xDrm4mTMCBvI6PTwMtYIH5HaX4s55UQ4qfytZdlHwBJfaRvxewojA6VvlpcSoYsnP/40 6vf0GfF4HKyCV5EX7S7/onVksbHUP5AD5FJdDacUBUAu2F76u2KJ6+/7nBwHLWwmVU3bFPoT YrnXwCkpBZHBlx/INL0ErXVySDKtIbnZWqVbR1o6PX6akPfvAhVaJE6Hh1MCugvkQVMfXQDh V/6/VQZQAcGSyZgcLxkjU6Rvtxr1yUZTSvzWb04lO2HpU90L7TMN4PMcbwWBB12gJjU6Mk6r 0p8xnktuBcLTutWaT7vdR7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p19EyOkotYGP4/kEXv+/D6Mk7sloc867nGzhoWf+15uW0Nv18S4u q2unz54tH9D+mPbyHtvZl3aRPJ46Wl589POy2JHOjw7ifETQM3tHUhp32utl6rQurG28YJfE TW7ZViKNvW+dkbwsUXXvP9DIu1gd+8yDe2um2Nmw8JNfRu5UhHzekGZfqTHWr+P/mOM6D6vG 6yYVhBCtZjfiekH9F4chybwHAwAA X-CMS-MailID: 20200811085324eucas1p26b6e10bd94763582538fbad8603427d2 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085324eucas1p26b6e10bd94763582538fbad8603427d2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085324eucas1p26b6e10bd94763582538fbad8603427d2 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 12/24] examples/ipsec-secgw: 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/ipsec-secgw/ipsec-secgw.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index f777ce2af..8fb3d2ad9 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1775,6 +1775,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); @@ -1794,14 +1795,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