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 46148A04C7; Tue, 15 Sep 2020 21:10:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F24801C1C1; Tue, 15 Sep 2020 21:08:23 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 66B821C0C6 for ; Tue, 15 Sep 2020 21:08:23 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190823euoutp01b7cdf53cdf7f8a4c5d4ee82944ef3fec~1CprzHQK80552405524euoutp01V; Tue, 15 Sep 2020 19:08:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190823euoutp01b7cdf53cdf7f8a4c5d4ee82944ef3fec~1CprzHQK80552405524euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196903; bh=PBAyJH+AMK1xxIDr0X+5LdKR/8t0CIeYr6u1GtWAoJE=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=CttNugaIpzzl9OSd2ntPIWedD7tEZkBu8nhjewXPkYZ1L/l6QI3yZEymzoxnXmG7X FX/Fq828kycKf2XCoQ5gyEV5nqr6bUuS9/COzcQv2QKe6WrmUkNcbuo8UzSSIsA63c GL0S8q/KvaGfgbxaxawKE1OZh0K06KcZfhVsFD5c= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190822eucas1p1ad4bed353aa8d51e7745473a9af00e75~1CprI55123106731067eucas1p1y; Tue, 15 Sep 2020 19:08:22 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4A.DF.05997.621116F5; Tue, 15 Sep 2020 20:08:22 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200915190821eucas1p101ad6e551219cd63fbf784ef8ea366d0~1CpqnVAC50047600476eucas1p1X; Tue, 15 Sep 2020 19:08:21 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190821eusmtrp168ac4be8c3afdc3e5e576aa5a058ce16~1CpqmkiH33148631486eusmtrp1Y; Tue, 15 Sep 2020 19:08:21 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-6a-5f6111264900 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8E.EB.06314.521116F5; Tue, 15 Sep 2020 20:08:21 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190819eusmtip237d79ce81efb6d9ac52ed57b520635d7~1CpovOlzE0744507445eusmtip29; Tue, 15 Sep 2020 19:08: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: Tue, 15 Sep 2020 22:07:10 +0300 Message-Id: <20200915190728.18143-16-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: H4sIAAAAAAAAA0WSfUxTZxTGc+69vfe2ocu1uHgCE7MmWwaLwtRsJ+6DbXHmLvzhYpYsMVGs coNGitgr+JEsEnS1IlYFsgmYymiYrhiRgRSIKBZCkRYRJsEvPqIjRB2oWJ0wlLXemv33nN/z vO85580rsqZiPk7ckr1DsWVbssy8gWvsnO5d/P48S3rKyFA81QZdQHeH3SyNlg7xdOjxfoZu eFLpgveEjopH8hlyFj9hyHu6kKe/Rws4mpzyMnSnNSBQeX+BQFO+cYEO91YAjc8+YKms8ilQ r+u8jqYvt/D0aLaKI+fMANCRhi4gf9ETjkqbm4DshRI9/v2UQO47CTQ12sVR4Ga9QGee9bF0 PvgS6Ji/FqjHPqf78l15prJaJ7sv3Gfkkl/7WLnz5s+CXHTFxch1k02M/OjiAC87Gzwgd989 xMo1f73gvzOsNXyWoWRtyVNsyV9sMGx2tNdBznXDrp8e5uXDZbEQ9CJKy7GofJgrBINokk4D HpvpjBYhwOE/y1iteApYWm0X3hzZH5jTacYpwFDzNYgYJukZYEHtqojmpQ8w4HAxkdB8qY5H 7+wgEzFipdXoPnDv9U2c9B7aj2vaKK3AsesjjNZhEdaca2MjWh/m/c0DgtYgAQdPhqKZoIjB wz9qeiU+72iP8lh84G+ITvoOBkqKXu+D0oHwco31glYcBdxXMRFNpWLDw6thLYqslIi1Lcka /gqrPKNsBKP0Ft6YmBfBbFgWN/4SxUZ02E1a2oxtV/qjGPHlvzGalNE1/b32VK2ALfvGhaOw qPz/VpUAHlig5KrWTEVdmq3sXKJarGpuduaSTdusf0D4pwZe+UNN0DK70QeSCOYYY+XtDekm nSVP3W31AYqseb7x657AepMxw7J7j2Lblm7LzVJU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AmkJ5akZqemFqQWwfQxcXBKNTA2LTXQa/6v9+4U17M7PMkZ7x61efmpBVi5 eW/lLtoikWyzbkr2RVdei/j5gvtqlRNSf5+ZeDjD4Zd+NXv9x6S/cWzPGaKu5ahL2om1H37N OY2hKM0v/vCyBMePNtLafLsymG1rJFXXblt5qGz+J7Np155kLXx8fa2FsnVel0lx2a59VXku wkosxRmJhlrMRcWJAKe02egIAwAA X-CMS-MailID: 20200915190821eucas1p101ad6e551219cd63fbf784ef8ea366d0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190821eucas1p101ad6e551219cd63fbf784ef8ea366d0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190821eucas1p101ad6e551219cd63fbf784ef8ea366d0 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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