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 8073CA0520; Thu, 2 Jul 2020 15:22:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 491201DA05; Thu, 2 Jul 2020 15:22:15 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 70C5A1DA00 for ; Thu, 2 Jul 2020 15:22:14 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200702132214euoutp02f142d051127431ed76003b9677d058cc~d8jC3hO1F1773417734euoutp02L for ; Thu, 2 Jul 2020 13:22:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200702132214euoutp02f142d051127431ed76003b9677d058cc~d8jC3hO1F1773417734euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593696134; bh=urRoX0IzhKz8REeBkV/dYmzRM15H6Mhp/Ja/d3rqBic=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=rLMgTkISDDJ0TCwfLclBcYyuNZuS0vGOAPWbYyMm26fNMFCYLyEhaXNQc+kIq0P+E 5//2UooWqvcHSeK4h3XFXKv8Vv3cNGzJO+ZaWTJwbYXtwtq9J3nB2alzyIYxyVgGY0 SShuZ7Denx/O6Nv3Jcn0pyjS4EcFRWznRdk4SDyY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200702132213eucas1p19ac4c2eb5fae2b5e684ebc3739db38db~d8jCquCxF2039220392eucas1p1b; Thu, 2 Jul 2020 13:22:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0D.5F.05997.58FDDFE5; Thu, 2 Jul 2020 14:22:13 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200702132213eucas1p2e0d68a0089f372e81e5a5f9bc622f9a0~d8jCHrkQy3202732027eucas1p2P; Thu, 2 Jul 2020 13:22:13 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200702132213eusmtrp1cf052498c8c22ade1eb357a976e50b3a~d8jCGpI-D1219712197eusmtrp1N; Thu, 2 Jul 2020 13:22:13 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-b9-5efddf85dd15 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 98.11.06017.58FDDFE5; Thu, 2 Jul 2020 14:22:13 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200702132212eusmtip2e4d31a5e37e2831647707a284e3095c7~d8jBQclu30566005660eusmtip2b; Thu, 2 Jul 2020 13:22:12 +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 Date: Thu, 2 Jul 2020 16:21:31 +0300 Message-Id: <20200702132139.28078-5-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200702132139.28078-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUhTYRTHeXa33etwcrtaHkwURkEFapofbiWaUXAzKL8Vgi8rL1Nyartq qUSWr6j41tI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s0ffrKqPFlJ07GC0W35Gz+PTgBIvF6Zub2S3W fL3IbLH1zF9GBz6PXwuWsnos3vOSyePYzWnsHj0n5zF5vN93lc2jb8sqRo9Tj7qZPVY/+cEW wBGlZ1OUX1qSqpCRX1xiqxRtaGGkZ2hpoWdkYqlnaGwea2VkqqRvZ5OSmpNZllqkb5egl/Fj 8ULmgmaeijV3X7E3MP7n6GLk5JAQMJFon/mQrYuRi0NIYCmjxP3N/5m7GDmAEhISr58wQ9QI S/y51gVV85lRovHhKkaQBJuAhsTpjnlMILaIwD0miS0rVUFsYQFHiavXdrCA2CwCqhInt6wG q+EVsJT4umgKI8RQeYnVGw6A7eIUsJLYcoIPJCwkkClx+fUVNghbTuL6/C9MExj5FjAyrGIU SS0tzk3PLTbSK07MLS7NS9dLzs/dxAiMim3Hfm7Zwdj1LvgQowAHoxIP74Tjf+OEWBPLiitz DzFKcDArifA6nT0dJ8SbklhZlVqUH19UmpNafIjRFOi+icxSosn5wIjNK4k3NDU0t7A0NDc2 NzazUBLn7RA4GCMkkJ5YkpqdmlqQWgTTx8TBKdXAyH314X2HllsnF6/sTN55UshjhWzujCls Ym7z4meead7YUzbtje/d1XNYupcfDpA/PE1LWX/lRt0fAXEztV61lJc5PIq4ERhmec3soXBz F6elorWZzWLJe+uKT+iaLHxfdkX1zyJ+rZg/TRdUeb8qBl/Mu+zQn/a+03RWZsaGX6pvrO81 FsfxK7EUZyQaajEXFScCAGrrMTqgAgAA X-CMS-MailID: 20200702132213eucas1p2e0d68a0089f372e81e5a5f9bc622f9a0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200702132213eucas1p2e0d68a0089f372e81e5a5f9bc622f9a0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200702132213eucas1p2e0d68a0089f372e81e5a5f9bc622f9a0 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200702132139.28078-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v4 4/7] doc: update sample app with unknown speed 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_format function to example applications Signed-off-by: Ivan Dyukov --- doc/guides/sample_app_ug/link_status_intr.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst index 04c40f285..7d7b31798 100644 --- a/doc/guides/sample_app_ug/link_status_intr.rst +++ b/doc/guides/sample_app_ug/link_status_intr.rst @@ -158,6 +158,7 @@ An example callback function that has been written as indicated below. { struct rte_eth_link link; int ret; + char link_status[200]; RTE_SET_USED(param); @@ -169,11 +170,10 @@ An example callback function that has been written as indicated below. if (ret < 0) { printf("Failed to get port %d link status: %s\n\n", port_id, rte_strerror(-ret)); - } else if (link.link_status) { - printf("Port %d Link Up - speed %u Mbps - %s\n\n", port_id, (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); - } else - printf("Port %d Link Down\n\n", port_id); + } else { + rte_eth_link_format(link_status, 200, NULL, &link); + printf("Port %d %s\n\n", port_id, link_status); + } } This function is called when a link status interrupt is present for the right port. -- 2.17.1