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 671DEA0528; Sat, 11 Jul 2020 12:46:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 354141DA28; Sat, 11 Jul 2020 12:44:57 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 463CE1DA19 for ; Sat, 11 Jul 2020 12:44:54 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104454euoutp02d612cc1cf6bfb61fd6b92cb3b6b98567~grNPec90U1781617816euoutp02Z; Sat, 11 Jul 2020 10:44:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104454euoutp02d612cc1cf6bfb61fd6b92cb3b6b98567~grNPec90U1781617816euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464294; bh=jOyf4J6mQZov9Rj8aTrBZxIfZbEYK4zbTZ0O4mCw93w=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=I6uB6TmOktYkpR4jqEKtDzoq4h+EtHQeiWNZbigGzK2aL8oZI16lb33ESoTat6Sx8 7tGhoylGdfL1yXgKt2ni9GE4YsbIif3CttZvLFEXlt7nf+ZQt9s2Yh21IZ/pSLUh+e n0xL0VWVu6tbDdNn/jW6+wS5gI0AY1CWsrtrqVyo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104453eucas1p284508d4dfe6ec9e6c6a3c4f8365dad70~grNPDspSA2338123381eucas1p2f; Sat, 11 Jul 2020 10:44:53 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 34.87.06318.528990F5; Sat, 11 Jul 2020 11:44:53 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200711104453eucas1p1dc0da855700e19677dd83aa4b49cfdf5~grNOuLmtd0930809308eucas1p1r; Sat, 11 Jul 2020 10:44:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104453eusmtrp118780c429b1e6e4569b44901569c41d0~grNOtUa8e2954729547eusmtrp16; Sat, 11 Jul 2020 10:44:53 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-54-5f099825061f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F7.86.06017.528990F5; Sat, 11 Jul 2020 11:44:53 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104451eusmtip1b23ef5f06e2bdffa7c9529fbfed8f362~grNM_0n3X0946309463eusmtip10; Sat, 11 Jul 2020 10:44:51 +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: Sat, 11 Jul 2020 13:43:57 +0300 Message-Id: <20200711104414.15422-11-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0iTYRTHe977Rou3KfVkYbUyulpiwaEkKwreL8GIIApqrXyzSE02tTuY mem8VFtXGzq10mbgNS/RrPahrabNJFEpyyKSWXlLTW1Wbq/Rt9/5n//5H57Dw5FKExPEHYlL EHVx2hgVI6dqno+5V4XclGnWlFctgrLGPASf3heR0HW1k4HM/lQC2q2R8LjWTIPxQzIBOcYB AmpLDAx860qhoHewloB3NhcLuS0pLAzau1nIdt9G0O3tIeGW5QcCd95DGsaePWKgz1tIQc54 K4JL1U4EjqwBCq7W1yFIM/DQf7+YhaJ3wTDY5aTA1VHFwoPh1yQ8bJxAcMVRhqAp7Q+9aaEw brlLC0WPPYRgKnhNCs87rrNC1os8QqjorSOEvoZWRsiptiLh5adMUij9PMqo5XvkEVFizJEk Ubd643754RrvWzb+/LwTnp5RIhllzjIgjsP8Wpz5ZKEByTklX4Lw+4vFhFQMIZzfl8NIxQ+E 6+/YkAHJ/BMlNhsrNYoRvtjbSUnFMMLOqmeUz8XwS7ErPc+fFchXMLjW20b4GgH8NjzYbqZ9 TPEh+Lsn1x+r4NfjbruXklbMx6XlT0kfyyb1ib5mPyv5YNyWP+QPxXwjh8duvp0a2IpbjRm0 xAG4x1HNSjwPu0xZU57T+GdlGysNp08+tfDClCkSV399xfrOQfLLcNmj1dJlNuNfoysknIHb v8/0mclJNNbcICVZgdPTlFKGCj990TIlYzzxa7okC7il2UlL57EhfK/0AXUZzc/9v8qCkBXN FhP1sdGiPjxOPB6q18bqE+OiQw8ei61Ek1/V9dsxXIcavAfsiOeQarrCouU0SlqbpD8Za0eY I1WBii1Nrn1KRZT25ClRd0yjS4wR9XY0l6NUsxXhhZ69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u2gvalGJPTX0gsW78SkLd SLjJfTp+9cHl8qsDfUVD7rWT6MP3TcHC+g0bdQsaFtpLdqQWh804oJg/2GfKCmQWbtDqC6oL 41obPtia4U5+4rX27LWM5YtjonV0zG7kZj547+yM761ua3ob31sxXJD+uDECl/S0/fIct0QW 1qooKUnQLCbNkvAXPoyxQwkDAAA= X-CMS-MailID: 20200711104453eucas1p1dc0da855700e19677dd83aa4b49cfdf5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104453eucas1p1dc0da855700e19677dd83aa4b49cfdf5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104453eucas1p1dc0da855700e19677dd83aa4b49cfdf5 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 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 | 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..e6990830f 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_to_str(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..7c02d3451 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_to_str(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..427e291e6 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_to_str(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