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 0CDA8A04B5; Thu, 10 Sep 2020 21:36:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07DF31C1A8; Thu, 10 Sep 2020 21:34:58 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 48B0B1C1A7 for ; Thu, 10 Sep 2020 21:34:57 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193457euoutp02a36860a6c0e9d322c743b51e9e733ccf~zgyc0kgaK0499204992euoutp02c; Thu, 10 Sep 2020 19:34:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193457euoutp02a36860a6c0e9d322c743b51e9e733ccf~zgyc0kgaK0499204992euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766497; bh=PBAyJH+AMK1xxIDr0X+5LdKR/8t0CIeYr6u1GtWAoJE=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=nP2lhHio7pM27EbD9lslkTz8IC8YgjYyubdjDj9kWlo8dAo24wzzQCbyEckZfHHQU BFxeOrJBHfe/+xPwZZVYg5gK4WCuXndW2Td3g/H5Cyu0hujDhZiaX0dE9rifiSIWW4 Th57PyBhLvydwN5GKuCVBc4+aeXhDaXXTIiurcfY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200910193456eucas1p2aad10d35dd2a848a88ea3426226d77c6~zgycfQ_yb2535025350eucas1p2i; Thu, 10 Sep 2020 19:34:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 59.1D.06456.0EF7A5F5; Thu, 10 Sep 2020 20:34:56 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200910193456eucas1p25839dc5b17a0eebece4c7c0ab1e4dbbf~zgycF-hvW2616126161eucas1p2x; Thu, 10 Sep 2020 19:34:56 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193456eusmtrp1d67761e3b90c7adf241e6513ff300b65~zgycE4SkR3165331653eusmtrp18; Thu, 10 Sep 2020 19:34:56 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-ad-5f5a7fe00ccc Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 58.9A.06017.0EF7A5F5; Thu, 10 Sep 2020 20:34:56 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193454eusmtip25620693accc44896e02643293c6d13ab~zgyaR6ZxL1532615326eusmtip2W; Thu, 10 Sep 2020 19:34:54 +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: Thu, 10 Sep 2020 22:33:48 +0300 Message-Id: <20200910193400.15326-16-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSf0wTdxjG895d747GzvM080UX3DoX0WQ657K9MQR1Meb+cNn23yTRWuGG BiimFdAt2Yhz0JSKUMkW24UxGgMDM2QiIAOtLLPqIQqK6MZccTJA/FGLNYIwR7ma/fe8n+d5 v0/y5iuycgW/SNxl26PabdZsM2/kms9NdL8Z+jLN8pbvt2XU0FUJdPuWn6VQxZ88lYQPMHSj bh21t3xnIM9fhQyVeh4x1FLr4uleaD9HDyItDA10aAJ5e/cLFOkcFujgZR/Q8NRdlo5UjQNd rjxpoImzbTw9nKrmqHSyD+hQ03mgoPsRRxWnWoGKXBKFf6wRyD+QRJHQeY60mycEOhbtYelk 1zRQebAB6FLRc8P615TJqqMGxd8+yiiHf+hhlXM3vxEU94VKRml80MooD0/38UppUx0oF2+X sEr9naf8R8Y0Y0qGmr0rX7WvSt1u3On8tRF2XzPu/XosvxDOii5IEFF6B28NNTIuMIqyVAt4 5XkJrw+PAc+MXI0744DunrDhxUptg8ugGzWA/V2/xFNRwOjkKSGW4qVk1JyVs8YCqZHHlql+ JmbMlz7Eo54zsyFOegOH/DWz2iStRd+BQV6vWIL1xwOsC0QxYYYPDmyNYVlKwv7vH8++idIV Eb3Xxxk9vxGfdJQLup6Pd4NNcf0KaofdnL5QDFjefELQhzLAr3z346l12DTWLcTaWGk5NrSt 0vEGvBou52MYpZfwxv15MczOSE/zt6yOTegskvW0GQMXeuMYcfrZHB0rWP/UFz9WB+BQzTMo gyXe/7uqAOpgoZrnyMlUHattasFKhzXHkWfLXJmem/MzzPxV7d9gpBWivTs6QRLBPMcUWJtm kQ3WfMe+nE5AkTUvML1/SdsmmzKs+z5T7b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cob/PowS+aUiVft+whqavetW9u1XmYqCyBW6 wZiaU66AqxviyfLc8froa38Cp6tP5Rw0L0vIjzpnVdfOmhcpbyTnYZcC0gMdyd1V7dxUwQ6V 9/14mXIVHz5oyy3pmproSVaLqgOzWw9sPV+ytDBu2/EN3btPpohML/2/bf/wy6/5/bFwU2GL ce91KcHHauSBuIHX/APiIoNrBgMAAA== X-CMS-MailID: 20200910193456eucas1p25839dc5b17a0eebece4c7c0ab1e4dbbf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193456eucas1p25839dc5b17a0eebece4c7c0ab1e4dbbf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193456eucas1p25839dc5b17a0eebece4c7c0ab1e4dbbf References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 15/24] examples/l2fwd-event: 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 --- examples/l2fwd-event/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 4fe500333..d90c71698 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -366,6 +366,7 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, 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); @@ -389,14 +390,10 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - port_id, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", port_id); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", port_id, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1