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 E0ECEA0526; Fri, 10 Jul 2020 09:06:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87FD81C032; Fri, 10 Jul 2020 09:03:26 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 6CD531BFD4 for ; Fri, 10 Jul 2020 09:03:25 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070325euoutp020ed898bb907fe034d61684ab9ece588b~gUilA6Xoz1632016320euoutp02X; Fri, 10 Jul 2020 07:03:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070325euoutp020ed898bb907fe034d61684ab9ece588b~gUilA6Xoz1632016320euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364605; bh=FZgu+DseHLusxJkCwaRQ1GfffzIWoM6QnM8E1SGa7oc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=YoVtcEqPaXPtQ6b6I3Uw8T9mhsDTlue33CP9yceavawNJrb2wjnQ28cDWGB2ZGdLu cXBKhYmcv+DEb6sj0+aNiUCdK+MKwfvZtxrTta1Q/HoBfJGrGu3d758CWYObQZYuk5 oEnZIImFPMRrT1xgiYI8qvmPEA1eU0rdsd6wbDEg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710070324eucas1p168556fe1e09fd24c622b2d32ad84e62f~gUiktnYVL2360623606eucas1p1E; Fri, 10 Jul 2020 07:03:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B0.51.06318.CB2180F5; Fri, 10 Jul 2020 08:03:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070324eucas1p15a25b22ea53352cb4c4ef4456e3da94a~gUikCwRZW2480724807eucas1p1K; Fri, 10 Jul 2020 07:03:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070324eusmtrp1988f48c99418b7aeecf12fdfdc47d932~gUikBt61P1113611136eusmtrp1Q; Fri, 10 Jul 2020 07:03:24 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-df-5f0812bcacb5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AE.94.06314.BB2180F5; Fri, 10 Jul 2020 08:03:24 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070322eusmtip19e0d84bc5ae1950f33e461d20cd5296c~gUiiNjf1O1544015440eusmtip1k; Fri, 10 Jul 2020 07:03:22 +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: Fri, 10 Jul 2020 10:02:16 +0300 Message-Id: <20200710070226.6045-19-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTZxTHfe69vb1tWnMpJpyBEW1kOpKhm8tyTBZRp8s17sM+GpMN6rwC g1ZpeZmbMYxIhYrosL6CtSsYsKigAoVSHDaZBYsQzBxgeIsuQ3ATimJFQYXemn37n9///zzn nCcPR2usbDSXZsgSjQZdhpZVMo23Z7o+9mi4pLXu9rVY22kj+HCogsYR6yCLRyYPUdjnTESP q1yGpcN5FJaUBih0VVtY/Hckn8GnUy4KB1r9cjx3L1+OU95ROR7tLiM4OjtO41n7M4LdtgYZ ztxyszgx62Cw5NV9gsfq2wn6igMMWpubCJotPE5eqpJjxcAynBppZ9Dff0OOl6d7aGzonCP4 q6+W4F3zW9nGFcIr+0WZUOEZo4QTv/XQwu3+U3KhuMNGCdeeNlHCxM37rFBS7yTCnYdHaKHm 75fsN8qdyi92ixlpOaJxzYZkZerpq4Nkn0P5Y1HjKSqPjMstRMEB/xkMzzxiLUTJafhqAv1X 7OHiOYGL/bcYqXhG4Gyzk35/5PfzVrlkVBGoPOYJF9MEpvMd1EKK5VeDv9BGLRhL+GssuGZ7 Q0Yk/zUcsvuYBc3wcXAyYA5dq+bXw4NfKonUIhZq6tpCXDHPCyyO0LQafhn0XnhOSZlODnrL MyW9Bf664GclHQnjvvrwdkvBf6KYkfTPELzeG5oU+EICQ46CcCgR6p90zWuOo/mPoNa9RsKb oOhBQwgDvxj6/otYwPS8LG08TUtYDYVmjZTWQlvHvTAGmHutkrAAPcGx8PN4CJyZ8dPHSey5 /3vZCXGSKDHbpE8RTesMYm6CSac3ZRtSEr7fq79O5v+q/41vuoncnN3lJTxHtCp18hybpJHp ckz79V4CHK1dot581/+dRr1bt/8n0bg3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gpdCuwsWTbdtENOx2uMwh5B0AuG/3MY5aVIQ0b3MoMfNfBezV7vyX5g0cOW nPGRP9Nt/nsqOvdGmTbLvvoEt71b0pA7Wnqf1ZTvFtySljU/8sL0IWmKrW66Qz+n4eObTLP9 4WK8vC27poSObC3cZF20WpUYFVjKHfpUVtgSkRodytkCZrvqXM72nEb/bVX6Xxt8g1KWHCDX jbGEmKDhAnCDqPkHcT7sCgkDAAA= X-CMS-MailID: 20200710070324eucas1p15a25b22ea53352cb4c4ef4456e3da94a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070324eucas1p15a25b22ea53352cb4c4ef4456e3da94a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070324eucas1p15a25b22ea53352cb4c4ef4456e3da94a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 18/25] examples/l3fwd-graph: 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/l3fwd-graph/main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index c70270c4d..cd8e3aad1 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -599,6 +599,7 @@ check_all_ports_link_status(uint32_t port_mask) struct rte_eth_link link; uint16_t portid; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -623,16 +624,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\n")); - 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