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 3E662A0526; Fri, 10 Jul 2020 09:04:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 90C1E1DC77; Fri, 10 Jul 2020 09:03:06 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id A3CA21DD2F for ; Fri, 10 Jul 2020 09:03:04 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070304euoutp02f688fd7b1035c88b49b02a95338b1981~gUiRr5YBC1750117501euoutp02G; Fri, 10 Jul 2020 07:03:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070304euoutp02f688fd7b1035c88b49b02a95338b1981~gUiRr5YBC1750117501euoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364584; bh=sZj87uqkawQ60wf+sT4re4HeKIKPddDywVxgWZ8WdS4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=lFkxIgBXVcTTKNSs3aRxCkReaTl5kfb1Cmb9BfTLQQOHvBkZAqaD/qu7d/vgt0EvS BlK8oiFjgKuc6CJeTGCeDcB1LjqqNmEphhqso90LWGmriFQsx8a+RiP8D2sGsJ/87l 73oYfQsAZSH3yvL/GFnLP8je1530sg7oY2H9RUlU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070304eucas1p2abc12c2669278efec738bd59cc8a82a5~gUiRZ_HHO2518125181eucas1p2K; Fri, 10 Jul 2020 07:03:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id AC.31.06318.8A2180F5; Fri, 10 Jul 2020 08:03:04 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710070303eucas1p219bcb366ddf53e49827f09e144eddbf4~gUiQ34She1196811968eucas1p2M; Fri, 10 Jul 2020 07:03:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200710070303eusmtrp2625e7cebace7695f4992a3c2b0becd9f~gUiQ2wLSu2959129591eusmtrp2E; Fri, 10 Jul 2020 07:03:03 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-ab-5f0812a8a9fb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 28.84.06314.7A2180F5; Fri, 10 Jul 2020 08:03:03 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070301eusmtip18a3b07b4c3e58332d24cefe6ec38e47f~gUiPF9ry11340413404eusmtip11; Fri, 10 Jul 2020 07:03:01 +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:08 +0300 Message-Id: <20200710070226.6045-11-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: H4sIAAAAAAAAA0WSa0wTWRiGPTPTmaFxcKwmfOIt1pisu0E0brKf90uWOL+MP9w/GxW6MkEU qmlFRWPEBrAWRO2iBhTk5nJRA7JIARG1u6FIEReWpqiIhBgJiCK3KJSKlKn6732f9z35vnNy eFpjZYP5aP1h2aDXxWhZNVNZP9YcUqThw1d+yqCxtCmbYHdnPo1d6S9ZTPmQSGF7ySastV1T ofVVAoVp1kEKbUUWFvu7TAy+H7JR2HHfyWFmq4nDIXsPh+eeXiXYM9FHY0bOMMGn2XdVOPao hsWBiTwG08ZdBM9XNBB0pA4ymF5dRTDZIuKH4kIO8zsW4VBXA4POZ39zeGu0hca7TV6CFx2l BJ8kT6o2L5HGc26opPzaXkr6M7eFluqfXeak1MfZlHTnfRUlDdS5WCmtooRIjd0ptHTz9Sd2 h/p39fpIOSb6iGwI3Rih3tdWlkUO3Q445qnzcAmknrOQAB7En6G3s5BYiJrXiEUErlQ6GMWM EPjP1EYrZpjAmXf3Vd+O5JZNa41YSOC5e7dSGiUw4CqYDljxB3CasylfMFe8w4Jtwj1leH6O GAZJWfN9HUZcBv8WnGF8WhDXQJJ1xD9gMdwse0j7dICPW/I4ZdgicF8foZROAw+W578p+lc4 VzzKKnoO9Dkq/HdbAJPV1/39E/Cx3M359gHRTKAzL8lf2gQVb5s53260uBxKa0IVvAVOmwun MYiB0P5utg/TU9JaeYVWsADmZI3S1sLDx61+DOD1zFSwBGmPXP4nrCUw3JJBXyCLM7/PyiGk hATJccbYKNm4Wi8fXWHUxRrj9FEr9h6MLSdTP9X52TFaReom/rATkSfamUKElw3XqHRHjPGx dgI8rZ0rbH3i3KMRInXxx2XDwXBDXIxstJP5PKM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ZOi9J0ZLpfx/BKt0SUNC4rovoncqvycmbaMCXt4RYiz/x wbu0Ezut7hGH9qqO2JWjmYm3hD9WVe25eE3Ds5tVW/cz8b2Z4dSBH97zjX59CtfQb6uY6OJh r6xr2tZAw7u0qvEv/kmjyRs+1A6kLswc2yhGzVr7Bz1T72zvYTLiDg7ye86NabtDN6m+N5Xy lBypE3aQJln3D8SBNGYIAwAA X-CMS-MailID: 20200710070303eucas1p219bcb366ddf53e49827f09e144eddbf4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070303eucas1p219bcb366ddf53e49827f09e144eddbf4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070303eucas1p219bcb366ddf53e49827f09e144eddbf4 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 10/25] examples/ioat: 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/ioat/ioatfwd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index b66ee73bc..8bf80c262 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -700,6 +700,7 @@ check_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret, link_status = 0; + char link_status_text[60]; printf("\nChecking link status\n"); RTE_ETH_FOREACH_DEV(portid) { @@ -715,15 +716,11 @@ check_link_status(uint32_t port_mask) } /* Print link status */ - 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")); + rte_eth_link_strf(link_status_text, 60, NULL, &link); + printf("Port %d %s", portid, link_status_text); + + if (link.link_status) link_status = 1; - } else - printf("Port %d Link Down\n", portid); } return link_status; } -- 2.17.1