From patchwork Fri Dec 25 13:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 59001 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp323915lbb; Fri, 25 Dec 2015 05:50:30 -0800 (PST) X-Received: by 10.55.23.32 with SMTP id i32mr14067383qkh.59.1451051430613; Fri, 25 Dec 2015 05:50:30 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 16si50159430qhx.98.2015.12.25.05.50.30; Fri, 25 Dec 2015 05:50:30 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 289BD6164B; Fri, 25 Dec 2015 13:50:30 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=OBrsVNzN; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C0899616BA; Fri, 25 Dec 2015 13:48:59 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E1B3E61663; Fri, 25 Dec 2015 13:48:53 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by lists.linaro.org (Postfix) with ESMTPS id B9E536165B for ; Fri, 25 Dec 2015 13:48:51 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id sv6so62865184lbb.0 for ; Fri, 25 Dec 2015 05:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TDFZNEPof0OAq0CvZED+2wG0vuCFT7IwgYOX/qdwMuY=; b=OBrsVNzN+BgMsujRYkiWKrh62bBt2uhF/HOSeed7imGXf2a+4Wf1PtwPAlBjiLH4lC mqxOjGQ7i2DOefqD7u0IBaCOIOmLpgxs4ymEkykcsz/OoP57OxstdMa1UtUbM8mcGgnT arKxPewwhqWXqs9sth6fhuLGI7+EZz4c0Hpg4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TDFZNEPof0OAq0CvZED+2wG0vuCFT7IwgYOX/qdwMuY=; b=fhBQdkp60/nIbQRSO7S3PLUGzRG5tNPEFEh+ITe8Rps8ASnbzDOLxAfbwMa4qdFvdj KMIExrSlCqUI+dhUOsGBA4pUJ1ThUZWeuhcoNbseiq8OnwjAB65p1g3sKh99jftUEJgx sIc8yGcCtgMn4jo07NsItGTZaXntCv8AnHCIwEZRbdBq4JfVOe8hJ99Q53pk3al+wR0M Y6Hi6GaLj/NVWoTkkJY8iZ/OmNkwRj+XySwo/iXTafGyoVnorw0lxxGqHN8gwYhUwH2l 472CNp1Dncg+NPqf9xtN10Qdm9vVpLdj+M9vZcnYKrL7mBXzc9vipSE25kGZ2CmCJm87 7f7g== X-Gm-Message-State: ALoCoQllPDVWvkVK8XGvmCbvZJAGN64dUtuijWlRif5U++W4k0T5ZisjVwdv82wKZX9sVKuY1qqlBkPflfbPAkUko5zynu9o/g== X-Received: by 10.112.158.9 with SMTP id wq9mr824631lbb.93.1451051330639; Fri, 25 Dec 2015 05:48:50 -0800 (PST) Received: from localhost.localdomain (ppp91-76-173-134.pppoe.mtu-net.ru. [91.76.173.134]) by smtp.gmail.com with ESMTPSA id r2sm8128881lfe.28.2015.12.25.05.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Dec 2015 05:48:49 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 25 Dec 2015 16:48:39 +0300 Message-Id: <1451051319-22073-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451051319-22073-1-git-send-email-maxim.uvarov@linaro.org> References: <1451051319-22073-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 3/3] example: generator: check and print link status X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Maxim Uvarov --- example/generator/odp_generator.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 93eefe9..a5b425e 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -364,12 +364,19 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool) if (ret) EXAMPLE_ABORT("Error: unable to start %s\n", dev); + ret = odp_pktio_link_status(pktio); + if (ret != 1) { + EXAMPLE_ERR("Link for dev %s is down, exit.\n", dev); + exit(EXIT_FAILURE); + } + printf(" created pktio:%02" PRIu64 ", dev:%s, queue mode (ATOMIC queues)\n" " default pktio%02" PRIu64 - "-INPUT queue:%" PRIu64 "\n", + "-INPUT queue:%" PRIu64 ", link_status:%d\n", odp_pktio_to_u64(pktio), dev, - odp_pktio_to_u64(pktio), odp_queue_to_u64(inq_def)); + odp_pktio_to_u64(pktio), odp_queue_to_u64(inq_def), + odp_pktio_link_status(pktio)); return pktio; }