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 3B62BA0526; Fri, 10 Jul 2020 09:04:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D67131DD4C; Fri, 10 Jul 2020 09:03:07 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1D57E1DD34 for ; Fri, 10 Jul 2020 09:03:07 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070306euoutp025486a147aab43806b2c9e8cee797793e~gUiT6VaoN1750317503euoutp02H; Fri, 10 Jul 2020 07:03:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070306euoutp025486a147aab43806b2c9e8cee797793e~gUiT6VaoN1750317503euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364586; bh=KYoq+D7jL7TMj8sFJ9dEXZ47ChxgDfY/ELcSA7WUHJo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=jrCqAiIgZebDTuBjK/xenZBgr5+uffeB8nVys2Yd4GNwvoCkyaVLv/iYUzcQ5EsmO lF+WgxcIRIs5or709YtbKTR2/fSfUNZJqLcpFyJOD4OT8l0Ydn2GzvvbSNTjSrsr/b mlXHxFrbA1HdsYP/6PDZBao/Hk0NWcGmYMKYKX0k= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710070306eucas1p10bfb6e4a6207e1186403e78206ad63b6~gUiTp1FXm0824408244eucas1p1r; Fri, 10 Jul 2020 07:03:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F0.41.06318.AA2180F5; Fri, 10 Jul 2020 08:03:06 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710070306eucas1p188f37839cc01836fedcafde66583e968~gUiTTbxG11630516305eucas1p1Q; Fri, 10 Jul 2020 07:03:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200710070306eusmtrp29f22dcd23219f3aca162183b80929982~gUiTSLeSS2959129591eusmtrp2H; Fri, 10 Jul 2020 07:03:06 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-b4-5f0812aabc68 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 10.94.06314.AA2180F5; Fri, 10 Jul 2020 08:03:06 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070304eusmtip1db16fc446e45e26e1deeb2ff1edc6e6c~gUiRf-DPV1340413404eusmtip12; Fri, 10 Jul 2020 07:03:04 +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:09 +0300 Message-Id: <20200710070226.6045-12-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: H4sIAAAAAAAAA0WSfUxTZxTGPffe3ntprF6rmUfdxDXZMkymLmzLMTPTLTNeF7f4h9G5ZMNu 3gEbH6YXmLosMrciqYAIbA42S4VNXGUiWClg57DJ+FjrEBYDRKalMdHqEEVAy4dIud387/c+ 53nO8+bNK7LGYn6xmJyWoVjSzCkmXs/Vt4Q7XnQaxYRVXWOxVOO3AwWvVrIUKPmHp4N3v2Go x7mWPO4fdVR0LZuhgqJ7DLlP2Hj6N7CfoztDbob6fvMJVNa1X6Ah7w2B8jt+ALoxcYulUsd9 oA77WR2FLzTxNDhRwVHB2GWgQ642oNa8exyVNDYA5dgkuvtLlUCVfUtpKNDGka/3jEDVI50s nfVPAh1urQG6mDOlW/esPOb4WSdXekKMXHysk5Vber8T5Lx2OyPX3mlg5MHzl3m5wOUE+c/g QVY+ef0hv1n/vn7NTiUlOUuxrHx9hz7pSscRdtf4kt2jgyOQDV8/ZYMYEaWXsbDUy9hALxql E4Blo0GddhgGvNnXx0ZcRuk+YHPo/0SP51deM1UB5gcD0cQI4IHjNoi4eOkF9OXaZ/YukGp5 dE90M5HBfGk9lp47zUWYk57Dr06dmtEN0mpsuWDltYpYPHm6eaY6Zlq32ioE7RpLsbt8eGYp Sn4RR62XGC3wFuZN+UDj+Xir1SVo/DRONZZHPV/gg7puQQvnAl6tsEZNa9F1+69pFkVWisOa ppURROkN9J95T8M52DMwL2Jmp7Go/giryQbMzTFqO0zY3N4VlREnx2drsoxFwZLo63oAj1Zf gUKILXtS5QBwwkIlU01NVNT4NOXzFao5Vc1MS1zxcXpqHUx/Vd+j1pEGOD/xkRckEUyzDTsm +QSjzpyl7kn1AoqsaYHhzYu+D42GneY9exVL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4oJY5QQzihDlaFrQLZAnEs17JVQyWojd4jj9Jzhfx8m8vLPRLsDkyYd0uQ1o19/+2B12/Oj yIqInNLl/rdbNDpTTIylfPSyMVdhTBAnKHrMGfrNCVsDWybSoxTT1xq08fpFVpsjMLJRFex9 9sAJe22c30V9LBPb5LfT9KVwzNlnzTF1BmVUzoueFK/w2qvF1inXC5w/+32OHSyXJDbFDQVF l8oIPkXNBOMGXv0PP5debAgDAAA= X-CMS-MailID: 20200710070306eucas1p188f37839cc01836fedcafde66583e968 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070306eucas1p188f37839cc01836fedcafde66583e968 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070306eucas1p188f37839cc01836fedcafde66583e968 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 11/25] examples/ip_*: 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: * ip_fragmentation * ip_reassembly * l3fwd-acl Signed-off-by: Ivan Dyukov --- examples/ip_fragmentation/main.c | 13 +++++-------- examples/ip_reassembly/main.c | 12 ++++-------- examples/l3fwd-acl/main.c | 12 ++++-------- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 4afb97109..18a6df77e 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -593,6 +593,7 @@ check_all_ports_link_status(uint32_t port_mask) 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); @@ -612,14 +613,10 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - 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")); - else - printf("Port %d Link Down\n", portid); + rte_eth_link_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 494d7ee77..910c89ae3 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -712,6 +712,7 @@ check_all_ports_link_status(uint32_t port_mask) 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); @@ -731,14 +732,9 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - 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")); - else - printf("Port %d Link Down\n", portid); + rte_eth_link_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index f22fca732..ddfec9487 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -1815,6 +1815,7 @@ check_all_ports_link_status(uint32_t port_mask) 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); @@ -1834,14 +1835,9 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - 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")); - else - printf("Port %d Link Down\n", portid); + rte_eth_link_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1