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 A10FDA04AF; Tue, 11 Aug 2020 10:55:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE91A1C132; Tue, 11 Aug 2020 10:53:21 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 557281C131 for ; Tue, 11 Aug 2020 10:53:21 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085321euoutp01ba8552d7986a0e4b4cfbe43b49d05900~qKrslLRKd0904509045euoutp01D; Tue, 11 Aug 2020 08:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085321euoutp01ba8552d7986a0e4b4cfbe43b49d05900~qKrslLRKd0904509045euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136001; bh=9QX3+yApojQ0Y1V6AqGi/iZB/2dabEsOXfmQeYdwTzs=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=HRcenCgPaurq+5EbqS5MCvdFNfsQ7C0/WTZaDlCuSBtEpJ21WgYG7OdRmikslXCMN x9Cta/3JnUYNLzBZn6I8vJ79qsCkVLtZAxHSiJa/DLD1/2jRtiFlfm2kSPvAzTdtpz rjBTtT1pBr+8mb9U1+/pVo3HEZZMZP1KIc9TYo5c= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085320eucas1p1edf9b945efc783d4d44dfc7eda519da8~qKrsO_82M1975819758eucas1p1q; Tue, 11 Aug 2020 08:53:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C3.2C.05997.08C523F5; Tue, 11 Aug 2020 09:53:20 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085320eucas1p183ac15f1cc9c1eb937b7e7f559b11c9d~qKrr5M4-51586915869eucas1p16; Tue, 11 Aug 2020 08:53:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085320eusmtrp1e7715af2b2627b50c5559d553788f25b~qKrr4TvzU1667616676eusmtrp1N; Tue, 11 Aug 2020 08:53:20 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-c1-5f325c807f22 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 03.5D.06017.08C523F5; Tue, 11 Aug 2020 09:53:20 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085318eusmtip1aa0e52a1a1fbe30199faffc1a72a3adf~qKrqIgfBV1422614226eusmtip18; Tue, 11 Aug 2020 08:53:18 +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, 11 Aug 2020 11:52:29 +0300 Message-Id: <20200811085246.28735-11-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSb0xTZxSHd+69vffSWL1WEs502Fg1m0umQ/1wNs3QTbabLCZmH8zmBKx6 g2SA2ArDfVgIc0xLVyoQdWIKwhwdHUFnpUjAYMdArMhgq9AEByEmBsYfKVVnV+agV7Nvz3ne 3+89yZtXZPUV/HIxM+eoYs4xZRl5LdfU+fTOG4V7N6a/+ev1V6nxthNo9M9alkYq7vFU8vA4 Q4P1ydTqPa+hsuFChuxlMwx5XVaeJkaKOJoKeRkaavMLdK6/SKCQ74FA3/ZWAj2IjrP0XfUs UK/zqoae3mjhaTpaw5E9EgAq9dwE6rLNcFRxrRmo2CrRwx/rBKodWkmhkZsc+YNXBPrpUR9L V2/PAZ3qagTqKX6m2bZKjlRf1Mi1rWOMXH6hj5U7g6cF2dbtZOTLU82MPH09wMt2Tz3It0ZL WNl9/29+l3aPdutBJSszXzFveGef9lDHmfhcR2JBb0kJFEJpghXiRJQ2Y83jBt4KWlEvuQCn wy5BHcKAFb9fY9RhFjDQOaZ5UbGPX+QWWC/VAdbZU9TQI0DbuDcW4qXX0H/CGWvHS5d59EYH mIWDZVIKOh0TsMCctBY7HaMx1klv41zzH6y6wYDuS+0xjpv37sphVt22EgeqwrFLUeoQ0eqe ArWwA+eGfuBVXobjXR5B5VfQX27j1MI3gKeargjq4AD8qnLyeSoZPX/dmWdRZKV12NiyQdXb 8WTV9zGN0mIcnFy6oNl5LGs6w6pahyeK9WraiO3d/c814tw/i1QtY7A/rFEfqA1wxtYHDjCc +39XNUA9JCh5luwMxbIxR/l8vcWUbcnLyVh/4HD2zzD/V/3/doWboSW63weSCMZFutwtSel6 jSnfcizbByiyxnjduz3+NL3uoO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AOCkCqY//dhVIDahuzbtyo8sT/MYb77bkufA8rb532I i91oy99ydXZt2YL0j67D28Lvft/+tNJzbmw5G53UNaG+dntncK91GdJjNWVp3jgTd1CXN8Ng oQo+kd1VFYvVH6zpVfRQVmtpMB/jHjEYH6fpOheGanxPNv3SVzWFDdLe0LYQEy/mSwpWQ4hJ PLsUN4v8X1sGiU0IAwAA X-CMS-MailID: 20200811085320eucas1p183ac15f1cc9c1eb937b7e7f559b11c9d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085320eucas1p183ac15f1cc9c1eb937b7e7f559b11c9d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085320eucas1p183ac15f1cc9c1eb937b7e7f559b11c9d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 10/24] 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_to_str 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 | 13 +++++-------- examples/l3fwd-acl/main.c | 13 +++++-------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 4afb97109..b94d226c9 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[ETH_LINK_MAX_STR_LEN]; 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_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", 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..4da827704 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[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -731,14 +732,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_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", 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..5625306cf 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[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -1834,14 +1835,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_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1