From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from compass.polito.it (compass.polito.it [130.192.55.110]) by dpdk.org (Postfix) with ESMTP id C67E12E41 for ; Wed, 18 May 2016 16:41:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by compass.polito.it (Postfix) with ESMTP id A00BF100138 for ; Wed, 18 May 2016 16:41:34 +0200 (CEST) Authentication-Results: compass.polito.it (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=studenti.polito.it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= studenti.polito.it; h=content-type:content-type:cc:to:from:from :subject:subject:message-id:date:date:references:in-reply-to :received:mime-version:received:received:received; s=y2k10; t= 1463582493; bh=9iOrix7cqAQZS3TvyVlDqZdqaIW8QhzrLTDFwka97rM=; b=B QLNjzibC8orfEbdma/TPa6ziOmxZl8CnhyJ4FRvduJp2I1eN0aHm4IocdRB6pqdl wFwntnSPRAx8CaQExDh6m6rBH1UgqfWfs9KOXT84v3cTsnSup26a3AkXGqzqpgVd uitcNcxpPj1bbq/yzZQyIxMSoFKeyq91NhcRBAxcaM= X-Virus-Scanned: amavisd-new at studenti.polito.it X-Spam-Flag: NO X-Spam-Score: -5.895 X-Spam-Level: X-Spam-Status: No, score=-5.895 tagged_above=-100 required=3.5 tests=[ALL_TRUSTED=-5, AWL=0.604, BAYES_00=-1.5, HTML_MESSAGE=0.001] autolearn=ham Received: from compass.polito.it ([127.0.0.1]) by localhost (compass.polito.it [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AIcOOkQ-j_iY for ; Wed, 18 May 2016 16:41:33 +0200 (CEST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: s203403@studenti.polito.it) by compass.polito.it (Postfix) with ESMTPSA id 85882100125 for ; Wed, 18 May 2016 16:41:33 +0200 (CEST) Received: by mail-lf0-f48.google.com with SMTP id y84so21061476lfc.0 for ; Wed, 18 May 2016 07:41:33 -0700 (PDT) X-Gm-Message-State: AOPr4FXrKDGt/g9OuVJLseIiUES1Zzs+I1G1wtacMmJ8Ack4kXwL9hYw46dRcLXBGNpqmkIj/EP4ya8F7HT/Cg== MIME-Version: 1.0 X-Received: by 10.25.26.81 with SMTP id a78mr2763954lfa.6.1463582493061; Wed, 18 May 2016 07:41:33 -0700 (PDT) Received: by 10.25.4.200 with HTTP; Wed, 18 May 2016 07:41:32 -0700 (PDT) In-Reply-To: <2109161.zCfKjVzhiS@xps13> References: <1461943396-7094-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> <2661729.DcqZie9VKo@xps13> <2109161.zCfKjVzhiS@xps13> Date: Wed, 18 May 2016 16:41:32 +0200 X-Gmail-Original-Message-ID: Message-ID: From: =?UTF-8?Q?Mauricio_V=C3=A1squez?= To: Thomas Monjalon Cc: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 14:41:35 -0000 On Wed, May 18, 2016 at 10:15 AM, Thomas Monjalon wrote: > 2016-05-17 22:02, Mauricio V=C3=A1squez: > > 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 places > > > > 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. I noticed that both EINVAL and ENODEV are used. I think that returning ENODEV and setting rte_errno to EINVAL would be strange, what do you think about always using ENODEV?