From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 4B4066CD3 for ; Wed, 18 May 2016 17:01:53 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id a17so84084339wme.0 for ; Wed, 18 May 2016 08:01:53 -0700 (PDT) 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=d/4BZxVkPRltJVfqGfhPXYnGzD3c1hyfbaWV3v7IRgw=; b=2TO7sRxjWZj/1/lEhDXe3LMkOmoH85nxi2KxA4+cFvjQbBwSGecoPU7PXg7TS5xqdu 8GTMatuepHIyFP3D/HHJVLszdZ67CcGj4aZapbFZgSqnSyXMU+1Uc0Y49kpckNt0UWLF DvspVhxaMzYqj4uecFZX7iWqEvpBAgdGp3LfopjkmJfIIRVl5FeeBmbTQ8OxC9h36c6d KtheY1/U9lxL9xh72SkolGGSdQukfzFLvEUfTQ9U9F6ICCcflG4Iv8QVVPOVGAOI231Z Wlp5dKiVfMRltYLYoZAnS4G9f7hGb9Qv1bPatlk0NvksPua3TbSokV5vS44u1ol3oXUp /2ew== 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:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=d/4BZxVkPRltJVfqGfhPXYnGzD3c1hyfbaWV3v7IRgw=; b=jk6ZvCmeCrpPANYsyQEVZn03t2yQzqeem/90zFlZXbwHwC6KzGzEDs3TcCSohrRdKz 51zZmVhTzJi5DkllsdCjv3ITRwvykwHqSOM9lB9uFTMv0fVIp/yKeBEYygOG2cxVJLyl MPmBLFXn5vODyOl5N8U72jRXLjCaq0DMxKXNUgFE0Yytm2Mcnr4ilOQCgJu7yXJdrlvf YzPvxQadD7wiAfCMJ8QQDXd7inUz9ZmF6sJqLl2xihYfLCea6Anz4FS+xni5rKUIGsWA ClYm0aVzoNWxqPp7NexFg218lH4ojIF8ftLWTsycLFLXHOhlST68iijCyut0eo5DbWB3 G+Ew== X-Gm-Message-State: AOPr4FWZmUbDw3BDdo7TtSXZazW97BH2391UhL5rmnPzeWe+Z6y2jsPf1lQDyZ0S6JeMQ5QD X-Received: by 10.28.181.148 with SMTP id e142mr7664020wmf.38.1463583713064; Wed, 18 May 2016 08:01:53 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id f188sm30122448wma.2.2016.05.18.08.01.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2016 08:01:52 -0700 (PDT) From: Thomas Monjalon To: Mauricio =?ISO-8859-1?Q?V=E1squez?= Cc: dev@dpdk.org Date: Wed, 18 May 2016 17:01:19 +0200 Message-ID: <1516323.a7INHloVkv@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1461943396-7094-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> <2109161.zCfKjVzhiS@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [PATCH] librte_ether: use RTE_ETH_VALID_PORTID_OR_ERR_RET to check port_id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:01:53 -0000 2016-05-18 16:41, Mauricio V=E1squez: > On Wed, May 18, 2016 at 10:15 AM, Thomas Monjalon > wrote: >=20 > > 2016-05-17 22:02, Mauricio V=E1squez: > > > On Fri, May 13, 2016 at 6:20 PM, Thomas Monjalon < > > thomas.monjalon@6wind.com> > > > wrote: > > > > 2016-04-29 17:23, Mauricio Vasquez B: > > > > > The RTE_ETH_VALID_PORTID_OR_ERR_RET macro is used in some pla= ces > > > > > to check if a port id is valid or not. This commit makes use = of it in > > > > > some new parts of the code. > > > > > > > > There are other occurences: > > > > rte_eth_dev_socket_id > > > > > > > I missed it. > > > > > > > rte_eth_add_rx_callback > > > > rte_eth_add_tx_callback > > > > rte_eth_remove_rx_callback > > > > rte_eth_remove_tx_callback > > > > > > > The macro can not be used on those ones because they set the rte_= errno > > > variable before returning. > > > > It may be a good idea to set rte_errno to EINVAL in these macros. > > > > Generally speaking, rte_errno is not used a lot currently. >=20 >=20 > I noticed that both EINVAL and ENODEV are used. I think that returnin= g > ENODEV and setting rte_errno to EINVAL would be strange, what do you = think > about always using ENODEV? Why EINVAL is used? Why not using retval to set errno? I feel ENODEV would be better but it is an API change, so we should dis= cuss it later for another patch.