From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id C27B03237 for ; Mon, 30 Jan 2017 21:19:31 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id c85so230902002wmi.1 for ; Mon, 30 Jan 2017 12:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=6BT1KAz7tCby5co1LKf1yulHZbqoRixMWOvys1HXSeI=; b=kb+FnApjPJTzCjcWsbUZt/QbggCNnvO26sl8IVi0ocUIRWgGThrdemI0XuL9d/R2Sv Zdc1mnSIH3mWnNlSeFe4ParFPa+lJTdFqVS6XYebxK982cm041LjaKfSLOq+YIq3XrPy OdXAPCNMWkJyQF7toh42ItsGInWDir+Sa7aGWKIm2WSxUcn36Cdzx2+Ufxl7DT5Mc98b zJG1NAbi4VF0xnZ2fwREyXYYSnaI4MCWbxmwKALI7qA0jLvlVgRu+IJ5eP9IuJcDl9hy 4HN5JcdhRvB5mTi3hXlnEzuHOAm3NNiZWu75VsuJo4g8efg/92ZoZx5tMZ0HaQ4C61n/ 1+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=6BT1KAz7tCby5co1LKf1yulHZbqoRixMWOvys1HXSeI=; b=Bw34b2fhFb3QmCYMj1lxFLZbv9YYxr5xKdo1vbQy2dOMCkAyaCq2ncL1UjEKDGySfg HEy1nvIDx7xpYj0YPbVrCMVbUyyXEZyCyzzEmZIuDnNpyy7pPAZOsGLjZptCyVahhUdb RH2/oRJMBwqQ3mvRjzJZgJkNZn5Kc41K78Kzugb7O/YhqI/sT4YuApPDe6cNXhIsy8B3 9vscZT8U7CmEd7YNh3mXEOwNykt3ejBGFfkAN//xPUHBnL9evx5DF4E5mLsbiG1nu3CW BhHe9BFK7bIcC+s2ZOe8JQVzVOTYPUTcxwrN/fjJR4MUEd+GrqoBCUPUzL3vhsgPp7Fi lpDA== X-Gm-Message-State: AIkVDXJ/iKJclSVy+t+/kNQP4BxmlvNfSlx6u6kNtB15QWrOD6jtJjTIg77Nxw9TlP/xtNTJ X-Received: by 10.28.103.69 with SMTP id b66mr14876434wmc.73.1485807571428; Mon, 30 Jan 2017 12:19:31 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id y65sm20433891wmb.5.2017.01.30.12.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 12:19:30 -0800 (PST) From: Thomas Monjalon To: Aaron Conole , adrien.mazarguil@6wind.com Cc: dev@dpdk.org, Stephen Hemminger , Bruce Richardson Date: Mon, 30 Jan 2017 21:19:29 +0100 Message-ID: <2880962.uYJx3WqeFl@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1485529023-5486-1-git-send-email-aconole@redhat.com> <20170127093729.5cef9138@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 25/25] rte_eal_init: add info about rte_errno codes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 20:19:31 -0000 2017-01-30 13:38, Aaron Conole: > Stephen Hemminger writes: > > Bruce Richardson wrote: > >> On Fri, Jan 27, 2017 at 08:33:46AM -0800, Stephen Hemminger wrote: > >> > Why use rte_errno? > >> > Most DPDK calls just return negative value on error which > >> > corresponds to error number. > >> > Are you trying to keep ABI compatibility? Doesn't make sense > >> > because before all these > >> > errors were panic's no working application is going to care. > >> > >> Either will work, but I actually prefer this way. I view using rte_errno > >> to be better as it can work in just about all cases, including with > >> functions which return pointers. This allows you to have a standard > >> method across all functions for returning error codes, and it only > >> requires a single sentinal value to indicate error, rather than using a > >> whole range of values. > > > > The problem is DPDK is getting more inconsistent on how this is done. > > As long as error returns are always same as kernel/glibc errno's it really doesn't > > matter much which way the value is returned from a technical point of view > > but the inconsistency is sure to be a usability problem and source of errors. > > I am using rte_errno here because I assumed it was the preferred > method. In fact, looking at some recently contributed modules (for > instance pdump), it seems that folks are using it. > > I'm not really sure the purpose of having rte_errno if it isn't used, so > it'd be helpful to know if there's some consensus on reflecting errors > via this variable, or on returning error codes. Whichever is the more > consistent with the way the DPDK project does things, I'm game :). I think we can use both return value and rte_errno. We could try to enforce rte_errno as mandatory everywhere. Adrien did the recent rte_flow API. Please Adrien, could you give your thought?