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 D3D79A04C7; Tue, 15 Sep 2020 21:10:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D7FFD1C1E1; Tue, 15 Sep 2020 21:08:36 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 37C041C1DF for ; Tue, 15 Sep 2020 21:08:35 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190834euoutp01cc340afeac3909f7319de03aee2005d5~1Cp2wqbOz0552405524euoutp01X; Tue, 15 Sep 2020 19:08:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190834euoutp01cc340afeac3909f7319de03aee2005d5~1Cp2wqbOz0552405524euoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196915; bh=6p7H3O/p30P7+DqRWD5odx/9ARdFqIE8TJnlYcrXyzc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=tyCZBrAU48Zt4z6RHpTFRLi1RWMo7czZDEEgkgGKuZuq6CixMUtBJt9NfkspNiTyQ EgUgucheYu7FObMWZ7OEnLT686kLx66lMePrhDxUPPdRKOvDArVvzdwURMMvHiAtjZ aQm6qi6KJKzQN1KAQ6r3kb++j85QnW1J5C/ESneU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190834eucas1p1f29fb0a714487fee04b9df0526cd027a~1Cp12GONm0047600476eucas1p1f; Tue, 15 Sep 2020 19:08:34 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 98.56.06318.131116F5; Tue, 15 Sep 2020 20:08:33 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190833eucas1p2708ab17017315c193173b423c9fa1d0e~1Cp1VSUMa2576625766eucas1p23; Tue, 15 Sep 2020 19:08:33 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190833eusmtrp183ae6948f188600fb06cf1c3d2ce591f~1Cp1UeztW3148631486eusmtrp1k; Tue, 15 Sep 2020 19:08:33 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-9d-5f6111314829 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A6.FB.06314.131116F5; Tue, 15 Sep 2020 20:08:33 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190831eusmtip2bdb03e323bb79a8440858b7d1d94f244~1CpzjEwj50503105031eusmtip2P; Tue, 15 Sep 2020 19:08:31 +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, 15 Sep 2020 22:07:14 +0300 Message-Id: <20200915190728.18143-20-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0hTYRjHec85O+c4WpyW2IuF0qDoQutKPUX3gk4QFPTBClKPelgXN2VL u3yokWE2zbxRamXqykzLS85tho1akdbcREHUrmJGlOl0ZWStbPMYffs9/+f/f56Xh5cllbl0 OHtYd0zU64REFS2nrM/GPUuWzxBilhWa10BtWwmC/rdmEvoK3tCQOXKOgJ6qTdBsuyaDvHdG ArLzRgmwVZpo+NJ3loJhn42A1w9dDBR3nmXA5/zIwMX2qwg++j+TUFT6FUF7SaMMxh8/oMHr L6cg+2cXgkuWVgQtWaMUFDTZEaSbOBi5c5sB8+sI8PW1UuDqbWDg7lgHCY1tvxHkttQicKdP yDbP5X+W3pLx5uZPBJ9f1kHyz3ovM3zW8xKCrx+2E7zX0UXz2ZYqxL/ozyT56oEf9B75Afn6 BDHxcKqoX7oxVn4o0xiWbAs7kXapgDKiC0oTCmExtwpn2H2yICu5SoRrvq81IXmAvyHc+XIY ScVXhIvq+4l/icfnLkwlbiNcVxMlmcYQ/mBPo4MNmluAXRklRLARytXT2ObvnkzP5HbjgR+O yTTFzcN9gw4qyApuHR5qvSyTNkTi6rpHZJBDAnpnUxcjbYvA3Te+TQ7FXBuL3WV3Au9jA8V2 fNcbLWVn4s8tFkbiOdiVn0VJ/vMI51obGKnIQTjt6tCUaxO2DHqY4CCSW4hrHyyVZm7BhZ7V Ek7HPUMzgmYygHnWK6QkK3BG+tQVVfjR884pGePfv6ZJMo+Lr1wjpPM8RLg86zuZgyKL/68q RagKzRJTDFqNaFipE4+rDYLWkKLTqOOTtPdR4KO6/rSM2ZHDH+dEHItU0xSlr2JjlDIh1XBS 60SYJVWhiq1uV7RSkSCcPCXqk2L0KYmiwYlms5R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gb/vdhEqkiDV1fk/J7l79H4SiptZ5fJ4VU jWZ4taX897LK5ZWtvq93Fu1tdtm+FM7E+H47rFfIo6SBiVVua62jK7L+kObtuRRV+ICPbBzs 7oYd/aXTLZ4p1my+OHPkTHXmVbc7aPedhX+3vzDvxx6ICxnHdMWqmPTPe/IPbEhMONs7FFqc 0xzCEEKcml2PGwT1P5hB/FAIAwAA X-CMS-MailID: 20200915190833eucas1p2708ab17017315c193173b423c9fa1d0e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190833eucas1p2708ab17017315c193173b423c9fa1d0e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190833eucas1p2708ab17017315c193173b423c9fa1d0e References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 19/24] examples/multi_proc*: 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 --- .../client_server_mp/mp_server/init.c | 15 ++++++--------- examples/multi_process/symmetric_mp/main.c | 13 +++++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index c2ec07ac6..a7f5207c3 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -185,6 +185,7 @@ check_all_ports_link_status(uint16_t port_num, 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); @@ -204,15 +205,11 @@ check_all_ports_link_status(uint16_t port_num, 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", ports->id[portid], - (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint8_t)ports->id[portid]); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", + (uint8_t)ports->id[portid], + link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 9a16e198c..33643d354 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -365,6 +365,7 @@ check_all_ports_link_status(uint16_t port_num, 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); @@ -384,14 +385,10 @@ check_all_ports_link_status(uint16_t port_num, 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