From patchwork Mon Dec 21 10:56:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 58797 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp2519518lbb; Mon, 21 Dec 2015 03:00:50 -0800 (PST) X-Received: by 10.140.147.67 with SMTP id 64mr25322241qht.12.1450695650840; Mon, 21 Dec 2015 03:00:50 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m6si29000060qki.10.2015.12.21.03.00.50; Mon, 21 Dec 2015 03:00:50 -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 57C326172C; Mon, 21 Dec 2015 11:00:50 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=HABCMaAl; 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 F3FCB61738; Mon, 21 Dec 2015 10:57:34 +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 F3538615FA; Mon, 21 Dec 2015 10:57:30 +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 AD32D615FA for ; Mon, 21 Dec 2015 10:56:24 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id oh2so12975266lbb.3 for ; Mon, 21 Dec 2015 02:56:24 -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=TZ3OWTt4SZ/wilReHfvbMYr04b4NI/4PTcXqkIRVRWg=; b=HABCMaAlZcu6FXPx9BqSOIiQHTdJT9mABz/8HHtpdicDt7HDxNOvBhA0QM1q33XLT5 L6EKM/flfKsbofiLhjgxPq6Ua9D3/SZ+zJ6Xd04UcEMsQa9ZfPxYO1xZYPxA4a/YveMJ Vl4C2l0ZkG+worctqlUYfjOwHkQ3FHx9QBISk= 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=TZ3OWTt4SZ/wilReHfvbMYr04b4NI/4PTcXqkIRVRWg=; b=jA7UP0SspDHAzqtj1wIQYKdBS/n+/4a2B72dj1BPTh/2mMGchr3s93sX43MlwBJDrW tal0FcKiklxGlfr4bqypZLKzDpppTQrxVfzx5gWkHxR2ADRiZZ2TLABJ5zeUDqVCS98L 22of2ijDtFscB9NjS/sLLvLUlyWq3tKafQqXoEzaKE7FtzYgYL28bcUoEFKfkEfOVDdY /lyhIBCMQRiE5582fJ2Pt3X4uyVqNXrmumJOL58bUkBhMID60pU+BvP3Q9ILZC03FwHV Ybz4v9OBYfy4a0zSN365QTKsh5xN1i4fQhqYPSFsPH25Ucs99YgbY4K9ktUFjaV6nOUc z7Fw== X-Gm-Message-State: ALoCoQnDTB3cbvpoKsHxPxLO98rFB8hwkkvRKCMdsnWC+bQFpBVz0YySbRhsXT5o8Z1yl78UUIcbU3pkc0xEnUrn5GC+NwNW9w== X-Received: by 10.112.150.169 with SMTP id uj9mr685751lbb.17.1450695383600; Mon, 21 Dec 2015 02:56:23 -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 p69sm4856694lfe.42.2015.12.21.02.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Dec 2015 02:56:22 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 21 Dec 2015 13:56:08 +0300 Message-Id: <1450695371-11536-7-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450695371-11536-1-git-send-email-maxim.uvarov@linaro.org> References: <1450695371-11536-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv19 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 d546ec3..01baca7 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"); }