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 3C92DA04FA; Mon, 3 Feb 2020 10:49:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 85CF91BFE2; Mon, 3 Feb 2020 10:49:27 +0100 (CET) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 22A401BFC4 for ; Mon, 3 Feb 2020 10:49:26 +0100 (CET) Received: by mail-io1-f68.google.com with SMTP id d15so16025882iog.3 for ; Mon, 03 Feb 2020 01:49:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6lT2iVmu50kSNR0wU/JJIi0IhcipZIEnqaLAP2lileM=; b=DAZ1/BtwlPvZsemnw7A1Fm5XI4XE5Z615164oHtbhbPd3+4O2KvD55yV7/3Schqilz nxQ866rtcI9C4tYh9mlLbwHY3xmkblC6BdqRfE7PwpgwHFekGlexHV6cu7ykkhDQcvj1 ZXNue6b4GLiinwts2beQtBk3gEnUOnG5MdpyekjJetQllk7WeqPmSKqGwYGwd9ieHCIS pVNKU2A1e6m6uZ1IKiJCzWSRIHV1IfihIHIF2ooA0Q3ANxCAuQwHCoNA2DYQEBSEUjmg keJ/merYuRI5kOFErM+fzFmpKBUjJH7euFrQjRW8SqLXJHwO8uSAdEWnbWNffd3HCGRI QL+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6lT2iVmu50kSNR0wU/JJIi0IhcipZIEnqaLAP2lileM=; b=SUi67t/U2013k/4TmCioayJTpAE15TpFUs3TQVZxJbwRLTruMaQ9apcjAcUO6o2ldo RVtuU1Md1/sn0TvRoDQL4h7xCoSKO0Z8AYCIJsvImG8FHu230u6G8N4m2+IUoO5JI5mu uZ25j5I0JkmXpxQDt3jQwR69UiLvxzFTS/JMd7gy9CN4vLl4bJ53OkAZoMh6VljQe8L0 /3Ki6TAOJNaxK6/K6VBLUAsjUo/eoSuaL1lhNfxCn1mhsR0C19sAfwHwtF3SH/e463ra ydZAILKBicb7IDJbdytaJ0TUjuoBm5PTIwb6RzWgWJYAjEMkNsn6hb04gvC6a+pUKA7Q kpgw== X-Gm-Message-State: APjAAAVlE9y2i3uunSNE7u87KELNh7xT1RVMXAe3A9wu6i+Sy38igrlo odLxwuai4czLfuhUuslTUjEzuhigFc4YtvD6fbEXGBINhf+5OQ== X-Google-Smtp-Source: APXvYqzKw27yUoYNvOKUP6dwdiJ7mFbGnqLZcH4uwXaw4dyzhdkm03O83TR6QVlEjhbjPj9taenqTLtFjbyyWa18DQw= X-Received: by 2002:a02:cc75:: with SMTP id j21mr18333580jaq.113.1580723365358; Mon, 03 Feb 2020 01:49:25 -0800 (PST) MIME-Version: 1.0 References: <20200131170201.3236153-1-jerinj@marvell.com> <20200131170201.3236153-2-jerinj@marvell.com> <20200202023817.3b7fb5d9@shemminger-XPS-13-9360> In-Reply-To: From: Jerin Jacob Date: Mon, 3 Feb 2020 15:19:09 +0530 Message-ID: To: Gaetan Rivet Cc: Stephen Hemminger , dpdk-dev Content-Type: text/plain; charset="UTF-8" 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 Mon, Feb 3, 2020 at 2:44 PM Gaetan Rivet wrote: > > 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, Hi Gaetan, > > 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(). OK. I will change to SET_ERR_JMP() in the next version.