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 5556CA04B5; Thu, 10 Sep 2020 21:35:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAE621C134; Thu, 10 Sep 2020 21:34:44 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1801A1C133 for ; Thu, 10 Sep 2020 21:34:44 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193443euoutp025a58f4f6d2b47a0b2cb4f43fb2f6cbba~zgyQjPBo20499204992euoutp02b; Thu, 10 Sep 2020 19:34:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193443euoutp025a58f4f6d2b47a0b2cb4f43fb2f6cbba~zgyQjPBo20499204992euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766483; bh=0UwttxWlMNSO6zvpNf9yvDxpqBtUhn2OurscN38uKVo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=tR8BhaHOje74KyD7bdYWXOqOqXEGbDch44BdYsYzRL8B+a+E7ZZXvAQuvH+wmY4jA RvIVu+yz8zzmTGMJu4GMchxOyXBxFbTZSmCBVXDRdWQK3gkxUXXB2ITrgU6s9tIAe5 LF2umKdTA9Pu0bruPfEdgg+uvE82jiHQ51bWTLEU= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193442eucas1p1ad8c160525e8de590a248a00960ec884~zgyPjKKWy2933229332eucas1p1H; Thu, 10 Sep 2020 19:34:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8C.D5.05997.2DF7A5F5; Thu, 10 Sep 2020 20:34:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193442eucas1p14b936dcafe61c23d23cb6e99aa934768~zgyPCuP0r2935729357eucas1p1y; Thu, 10 Sep 2020 19:34:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193442eusmtrp11cedea6751416af7b100a6d427fd015d~zgyPB46eS3165331653eusmtrp11; Thu, 10 Sep 2020 19:34:42 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-a9-5f5a7fd25939 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D1.9A.06017.2DF7A5F5; Thu, 10 Sep 2020 20:34:42 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193440eusmtip2f1d6c0781cc485ca50881adcf24462d5~zgyNQ0ZBt1654016540eusmtip2C; Thu, 10 Sep 2020 19:34:40 +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: Thu, 10 Sep 2020 22:33:43 +0300 Message-Id: <20200910193400.15326-11-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0wUZxTFvTOzM8PqNtORhCtFqJOaWKNiK6ZfTINIsE5iGhuNbUKidJUR jCzqDuAjMRKkPJYVEWhRMFtk0yLQlIcLC0QNEgXsglSaDRCRoqEQX6AILSCPsswa/zvnd8/9 zv3j42kxj/XnD8cnKOZ4Y5zE6pm6lqnO9V1nI6M2ZhasJ5XtNiBP+u00Gch/xJKsV6kU6Snf Sm44r+hI7t/JFMnOfU0R5zULS14MpDBkZMxJkb6bLo4UdqVwZKx5mCPnO4uADM88o8nl4jdA Om21OjJ1u5ElozMlDMmedgO54GgD0mp9zZD8hnogaRaBvCor5Yi9L5CMDbQxxNV7nSO/TTyg SW37LJCLrZVAOtLmdWGr5OniX3Sy/cZTSs67+oCWW3p/4mTrPRslV4/UU/LoLTcrZzvKQf7j SRYtVwxOst/oI/VfRitxh5MUc3Do9/rYEns/e8yy8uS/U3eYZLD6WcCHRyEE53ofUhbQ86Jw DbAqvdprxgH/etTiNW8Ahxr+Yd6tzJYNegelgGWDmYxmJgDz346DJ8UKa9CVYVtM+QrVLDpn uinPYLnwFQ7X1Os8mhFW48MrlkVtELZg1lC1TqsIwoqqJtoCPO+zwB/37fNgUQjE7p/HF99E oZ3HAusIpeUjsDS3jdb0cnzW6uA0HYCuPCujLaQDXqy7zmkmB/Bc0Utvais6nt/nPG208ClW NgZreBv2j2YtHoHCB9jz8kMPphdkbl2BFxswI03U0hI23evyYsTZt8s0KePQ5Nfa9TcB3T1H ciCo8H1TMUA5+CmJqilGUT+PV05sUI0mNTE+ZsPBo6YaWPiqrrnW8XponDnQDAIP0jJD05bI KFFnTFJPmZoBeVryNYR3uP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OSX6OojCjpKb+JiOS6B4//nMKnM24JW7e211822XMjccsCSeNB8ri0p tMmQ77dLeSLm2fZu5fZE0TY56cxYyn/pD1v0d8+b2A8l1lR7f6FPStEyoaU+7N2tDsj1rEvJ yT9SK3sadW44eUCVbbAsbnYeOugz3rVhJ7+79JTFc3aNNmxda36WpSNrfVmtV9vCvsm0G3G2 MUxFCNF6jQ/OC/p/TU6QiQgDAAA= X-CMS-MailID: 20200910193442eucas1p14b936dcafe61c23d23cb6e99aa934768 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193442eucas1p14b936dcafe61c23d23cb6e99aa934768 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193442eucas1p14b936dcafe61c23d23cb6e99aa934768 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 10/24] examples/ip_*: 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: * ip_fragmentation * ip_reassembly * l3fwd-acl Signed-off-by: Ivan Dyukov --- examples/ip_fragmentation/main.c | 13 +++++-------- examples/ip_reassembly/main.c | 13 +++++-------- examples/l3fwd-acl/main.c | 13 +++++-------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 4afb97109..c7348bee5 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -593,6 +593,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[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -612,14 +613,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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 494d7ee77..6241c9824 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -712,6 +712,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[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -731,14 +732,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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index f22fca732..e773d3586 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -1815,6 +1815,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[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -1834,14 +1835,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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1