From patchwork Fri Dec 18 11:29:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 58641 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp965535lbb; Fri, 18 Dec 2015 03:37:26 -0800 (PST) X-Received: by 10.140.221.145 with SMTP id r139mr4462719qhb.94.1450438646596; Fri, 18 Dec 2015 03:37:26 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q7si15838137qgd.110.2015.12.18.03.37.26; Fri, 18 Dec 2015 03:37:26 -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 2974D615F3; Fri, 18 Dec 2015 11:37:26 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Z9X0msO/; 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 E96AE616BC; Fri, 18 Dec 2015 11:30:43 +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 1D8336160F; Fri, 18 Dec 2015 11:30:37 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by lists.linaro.org (Postfix) with ESMTPS id 3D1AE6160F for ; Fri, 18 Dec 2015 11:29:29 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id yq9so42468667lbb.3 for ; Fri, 18 Dec 2015 03:29:29 -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=w3DVBQawBv84UFLqglE0gCM+whTxvjebyDK4mtIuT0s=; b=Z9X0msO/WQbQAjauF3CyBYCfpFCYzqBtyO/5t+fOSI3L5/0PwcaOaYe0wzgG4RXn3D F+v6WyUh4dFIc4dCoZqSYJ2YXoDzk4vze9mZWc9FCaQGC/dMOfRaAmbhb5IXQCOiYIBi /d7C6eOO+3x6quh/jBMUY3DFGSzi6IhAcKTF0= 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=w3DVBQawBv84UFLqglE0gCM+whTxvjebyDK4mtIuT0s=; b=NArDBaeKZwtRoGQEEiZxceF7/+E+KPixPWD/96zpdUZpCprwMGnFEc/3XR/wslYsCL KNhI5rAnGu+WmXxq+AfHiJL59iAt7XDbCQxZDYIzKcoMXaFz4rr9MBT1Hm3gsINDnKeq WvU0swEDKRVo5QytzWLaMRAwZ9Bc1ULdXjrO6s6WWIjmcXyvtYUGtYLseebFKV9Xj3N6 8QpfmtXFMmxm/w7Hl2ODsNGvhVzC96inD5MiX1F60PiYNdZyvxFGERA2hz3G93+7pZA7 bR5uAstxeXu51uxoDKepxCcdz17T/yS1MRDrA0ElHRBJsZeyd1UzYATHJ9jDk92ms9zZ +EXg== X-Gm-Message-State: ALoCoQmk0twywZOTiLIL7KVtLFTauZYDJr+CMFqyJozjxqvwcuNP+0DR6hvXmtd5p1M+NLXbSO9eWIyI/DqtBIWDsQQ8kHM2hA== X-Received: by 10.112.147.167 with SMTP id tl7mr1140141lbb.100.1450438168133; Fri, 18 Dec 2015 03:29:28 -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 pl2sm2694549lbc.8.2015.12.18.03.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 03:29:27 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 18 Dec 2015 14:29:11 +0300 Message-Id: <1450438154-2062-7-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450438154-2062-1-git-send-email-maxim.uvarov@linaro.org> References: <1450438154-2062-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv18 6/9] linux-generic: ring set up __odp_errno as doxygen says 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" Accodring to doxygen comment if ring creation fails __odp_errno should be set. Signed-off-by: Maxim Uvarov --- platform/linux-generic/pktio/ring.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/linux-generic/pktio/ring.c b/platform/linux-generic/pktio/ring.c index e978420..8081373 100644 --- a/platform/linux-generic/pktio/ring.c +++ b/platform/linux-generic/pktio/ring.c @@ -79,6 +79,7 @@ #include "odph_debug.h" #include #include +#include static TAILQ_HEAD(, _ring) odp_ring_list; @@ -171,6 +172,7 @@ _ring_create(const char *name, unsigned count, unsigned flags) ODPH_ERR("Requested size is invalid, must be power of 2," "and do not exceed the size limit %u\n", _RING_SZ_MASK); + __odp_errno = EINVAL; return NULL; } @@ -203,6 +205,7 @@ _ring_create(const char *name, unsigned count, unsigned flags) if (!(flags & _RING_NO_LIST)) TAILQ_INSERT_TAIL(&odp_ring_list, r, next); } else { + __odp_errno = ENOMEM; ODPH_ERR("Cannot reserve memory\n"); }