From patchwork Wed Feb 10 13:08:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 61663 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2634879lbl; Wed, 10 Feb 2016 05:13:06 -0800 (PST) X-Received: by 10.50.164.132 with SMTP id yq4mr9569744igb.19.1455109986346; Wed, 10 Feb 2016 05:13:06 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q6si11551397igr.96.2016.02.10.05.13.05; Wed, 10 Feb 2016 05:13:06 -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 AF1CB66742; Wed, 10 Feb 2016 13:13:05 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=K/aUT0Qj; 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_H3, RCVD_IN_MSPIKE_WL, 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 F151D61A0A; Wed, 10 Feb 2016 13:11:15 +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 019EA66736; Wed, 10 Feb 2016 13:10:00 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 44870618C6 for ; Wed, 10 Feb 2016 13:08:42 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id m1so11358104lfg.0 for ; Wed, 10 Feb 2016 05:08:42 -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=TkaJ1dwbSTq+2VA7wGRuakZ5zbg5E8xGLTft4DzBcEo=; b=K/aUT0QjxS9kvog3bowACBT0VCN0wIRI/IuIM73TB0K6T/+Bkc4kjTHvUys2t5xogI hTIbkMxKzveKMvJ/vdqV2NBS9C6B/2N8gkKvHeDKNiow/alWURh4mFABEIZfAeAqcM4/ p9Aa43EDMp0eu5NgCAuGuB7vojNHjXPw9EaqI= 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=TkaJ1dwbSTq+2VA7wGRuakZ5zbg5E8xGLTft4DzBcEo=; b=EApTmlnbBqwQOM7qG8fgNWzvZKQ3o18nHhpEGIY0i3Nh9NXGmepwbcLVfj0i6DguDp vI6r6zdzVKhkYwQ0mzzem7hZa+IR947vFCmK5ZOhIl3NNDoLRSulMCPz0iJehjUF3rg6 0F1cgTMen4U5jlwaaVX5H2IvMv7pEGVHwPwztoYflOBm73sVY7ThtKqN8hn5PBM+6R82 wCeDtMNI9damDg/rBfqPlJ+DidOVjPxHUQryqeozmS2gtnIr2dNLYASz1ALud8xCAYqA jGg+FcEkNE3XhHJOfaNKkJ9G8LCSRj+P5ojrKnIwoq6H+MjrhDPxQDh5iO1Dr4yQG0uP cmIg== X-Gm-Message-State: AG10YOTwgJpasAwmuajQfUl1w3WCFcAos4jbb1huJb++o6chrQZgwJInPcHD+BlJPu93A3im28w= X-Received: by 10.25.18.25 with SMTP id h25mr13174493lfi.165.1455109721244; Wed, 10 Feb 2016 05:08:41 -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 y3sm454147lbk.40.2016.02.10.05.08.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 05:08:40 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 10 Feb 2016 16:08:22 +0300 Message-Id: <1455109705-5871-7-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 In-Reply-To: <1455109705-5871-1-git-send-email-maxim.uvarov@linaro.org> References: <1455109705-5871-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv20 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 d25d497..b20941c 100644 --- a/platform/linux-generic/pktio/ring.c +++ b/platform/linux-generic/pktio/ring.c @@ -75,6 +75,7 @@ #include #include "odph_debug.h" #include +#include static TAILQ_HEAD(, _ring) odp_ring_list; @@ -167,6 +168,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; } @@ -199,6 +201,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"); }