From patchwork Thu Dec 10 14:24:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 58214 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp526310lbb; Thu, 10 Dec 2015 06:28:24 -0800 (PST) X-Received: by 10.140.18.199 with SMTP id 65mr15610432qgf.10.1449757704266; Thu, 10 Dec 2015 06:28:24 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z139si15010454qka.98.2015.12.10.06.28.23; Thu, 10 Dec 2015 06:28:24 -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.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id D6D48619AF; Thu, 10 Dec 2015 14:28:23 +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.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 1F0AA6194F; Thu, 10 Dec 2015 14:25:16 +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 79EA661B30; Thu, 10 Dec 2015 14:25:12 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by lists.linaro.org (Postfix) with ESMTPS id 0790261975 for ; Thu, 10 Dec 2015 14:24:43 +0000 (UTC) Received: by lfaz4 with SMTP id z4so57822433lfa.0 for ; Thu, 10 Dec 2015 06:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/s2EZPQmBXP1Yot8SoLSkI3QQ5VKNgoky/u4G5f/bR8=; b=KF7gC964mn+GS7Ya4T9jN6u3yZEE/Z0B8H4Xw7Js7IrfoLBjm0oabT3syVccvsmiuU F+XLFGxxwqfNh3Y89PpmyXj0VasdZefoGoq8EhyJ9q2/oZFuov95sY7VTYBvcUekN+hM TlRM6tTMqw5ht6M0+q86hAAwpelq54NguPYP0aZEp1J4GaYIHMZja93/n3pCP510BXMV dJQqAGpBn3p+CyBahwzRMNxP1MtuTGqkYDSTFVRg6rX2/VwcCimLo1z5EffGF5t1Ugwr qanaQ8H+Xp0BT8D7maGHb95TCRQYRenpTZahT0GlfsKbEl+zBeIuXsXD7l50U+80IcEf knFw== 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=/s2EZPQmBXP1Yot8SoLSkI3QQ5VKNgoky/u4G5f/bR8=; b=hno1GjlTHA5dyLP/a0aIUAxTMyDkTWpSOuJhE+5i1u8Wr0g4sr/KTsiUCBJZ34F/8x Eo6qYDiDfBX8SPhl1/kwI3/kIYY17wiBoJ9zteZQTakSucpmqJ4ezTrj4WmTxAo5RShL DDuUrWm6H/1dS/t2R6iiAdPJZTif+liteLK+vDfiNkTrXfAeeqTwlLMmhKKkO9wtvtwx PIdrtHVHZQ9vJO6G28QDwVHCYhxAYRhimSdTvyD3sII2Usyr/gpQI1vPugF3z8/7gwmM xvcfdMyqG1knJwJkcylpl1g5ICFhR/4kamhY8pAcGEUT+pGcfPwODPoY97r9PYSpSUJY Bt1Q== X-Gm-Message-State: ALoCoQmcW2iOHiluk+/qCo/dsiOp/jqIXdqmBIkVXIa53kznTRVbFvHUUcKYTiKoG9XYEFysJ03OgLNz3QGx6ltcT0+WS8HyuQ== X-Received: by 10.25.7.6 with SMTP id 6mr4445843lfh.107.1449757481939; Thu, 10 Dec 2015 06:24: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 xn8sm2364938lbb.41.2015.12.10.06.24.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Dec 2015 06:24:41 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 10 Dec 2015 17:24:23 +0300 Message-Id: <1449757466-6287-8-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449757466-6287-1-git-send-email-maxim.uvarov@linaro.org> References: <1449757466-6287-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv17 07/10] 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 9af11b7..015f1c0 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"); }