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 46AD8A04FA; Sun, 2 Feb 2020 12:21:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 933CA1BFE1; Sun, 2 Feb 2020 12:21:40 +0100 (CET) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id 1A9251BFE0; Sun, 2 Feb 2020 12:21:39 +0100 (CET) Received: by mail-io1-f66.google.com with SMTP id s24so13507327iog.5; Sun, 02 Feb 2020 03:21:39 -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=1bQ8m/ARWoaqCoKoobV6PWEQVWzdVqmIv8G7OY3Cf48=; b=OR5zUgqxEw8uFQjUsakwiTiHl1fOFMeU3aSK70bxTlcZzA7tMgFNcWGrgx43Cr/xH+ 39G/6s647Ea9Dd89tG+fHZp6Q7LhU5ie5A8lPF+C0OaSQZDjMIN1Fao3lt4b6TIOs49M epP1lKGIimvkqlz3a/IQ91ErbQzZSr9qxVj6NWoPSDx3rZ0vdjOzsDlFazko6A+Ufdlv z8FW1FVq0rukc49G/iTR6cbB/nz7gYS4TctoOAT6ScpO2INSPIlufSjlSVV9K/ubHAD6 AwiE96TL4yuwbJ447aR9BYEAEz898RvF2Ka8AsjI7Xekjwmr+c37ectR6/DusD43vu1i Jecw== 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=1bQ8m/ARWoaqCoKoobV6PWEQVWzdVqmIv8G7OY3Cf48=; b=jsyI7fXiM2PuqgUYvTr8B2t8U0WhYFgWCAiPpAPNJ3TNiknuyaxoAacbsGoxPfL+y4 CHBF6pa7OUY6mRpNGKtXhdTGI/PCS5mm7vxcc7S0j+Vat57cjuwuMAFN0WsCsE/MDX1e pCvvzUrl87yeSIEDqROTwlV3AaKr8YdCYZJhvk+eg+1/9soNRQRPM+/iLtFRrHEm/7Dm 5FA1hi+szU5wll+95rrvYc03/kBrUVTEXfqr3PvvgUf/aU3fzInX4ZAK7ai7sJ8W4CuT QPHVH+zH+x4o/QsN3HLX/3rHRNfKcKrCY+W6aYebULrpzb3gIyJLXFMK3UfgqfNeU0BR fToA== X-Gm-Message-State: APjAAAX5RlgzbcpdyqbS3/TimEiK1M8Tav7bP4vt5o486qMFWwWbpYkO x29wMFrXazsVFjb1GHyhH0XB2qIkBQlu+B0feds= X-Google-Smtp-Source: APXvYqxKlGvjoWGhZx9NxNZAuDWwkaK4Rjk+FiPwNqwybZkmxtJ7ER1boRo4FiXHQwAygEGGsXW6hNwlBYfrYRmu2kQ= X-Received: by 2002:a6b:c742:: with SMTP id x63mr15502920iof.162.1580642498252; Sun, 02 Feb 2020 03:21:38 -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: <20200202023817.3b7fb5d9@shemminger-XPS-13-9360> From: Jerin Jacob Date: Sun, 2 Feb 2020 16:51:22 +0530 Message-ID: To: Stephen Hemminger Cc: Jerin Jacob , dpdk-dev , Prasun Kapoor , Nithin Dabilpuram , Kiran Kumar K , Pavan Nikhilesh , Narayana Prasad , nsaxena@marvell.com, sshankarnara@marvell.com, Honnappa Nagarahalli , Thomas Monjalon , David Marchand , Ferruh Yigit , Andrew Rybchenko , Ajit Khaparde , "Ye, Xiaolong" , Raslan Darawsheh , Maxime Coquelin , Akhil Goyal , Cristian Dumitrescu , John McNamara , "Richardson, Bruce" , Anatoly Burakov , Gavin Hu , David Christensen , "Ananyev, Konstantin" , Pallavi Kadam , Olivier Matz , Gage Eads , "Rao, Nikhil" , Erik Gabriel Carrillo , Hemant Agrawal , "Artem V. Andreev" , Stephen Hemminger , Shahaf Shuler , "Wiles, Keith" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Jasvinder Singh , Vladimir Medvedkin , Ray Kinsella , techboard@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.