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 16142A00C5; Mon, 6 Jul 2020 22:29:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5032E1DD08; Mon, 6 Jul 2020 22:27:25 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 099981DD08 for ; Mon, 6 Jul 2020 22:27:24 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202723euoutp02fa9ddca0e1be837bd294504410ba1294~fQ7ZpDMyo2313123131euoutp02J; Mon, 6 Jul 2020 20:27:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202723euoutp02fa9ddca0e1be837bd294504410ba1294~fQ7ZpDMyo2313123131euoutp02J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067243; bh=srhawFEXUKW2qnG3XOlQI1DTOaaunL+pDywNZ8YTyIM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=kiM3wsqJtcoNARgfrdrX8Y3g7dmH6WT45aVle2d8l8pShMjpZd21XxmvfUFSztpVl k/cR2a94CFksvyzWpvhi8nh384BWDeynWnO2Y+6RA8ya1tJP+Q0mPDcNhunww2z7Gq Ajs+oCWDYk9LBAiQoOQF1TyC6DAPZqU1ndyEAu+Q= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202723eucas1p1a50d8a6e86561d37037edd3330650bc4~fQ7ZHJMwh1288012880eucas1p1j; Mon, 6 Jul 2020 20:27:23 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 45.B4.06456.B29830F5; Mon, 6 Jul 2020 21:27:23 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202722eucas1p1a631c58e9805c00286a2a4b469aeb124~fQ7YVPSFa0478404784eucas1p14; Mon, 6 Jul 2020 20:27:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202722eusmtrp20036d3d260b0816c4015ff1089acd1b3~fQ7YUdzwX3205132051eusmtrp2y; Mon, 6 Jul 2020 20:27:22 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-09-5f03892b5384 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4C.4E.06017.A29830F5; Mon, 6 Jul 2020 21:27:22 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202720eusmtip1a395af4430c92d06cdfccd5622f6fe8a~fQ7WkI8Dy1791017910eusmtip1C; Mon, 6 Jul 2020 20:27:20 +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: Mon, 6 Jul 2020 23:26:06 +0300 Message-Id: <20200706202626.28628-17-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTdxTGc+69vfe2s8tdJfHoFs1utkRFRcaSHd2Lm1my+4FkS2b2wUxY N69ghMpa0Tk3g0QIVIqCTjaHBcukCHMdUqW+pnROZEUMTQoyFRqmczosWiAKK3OUi9m35/ye 55yT889fZE37+XniRssW1Wox58i8gTt1abxraXIpm7nc9ecz5Ol0Ag3217EUOXCTpz0PdjN0 rXEVnWut1lHlQAFD5ZUPGWptsPM0FCnkKBprZejG+aBAh0KFAsUCdwRyXP0e6E78Hkvf1Y4A XXWe1NF42xmehuMujsonwkB7vZeB2ssecnTgtA+o2C7Rg2NugepuzKdY5DJHwb4WgX4c62bp ZOckUEW7B+hK8RPd2y8qE7VHdUrdubuMsv9IN6tc6jsoKGUdTkZpjvoYZfhCmFfKvY2g/Da4 h1Wabj3mPzCsNbyxXs3ZuFW1prz1iSE77vazeU7DF3svOJkCqBDtIIoovYr7rpvtYBBNUgNg U/djXitGAX89chS0YgRwKPwX/7Sj7PBcjbsBvd/+IWjFGGD1RD1jB73ISwsxWOJkEkaS1Mxj a7x32pgtpeNIiYdNaE56GQeOx4SENkorsbDGOZ1BaQE2/eyfzuin+MXhFj6hTdJ87K0ZnR6K UqeIhfWTrNbwLv5QX8Vrejbea/cKmn4Bn5yumRm6Ax+d6BW05hLAflfRTGgVev/uEhK3sdIi 9JxJ0fA72FU+pNNOfhav3X8ugdkpWXmqitWwEUuKTVpaRn9HaAYjTv4zS8MKHu7xc9r7nAf8 qToi7IMFh/7fVQvQCHPUfFtulmpLtajbltnMubZ8S9ayzzbnnoCprxr8tz3mg7HQpwGQRJBn GSMim2nSmbfatucGAEVWTjKuvhLMMBnXm7d/q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FcobWzDQRUbr7fwx3k+mTf/5wjGzTMN7TLt7zMOHYkL+dKdHFq3bLRz1puU Z3qWTSdW7fn6IJtu8gpeNGfY8rT3QPLrptGN+RliqMlx47oYLQ0fDvqVEhdJdz//JF1bWxR+ 7Ewu3ZSXEaqo9StZHdiwx76xJTZi1buI2aO2vW0vddaeqPorPtHNePDU0QrJ4RGWHrn+gHOx mhIS9Fpv0izo/wDhg+MKBgMAAA== X-CMS-MailID: 20200706202722eucas1p1a631c58e9805c00286a2a4b469aeb124 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202722eucas1p1a631c58e9805c00286a2a4b469aeb124 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202722eucas1p1a631c58e9805c00286a2a4b469aeb124 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 16/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- examples/l2fwd-event/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 4fe500333..3e6d1c311 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[60]; printf("\nChecking link status..."); fflush(stdout); @@ -389,14 +390,9 @@ 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_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", port_id, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1