From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] librte_ether: use RTE_ETH_VALID_PORTID_OR_ERR_RET to check port_id Date: Wed, 18 May 2016 10:15:16 +0200 Message-ID: <2109161.zCfKjVzhiS@xps13> References: <1461943396-7094-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> <2661729.DcqZie9VKo@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Mauricio =?ISO-8859-1?Q?V=E1squez?= Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id F1D3A5A55 for ; Wed, 18 May 2016 10:15:38 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id g17so66635795wme.1 for ; Wed, 18 May 2016 01:15:38 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-05-17 22:02, Mauricio V=E1squez: > On Fri, May 13, 2016 at 6:20 PM, Thomas Monjalon > wrote: > > 2016-04-29 17:23, Mauricio Vasquez B: > > > The RTE_ETH_VALID_PORTID_OR_ERR_RET macro is used in some places > > > to check if a port id is valid or not. This commit makes use of i= t in > > > some new parts of the code. > > > > There are other occurences: > > rte_eth_dev_socket_id > > > I missed it. >=20 > > 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_errn= o > 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.