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 1BD15A0526; Fri, 10 Jul 2020 09:05:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 11FCF1DE4A; Fri, 10 Jul 2020 09:03:21 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 0DAA91DE45 for ; Fri, 10 Jul 2020 09:03:20 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070319euoutp02aaf69da07572beaa851fd30855879321~gUif9E6ei1730917309euoutp02g; Fri, 10 Jul 2020 07:03:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070319euoutp02aaf69da07572beaa851fd30855879321~gUif9E6ei1730917309euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364599; bh=srhawFEXUKW2qnG3XOlQI1DTOaaunL+pDywNZ8YTyIM=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=qt0MSeE+6BZLJAYe9lScI9daOOlIYLXmPjahE9Eu74WY6zmCzr9cuHptaXFPUch5N cloHxYTRGbXloeVSxrSCrmYMpvZn4EuROriT3xNUoUsP3HHp+g91J+gadHpFuDHLyA 6OlU8xx8Fu+sOQNhk2qEyrFTyp9ug/hhQXRGNcto= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710070319eucas1p203f567d14fe9c51c738257b384a1faca~gUifgBpQN2446524465eucas1p2Z; Fri, 10 Jul 2020 07:03:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 08.48.05997.7B2180F5; Fri, 10 Jul 2020 08:03:19 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710070318eucas1p29f8796805d5dc353553acf0e8cd4dd40~gUifJ1H712518925189eucas1p2T; Fri, 10 Jul 2020 07:03:18 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070318eusmtrp1c03302b8e2b2d4f1bbe205f602661b5e~gUifI5O081113611136eusmtrp1J; Fri, 10 Jul 2020 07:03:18 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-5d-5f0812b70d0a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E8.14.06017.6B2180F5; Fri, 10 Jul 2020 08:03:18 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070316eusmtip1605a8d4d01f18cdc0894691f7102fcc2~gUidVPQbM1340413404eusmtip15; Fri, 10 Jul 2020 07:03:16 +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:14 +0300 Message-Id: <20200710070226.6045-17-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: H4sIAAAAAAAAA0WSbUxTVxjHc+69vffSWHZXXHgUhdBkZmh8YbrtIWEojGT3w7KQfdFIECvc oJEX04KbOiMCRVJomZVsymaprRsVTXix0EKQADGgFsY0IpqAVjMxyFApkA0oOMrF+O13fv// k/Pk5PC02sKu5Q/l5ku6XG22hlUyLT2zA5vdaj59W+vEB1jfZyX47LGDRl/VCIvlb0oofFi3 E9vdvynQ8qSQQrNlkkK308jiP74iBl/53RQO3/ByWH2viEN/9wsOTQO/EnwReEnjBdsUwQFr swJnu9pYfB2wM2ieGyRY6bpFsLdiksGqVg/BUqOAb67UcugYjkS/7xaD3kfXObw2c5fG5r4F gmd76wn2l75V7IoW52y/K0RH+xglnrt0lxZ7Hv3MiRW3rZTY+MpDia87BlnR7Koj4p1n5bR4 9e//2BTlXmV8ppR96Kik25qwX3kwUNtJH7Eqf6jssFKF5CxvJCE8CDugY2ReYSRKXi04CRhM 1YpgoBamCYxOfSHzFIHx4dR3A2bbW1YeqCXQ4Jyh5MMMgcvjDi7YYoVPwFtmXQ5WC40suAND VDAIE76BxdHi5RIjfAxnyl3LXiXEQcDgoOQrouBqQycd5JAlbzDaOXmNSBiqmV7p/MXD/Z71 MidDQ1fzig+Dl70uTuZ14D1Xwch8Av5tGuKCC4FQRuCx3bBS2gmu8T+XmOdpIQbq27bKOhHm m0YVQQ1CKDyc+DCo6SW0tPxCy1oFZaVqua2Bztv3VjTAwvwqWYvw5LmTk5+nnUBRzSD5iURV v7/LRkgdCZcK9DlZkv7TXOn7LXptjr4gN2tLRl5OE1n6qd7F3mkPaQsc6CYCTzSrVPsX2HS1 QntUfyynmwBPa1arkvq9+9SqTO2x45IuL11XkC3pu0kEz2jCVdvtY2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beo5tqGhOfh3dvHe/mtrkxqe +GbmJ730PcnU35wzNL6GMa/3e+ZjnZV3MPzxh23KlsQhc+Hj0BCNfnPZbJUzZWHNgjPretvb qN5d7cKVLUmXvsVEfzy+rnYDcswerbdFp+oi6nLdHjZ1VuSrTZ+9tWmLgw4FVxXXbG3kEls2 vg8oqpQTYpSGW4TrRc1fqT3ubAkDAAA= X-CMS-MailID: 20200710070318eucas1p29f8796805d5dc353553acf0e8cd4dd40 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070318eucas1p29f8796805d5dc353553acf0e8cd4dd40 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070318eucas1p29f8796805d5dc353553acf0e8cd4dd40 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 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