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 A9B5AA00C5; Mon, 6 Jul 2020 22:39:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 45C421DD77; Mon, 6 Jul 2020 22:38:25 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id A82461DD77 for ; Mon, 6 Jul 2020 22:38:23 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203823euoutp010dd0b93e0a57ade76e4002759e5ed4a1~fRE-_XUcm3113131131euoutp01Z; Mon, 6 Jul 2020 20:38:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203823euoutp010dd0b93e0a57ade76e4002759e5ed4a1~fRE-_XUcm3113131131euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067903; bh=KYoq+D7jL7TMj8sFJ9dEXZ47ChxgDfY/ELcSA7WUHJo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=oizXWOmovqUsopvEKn9SsXNmwtxcz6NjY2mQlW+JM4rNXM1pJ6skbL9McABJoMqt4 MckJQAEAy/X7D7PRkARqrnVh2OcjI0AO4CkfVMLwLfl0AEh6ET0oTSlRR1DhU4UToZ f3rSgmQjW99rrlO6f0xvA7gsRuZpKmtWKK7eelmE= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203822eucas1p246db0ae1a49560d66c584a6084f1084e~fRE-ZvDlr2067820678eucas1p26; Mon, 6 Jul 2020 20:38:22 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 0F.D4.06456.EBB830F5; Mon, 6 Jul 2020 21:38:22 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203821eucas1p185226841e82d0270cb03a488cf69e04f~fRE_Ki_5S2655126551eucas1p1E; Mon, 6 Jul 2020 20:38:21 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203821eusmtrp218ea1f6e31584f76e9bd6cdeca1f6a0e~fRE_Jwqmg0640206402eusmtrp2x; Mon, 6 Jul 2020 20:38:21 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-05-5f038bbe6ab3 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.7E.06017.DBB830F5; Mon, 6 Jul 2020 21:38:21 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203819eusmtip1973b33d9066ba91081a50552c58baa52~fRE8bM1zY1560515605eusmtip1B; Mon, 6 Jul 2020 20:38:19 +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:25 +0300 Message-Id: <20200706203743.29416-12-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: H4sIAAAAAAAAA0WSfUwTdxjH87u73h2VLmch+gQUtxoT3RyMSeIzY/AlbrlkWabZYqLRdUUv aKTAeuBrYhgqwxaZFqORQUGI4cVNfAEpCKTrpijlpXTBQlCpRHEqCqJMxGpHuRr/+z6f7/d5 vskvP57WFrBR/PbUDMmUakjRsWrm8rVXnZ+2WGj9Z0NVsVjTbiM4eKecRt/x2yxaRg9S2Fu9 Apvqi1RoHciiMN/6jML6SjOLw75sBp+O1VN4q9nFYaEnm8Mx5wMOj3T9RvCB/xGNp0qfE+yy 1anw1Z+NLI74yxjMn+wh+GvtdYKtec8YPN5gJ5hjFnC0qoLD8lsxOOa7zqCr7xKHv49301jX /obgsdYagh05AdXKj8TJ0jMqsbzpISUWnO6mxWt9Jzgx74aNEi88tVPiSEsPK+bXVhOxbdBC i2fvTbBr1RvVy7dKKdt3Sqa4xB/V2/q7TtLpr6N3/zcyTrLIgVlmEsaDkAC/WJycmah5rVBJ oGjSEhpeEKi461Apw3MC/waOMe9WRv0FjGJUTBm+A9OGVhgnMHj0m6BmhYXgyrVRwVCkcIGF er+XChoRwpcQcFinNSMsgKySSjaoNcIyGPi7l1Ia5sHZ8w7aTHg+bIoXX41S7seAt+TF9E0Q 3DzY2qtD+TXQdPiUStER8Ki1llP0HAg0lIQy++DlRS+nLOcSuFN2KBRaAbWPO7lgGS0sgprG OAWvgsI/DqmCGIQPoPfJzCCmp6T18klawRrIzdEqaR04bnhCGODN63AFi9Dm9VLKUzUTaOyq Y46SeYXvu0oJqSazpUzZmCzJ8anSrljZYJQzU5Njt6QZL5Kpr+p62zpmJ+OeJCcReKIL1/h4 Wq9VGXbKe4xO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g4TMOavz/ k65TSOOkMoiXymJlsStBPEtopBoTRVSSUsceYtnDrPa/DxMEhRuQYiJnb+/ESFfGzrJMK3Ho ZGpL8Vj7HY+jKnJ1xGZVwrv55tCt8zL7ds0I2Z5w9InPmtW0I3WJec501fWiOW9jq7Y0umQ1 Bquny4bvyZ86y5bUIY+eev9Rgw9/NVJhtHuSxyj55t0bXG41b9G0xCZ3p7e3QlOaG7Wpnb9t pmSp6baY4JKV0sW4llP+BVVYLhkHAwAA X-CMS-MailID: 20200706203821eucas1p185226841e82d0270cb03a488cf69e04f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203821eucas1p185226841e82d0270cb03a488cf69e04f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203821eucas1p185226841e82d0270cb03a488cf69e04f References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 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