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 62A4DA00C5; Mon, 6 Jul 2020 22:28:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE62A1DCDA; Mon, 6 Jul 2020 22:27:12 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 3F9FB1DCCE for ; Mon, 6 Jul 2020 22:27:11 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202711euoutp022f54e392c40e78fa5bdfd4b5bfbee0c0~fQ7NuwlTJ2313123131euoutp02H; Mon, 6 Jul 2020 20:27:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202711euoutp022f54e392c40e78fa5bdfd4b5bfbee0c0~fQ7NuwlTJ2313123131euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067231; bh=KYoq+D7jL7TMj8sFJ9dEXZ47ChxgDfY/ELcSA7WUHJo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=eNOUARENg/OrQEtSebEDhnN/UsX/NbupZS+LyRHBW9RT2RMTi5zEVGa4OkchVDfxf TKWm0hw0KESwT7o/SvpbwCxg+0XUHOCGDliTxb+W60LEYti6aSv2iMfYbm54q1tsDI Gu4TgtPP0J7jCt1u7kWwBVPTQ/mvGKacGQ75GjQE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706202710eucas1p2f5415bce5265dbed3cf8221f077725ea~fQ7NOUThR0115501155eucas1p2n; Mon, 6 Jul 2020 20:27:10 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 16.96.06318.E19830F5; Mon, 6 Jul 2020 21:27:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706202709eucas1p2cb2da3247bfdd0b25a3fdfd2fd7b2d99~fQ7MIIcIM0114101141eucas1p2n; Mon, 6 Jul 2020 20:27:09 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706202709eusmtrp166da330fb42f16bf93c2a339b43929b0~fQ7MHHzdA2178321783eusmtrp1s; Mon, 6 Jul 2020 20:27:09 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-29-5f03891ea62c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 09.AF.06314.D19830F5; Mon, 6 Jul 2020 21:27:09 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202707eusmtip151c65d78ce32a4c3cec1bcc084f4f3bb~fQ7KXelzY2342423424eusmtip1c; Mon, 6 Jul 2020 20:27:07 +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:01 +0300 Message-Id: <20200706202626.28628-12-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: H4sIAAAAAAAAA0WSfUxTZxSHc+57e3vp6HJXyDxBh7HLIpr4sciSE2PU+ZHcZMtCsn8WFseq 3qCBomnFzS1xBLRhgJ0WlMm2jpUYFc2Qz1ZFQDZBrAw1MVBhWJyxAZVWoCpQ5mhvzf57znN+ 5z3JySsyw3EhRdydt0+x5JlyjYKOb+ma7luR+j3LWj3ZvIjqbjqBHgzXMPJX/C1QaegQRwO1 G6jV/bOGHPcLOLI7nnHkPlMi0BN/IU/jE26Ohq54tVR1p1BLE50BLR3p+wkoEBljdLJ6EqjP 2ayh6auXBApGXDzZZ+4C/dB0Hai77BlPFRc9QLYSiUJnT2upZiiVJvzXefL6GrV0PnybUfPN OaBj3XVAvbZXmo1L5JnqUxq5pnWUk8t/u83kLt8JrVzW4+Tk+nEPJwfb7gqyvakW5BsPSpl8 7uFLIUOXqVu3U8ndvV+xrFr/pW7XYF8l2zu78OvnwTAUQNHbJZAgopSORROHoAR0okE6A/ho 0MerxRSgvb5KoxaTgO3XwprXIy1DPk5tnAY8NTfG1CIM6PDei6UEKQ29xc5YKlmqF9Ad6eei jSRpKz78p5dFmZfeQ5d9Jub10lr8ozEA6orFeO5CRyyTMO//DDYKUTZIqdj/61TsUZRuiTjc 1q9VB7ZguetlnJNwrLspzovQW17Gq/wtvmiI5qPDxYDDrsPx0AZsevzXPIsik5Zh3aVVqv4Q j4yf4KMapTdx4OlbUc3m0dFSyVStx2KbQU0bsaPnTlwjzs0mqlrGwfbS+LGuAI7VvuKOwuKq /3dVA9TCAiXfas5WrGvylK9WWk1ma35e9sode8wNMP9Zvf92hz3QFtneCZIIxkS9X2RZB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ssCJYsQlkSyWZtPmglI5R6vhjPJ/Aa//nMMrFMw2lFRy8VmRff7T/ckWEwZKS ZbMWX5+vVuSPTyyYHnjZJGn3tdt2roo3Zb3o3ECaO/QtfqvHisZS+0Ozm/cuF8nXTv9k9Tea 7q96ucUsMRr2nLg3+sVIU2GYp+21UtFKpBpS8t2O+xRkhS/KSD/Je8GBfX4NRW/CvRJK6hyt PsuSZYQQq2R9ca2g/AeAYhfyCQMAAA== X-CMS-MailID: 20200706202709eucas1p2cb2da3247bfdd0b25a3fdfd2fd7b2d99 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202709eucas1p2cb2da3247bfdd0b25a3fdfd2fd7b2d99 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202709eucas1p2cb2da3247bfdd0b25a3fdfd2fd7b2d99 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 11/25] 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_strf 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 | 12 ++++-------- examples/l3fwd-acl/main.c | 12 ++++-------- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 4afb97109..18a6df77e 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[60]; 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_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 */ diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 494d7ee77..910c89ae3 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -731,14 +732,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 */ diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index f22fca732..ddfec9487 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -1834,14 +1835,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