From patchwork Thu May 26 23:46:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 68721 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp659127qge; Thu, 26 May 2016 16:49:44 -0700 (PDT) X-Received: by 10.200.41.248 with SMTP id 53mr9957637qtt.100.1464306584664; Thu, 26 May 2016 16:49:44 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q4si3267046qkl.235.2016.05.26.16.49.44; Thu, 26 May 2016 16:49:44 -0700 (PDT) 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3F9D66745A; Thu, 26 May 2016 23:49:44 +0000 (UTC) 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 2615A6744E; Thu, 26 May 2016 23:47:57 +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 6060B67451; Thu, 26 May 2016 23:47:52 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 9228B67451 for ; Thu, 26 May 2016 23:47:02 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id b65so149392690oia.1 for ; Thu, 26 May 2016 16:47:02 -0700 (PDT) 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=IUSYDO/fnFLZD8Chn+DfSjKDdNVYhe4Sv4+b/yC4scs=; b=Tyqt8xMhyXFSQIJlEZTDP7WGukHm46ECjyhpQ0LpYx3cSEIVLztDYaY7PX3BgsU+8g mxmHnEvSWsevlbllBjJCdYHUF+dcjlW+raqd4A4+LsetlOCNIrgCJktS85nlS1Q6Ep/8 xB406NYFEOw19w5ovMw3nfT4JaMl5jet7tfeGY3Z0q0XFv1CJyUfRIaAiZbHmPCGLKO4 q3tG3OwUbLui0Kw2UVZRlnOHKU5DW5xvx75y2Nk56cIH1cXUJw/79oVwL9KBfU4HHLfL 3sja/RbPWmiC2YIZSfvwmxyN0mB8HTP08Ro+2NiM/eWbv2FstWTmXuPryaDTfodQQM66 rLnQ== X-Gm-Message-State: ALyK8tLmI+WdexkFkPrI+fa67GcwCVMwqBR9nMDFo/i8cmRfoMofqY5yd0vqRemjci+uPNlJQww= X-Received: by 10.202.232.194 with SMTP id f185mr7897666oih.168.1464306419088; Thu, 26 May 2016 16:46:59 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id c7sm7720581oia.8.2016.05.26.16.46.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 16:46:58 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 26 May 2016 18:46:43 -0500 Message-Id: <1464306409-7325-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1464306409-7325-1-git-send-email-bill.fischofer@linaro.org> References: <1464306409-7325-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv3 04/10] validation: tm: handle pktio open/config failures properly 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" Add proper sequencing of checks for pktio open / configure failures. Signed-off-by: Bill Fischofer --- test/validation/traffic_mngr/traffic_mngr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/validation/traffic_mngr/traffic_mngr.c b/test/validation/traffic_mngr/traffic_mngr.c index 2bbcc1d..e099083 100644 --- a/test/validation/traffic_mngr/traffic_mngr.c +++ b/test/validation/traffic_mngr/traffic_mngr.c @@ -492,19 +492,19 @@ static int open_pktios(void) &pktio_param); if (pktio == ODP_PKTIO_INVALID) pktio = odp_pktio_lookup(iface_name[iface]); + if (pktio == ODP_PKTIO_INVALID) { + LOG_ERR("odp_pktio_open() failed\n"); + return -1; + } /* Set defaults for PktIn and PktOut queues */ - odp_pktin_queue_config(pktio, NULL); - odp_pktout_queue_config(pktio, NULL); + (void)odp_pktin_queue_config(pktio, NULL); + (void)odp_pktout_queue_config(pktio, NULL); rc = odp_pktio_promisc_mode_set(pktio, true); if (rc != 0) printf("****** promisc_mode_set failed ******\n"); pktios[iface] = pktio; - if (pktio == ODP_PKTIO_INVALID) { - LOG_ERR("odp_pktio_open() failed\n"); - return -1; - } if (odp_pktin_queue(pktio, &pktins[iface], 1) != 1) { odp_pktio_close(pktio);