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 E415FA04C7; Tue, 15 Sep 2020 21:09:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1061D1C190; Tue, 15 Sep 2020 21:08:12 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 78A021C1A3 for ; Tue, 15 Sep 2020 21:08:09 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190809euoutp01927a5833fab9550cfc9451c1fc53519b~1Cpey8PM80517005170euoutp01b; Tue, 15 Sep 2020 19:08:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190809euoutp01927a5833fab9550cfc9451c1fc53519b~1Cpey8PM80517005170euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196889; bh=0UwttxWlMNSO6zvpNf9yvDxpqBtUhn2OurscN38uKVo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=dUVGj5UEDWwqGDRmAWUj0Ptdzr0LGKg6Jvl3EeRuMkiN7M0ZuD+Ay2T4uSL0GjPEA 2nQ9Ae4o7dfxI50DCRxPSp7pJboRFN/HjY2dysqRK5RYqlg7haoQVfBLsHVZcLJqWg cxs35HVSvSLl7StVihLbLDYv9fd7J4mFkS18pFgs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190808eucas1p1a76ebf1cc30ecaf9a612843d841f0037~1Cpeg7I-c0047600476eucas1p1J; Tue, 15 Sep 2020 19:08:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B7.53.06456.811116F5; Tue, 15 Sep 2020 20:08:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190808eucas1p239c33a16b012897614a124dff919d3be~1CpdqYpQA1274112741eucas1p2v; Tue, 15 Sep 2020 19:08:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190808eusmtrp16aa34d52d60e65663095963cb21cc29d~1Cpdpn6Op2872428724eusmtrp1W; Tue, 15 Sep 2020 19:08:08 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-65-5f611118a086 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 25.EB.06314.711116F5; Tue, 15 Sep 2020 20:08:07 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190806eusmtip2a8d82595770806de288a87dfe975ddae~1Cpb5JZF91161311613eusmtip22; Tue, 15 Sep 2020 19:08:06 +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, 15 Sep 2020 22:07:05 +0300 Message-Id: <20200915190728.18143-11-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTZxTHc+69vffS0HmtL5w4hlkXie9INPFkMTo33e6+7YsfJFG4whWN gKa1vswPMlDGKmNYdQaqbYFMBE0QBQqIgqgULUhoJEq0SIwZiKJQwMibjHo1+/Y7v/85z0lO HpE1nuEXiLvT9qvmNCXFxOu56uaxBytwthK/6re8WCpvdQI97y5mqed0gKcTg8cYely2geo9 53Rkf5bOUK59iCHPRRtPr3syOHoT9DD09IZPoAJ/hkDBpl6B/mx3APVO9rOU7x4GandW6Wjs Vh1PbyeLOMod7wT6q7IFyJszxNHp2hqgLJtEg6UlAhU/jaJgTwtHvq5rAl0e7WCpqnUK6KS3 HKgta1r33dfyuPsfnVxc/5KRTxV2sHJz19+CnHPPycgVb2oY+e3NTl7OrSwD+f7zE6x86cV7 /hd9nH5dkpqy+4BqjlmfoN9VVNzN77N9dejd2B0uHXIibBAmorQGL5zt422gF43SRcDAXRun FSOA+fYAqxXDgK+93dznkSeOej7ERqkEsNQbpTWNAnpdE0Io4KXF6Mt2MqFgrlTBo2fyERMK 5kg/YtV0AELMSYuwJ3CBDbFB+hbPO6dYbcNCvHSl8SOHzXh/baegbYvCR66Rj4+i1Cpiv9PG aAOb0HP9GK/xHOz3VgoaR6LvVA6nDfwOeLL6mqAVeYCZjoFPXRuw8tWDGRZFVlqC5XUxmt6I DvsZLqRR+gIfD8wOaXYG7dVnWU0bMDvLqHWbsPGe/5NGnJoI17SMgw4/ox3oBqC7sI7Ng4UF /+9yA5RBhGq1pCarltg09eBKi5JqsaYlr0zcm3oVZj6r74M3WAOj/h1NIIlgCje4nyTEG3XK Acvh1CZAkTXNNXzf5ttuNCQph39VzXvjzdYU1dIEX4qcKcKwuujlN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k7r7pKPd9LP+hzYMtyIhjFOVFFpO/ e9TpzfYJ7adDRyKKpc1WiT4s33/bq6r47pKfEf5DPdUNtktztuQDB+WE21aW8F39NtxeedcZ oZtoVnt2nfWcKeZZ9FtzuPuNaiH6hrMqbDMTvjs9Orxp7cnamLRLM1F2PFJORRR6YBfuk5/P qAgxkWf9cYPI/wU2bxSyCQMAAA== X-CMS-MailID: 20200915190808eucas1p239c33a16b012897614a124dff919d3be X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190808eucas1p239c33a16b012897614a124dff919d3be X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190808eucas1p239c33a16b012897614a124dff919d3be References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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..c7348bee5 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[RTE_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), &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..6241c9824 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[RTE_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), &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..e773d3586 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[RTE_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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1