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 6178EA00C5; Mon, 6 Jul 2020 22:40:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EED8F1DD89; Mon, 6 Jul 2020 22:38:29 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 5836E1DD86 for ; Mon, 6 Jul 2020 22:38:28 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203827euoutp015554a0abf74309841cfac5da6e414b2d~fRFEDA14X1241012410euoutp01C; Mon, 6 Jul 2020 20:38:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203827euoutp015554a0abf74309841cfac5da6e414b2d~fRFEDA14X1241012410euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067907; bh=1YhjGGZIH+BiDd1vuZIqrQ6NKJL1whpE3mlU+Xfl3zM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=hwFrQvcFOPBZwju7PWcLklugD4idicR2C8p6HwKqMKeFSieyOIuXJb1u0wPNs8DYZ PgR7D4GkTHuC6KWeZFmh/YturEPiJ07VtniDl1LGQygfpiPY7e3t3sYnW9PO/l0g6i X5JIbQh20T2sumv7yg5XzU7DQhYCVOzCxtmCKLRU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706203827eucas1p14d486af9513de505e16e33414adb2788~fRFDx_lGW2654826548eucas1p17; Mon, 6 Jul 2020 20:38:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 21.E4.06456.3CB830F5; Mon, 6 Jul 2020 21:38:27 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203826eucas1p2cdffffa65bd89e363797b2cfb376abff~fRFC_vDCW2099120991eucas1p2u; Mon, 6 Jul 2020 20:38:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203826eusmtrp2efeac18c68f5a89781c3daccfadba8ba~fRFC9jbsG0640206402eusmtrp20; Mon, 6 Jul 2020 20:38:26 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-0b-5f038bc3e1fe Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8A.DF.06314.2CB830F5; Mon, 6 Jul 2020 21:38:26 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203824eusmtip1f3c9563ef48700ea441deace95bfda7a~fRFBLZ6vc1560515605eusmtip1C; Mon, 6 Jul 2020 20:38: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: Mon, 6 Jul 2020 23:37:27 +0300 Message-Id: <20200706203743.29416-14-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0wTaRTFc2famaGhZhzd8C0SjE2MrmZVotncrLgoUTM+Y/zDmN0oW2UC RChsK/jKBjSCpCBqIaJFAduoSDeiWCmKEBeiRccXbAi6AcRHRNQWrAKiFKRMjf/d8zvnfie5 +ThasDDhXJJhp2Q06JN1jEZVc3v4wc9NeXTcAmtzBFbdKwV83mWnsbuok8G8/oMUPq6MwRuu U2q0PM2isMDynkJXhZnBd90HVOj1uSjsqJdZtLYeYNHX2MPi4YclgD0jb2g8Wf4B8GHpVTUO /3udwb4RmwoLPrcBHnE2A7rz36uw6FotYI6Zx/4L51m0d0Sir7tZhfKTKyz+M9BC49V7fsBj 7irA+zlj6qUzxM/lZ9Wi/UYvJRaeaaHF20+Os2L+nVJKvOytpcS+hjZGLHBWgnj3eR4tOl5+ YjZoftdEx0vJSRmScf5vf2oS/c9kSHNodlu92VQWlHNm4DjCLyJe299m0HACXwHE1ttJK+Ij kFdddlDEByCjjjrGDCETGzW5Y5RinAciewaDYgDIUMMJNpBi+NlEzi2dMKbylxniGmmnAsYU fi0pshyCQLmKn0n2N0UGsJb/lVT0n1MrDdOJ49JNOhAJGeenb4UHsMBHkvayjxNPEv4RRy4e 6gQlv5z8X32BUuYp5I3bySpzBBm7Vhbk+8hQdTurLOcC6bJlB0MxxPn2ARsoo/mfSNX1+Qpe Rp71O2nlRpPIY8/kAKbHR0tNcRBrSW6OoKR15Oad1iAmxP8lVMEiyTP71Mp16oEM1hVTR2G6 9XtXOUAlhEnpppQEyRRlkHbNM+lTTOmGhHnbU1OqYfynyqNuXy0MtG5rBJ4DXai2m6PjBLU+ w7QnpREIR+umamPvy1sFbbx+z17JmBpnTE+WTI0wj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J/BC/9zBOOjyEU7XD352X3YEd74yPA14HbG /QGXKqBqkng/cUBfGd/f5dDEBG8OKXUM74xqWxl0tn+fZdsiy2Wx3vbg7c3BwP21QuJkbKy2 VIg9atUFJm0tW9B2sNu4a1307rJDLr/aD59GEjq3hyQqCtcVfLTmbyiPITlNa+/QlsDYFN2U fa4rTkmJaVr1ClIQtf8AJSKVwQYDAAA= X-CMS-MailID: 20200706203826eucas1p2cdffffa65bd89e363797b2cfb376abff X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203826eucas1p2cdffffa65bd89e363797b2cfb376abff X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203826eucas1p2cdffffa65bd89e363797b2cfb376abff References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 13/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- examples/ipsec-secgw/ipsec-secgw.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index f777ce2af..551838229 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -1794,14 +1795,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_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