From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E757A04FA; Mon, 3 Feb 2020 10:14:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 928CD1BFE2; Mon, 3 Feb 2020 10:14:39 +0100 (CET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by dpdk.org (Postfix) with ESMTP id AC5471BFA1 for ; Mon, 3 Feb 2020 10:14:38 +0100 (CET) X-Originating-IP: 37.58.153.206 Received: from [10.0.3.185] (bny206.haproxy.com [37.58.153.206]) (Authenticated sender: grive@u256.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 2BD811C0009; Mon, 3 Feb 2020 09:14:38 +0000 (UTC) To: Jerin Jacob Cc: Stephen Hemminger , dpdk-dev References: <20200131170201.3236153-1-jerinj@marvell.com> <20200131170201.3236153-2-jerinj@marvell.com> <20200202023817.3b7fb5d9@shemminger-XPS-13-9360> From: Gaetan Rivet Message-ID: Date: Mon, 3 Feb 2020 10:14:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC PATCH 1/5] graph: introduce graph subsystem 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 02/02/2020 12:21, Jerin Jacob wrote: > On Sun, Feb 2, 2020 at 4:08 PM Stephen Hemminger > wrote: >> >> On Fri, 31 Jan 2020 22:31:57 +0530 >> wrote: >> >>> + >>> +#define set_err(err, where, fmt, ...) do { \ >>> + graph_err(fmt, ##__VA_ARGS__); \ >>> + rte_errno = err; \ >>> + goto where; \ >>> +} while (0) >> >> I dislike this macro, it makes static analysis harder and requires >> the reader to know that the argument is a goto target. And since it is lower >> case, implies that it is a function. Usually macros are in upper case. >> >> It makes the code smaller but a cost of being different which impacts the >> readability of the code. > > I don't like macro either. That's the only case where I have used > macro, Even in the fast path, > I did multiple rework to remove macro. Without that macro, that code bloats > and will have a lot repeatable code. I have a preference in using _goto_ to have > a unified exit to simply the stuff and therefor maintain the code. > You could see the amount of verification done in rte_graph_create(). So, IMO, > In this case, it is justified to use the macro. > Hi Jerin, Renaming it in uppercase and making clear there will be a jump could alleviate some concerns? Something like SET_ERR_JMP() maybe or SET_ERR_GOTO().