From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
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 <dev@dpdk.org>; Mon,  3 Feb 2020 10:49:26 +0100 (CET)
Received: by mail-io1-f68.google.com with SMTP id d15so16025882iog.3
 for <dev@dpdk.org>; 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>
 <CALBAE1PLeQhtE-ot_yAh0EqXQ564DaRhmRPVzbOOy5-Sg4XfrA@mail.gmail.com>
 <c56273c6-0bba-5183-5428-e9c6c13c0b86@u256.net>
In-Reply-To: <c56273c6-0bba-5183-5428-e9c6c13c0b86@u256.net>
From: Jerin Jacob <jerinjacobk@gmail.com>
Date: Mon, 3 Feb 2020 15:19:09 +0530
Message-ID: <CALBAE1PZVK+jbxa4zOant+ObXEtA3ATwcYerg7p53wRYgwhraA@mail.gmail.com>
To: Gaetan Rivet <grive@u256.net>
Cc: Stephen Hemminger <stephen@networkplumber.org>, dpdk-dev <dev@dpdk.org>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Mon, Feb 3, 2020 at 2:44 PM Gaetan Rivet <grive@u256.net> wrote:
>
> On 02/02/2020 12:21, Jerin Jacob wrote:
> > On Sun, Feb 2, 2020 at 4:08 PM Stephen Hemminger
> > <stephen@networkplumber.org> wrote:
> >>
> >> On Fri, 31 Jan 2020 22:31:57 +0530
> >> <jerinj@marvell.com> 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.