From: Jakub Kicinski <kuba@kernel.org>
To: Shay Agroskin <shayagr@amazon.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>,
"Woodhouse, David" <dwmw@amazon.com>,
"Machulsky, Zorik" <zorik@amazon.com>,
"Matushevsky, Alexander" <matua@amazon.com>,
"Saeed Bshara" <saeedb@amazon.com>,
"Wilson, Matt" <msw@amazon.com>,
"Liguori, Anthony" <aliguori@amazon.com>,
"Bshara, Nafea" <nafea@amazon.com>,
"Belgazal, Netanel" <netanel@amazon.com>,
"Saidi, Ali" <alisaidi@amazon.com>,
"Herrenschmidt, Benjamin" <benh@amazon.com>,
"Kiyanovski, Arthur" <akiyano@amazon.com>,
"Dagan, Noam" <ndagan@amazon.com>,
"Arinzon, David" <darinzon@amazon.com>,
"Itzko, Shahar" <itzko@amazon.com>,
"Abboud, Osama" <osamaabb@amazon.com>,
Eric Dumazet <edumazet@google.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Andrew Lunn <andrew@lunn.ch>,
Guangbin Huang <huangguangbin2@huawei.com>,
Jie Wang <wangjie125@huawei.com>,
Johannes Berg <johannes@sipsolutions.net>,
Edward Cree <ecree.xilinx@gmail.com>,
"Florian Westphal" <fw@strlen.de>
Subject: Re: [PATCH v6 net-next 1/7] netlink: Add a macro to set policy message with format string
Date: Mon, 27 Mar 2023 10:33:22 -0700 [thread overview]
Message-ID: <20230327103322.4f294683@kernel.org> (raw)
In-Reply-To: <pj41zlr0tdaq1w.fsf@u570694869fb251.ant.amazon.com>
On Sat, 25 Mar 2023 16:49:34 +0300 Shay Agroskin wrote:
> > TBH the hierarchy should be the other way around,
> > NL_SET_ERR_MSG_FMT()
> > should be converted to be:
> >
> > #define NL_SET_ERR_MSG_FMT(extack, attr, msg, args...) \
> > NL_SET_ERR_MSG_ATTR_POL_FMT(extack, NULL, NULL, msg,
> > ##args)
> >
> > and that'd fix the shadowing, right?
>
> Well ... It will but it will contradict the current order of calls
> as I see it.
>
> NL_SET_ERR_MSG_FMT_MOD calls NL_SET_ERR_MSG_FMT which can be
> described as 'the former extends the latter'.
>
> On the other hand NL_SET_ERR_MSG_ATTR_POL implements the message
> setting by itself and doesn't use NL_SET_ERR_MSG to set the
> message.
>
> So it seems like we already have two approaches for macro ordering
> here and following your suggestion would create another type of
> call direction of 'the former shrinks the latter by setting to
> NULL its attributes'.
> Overall given the nature of C macros and the weird issues arise by
> shadowing variables (ending up for some reason in not modifying
> the pointer at all..) I'd say I mostly prefer V7 version which
> re-implements the message setting and avoids creating such very
> hard to find issues later.
>
> Then again I'd follow your implementation suggestion if you still
> prefer it (also I can modify the macro NL_SET_ERR_MSG to call
> NL_SET_ERR_MSG_ATTR_POL to be consistent with the other change)
Alright, it doesn't matter all that much.
next prev parent reply other threads:[~2023-03-27 17:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 13:25 [PATCH v6 net-next 0/7] Add tx push buf len param to ethtool Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 1/7] netlink: Add a macro to set policy message with format string Shay Agroskin
2023-03-22 9:31 ` Paolo Abeni
2023-03-22 12:39 ` Shay Agroskin
2023-03-22 18:40 ` Jakub Kicinski
2023-03-23 16:38 ` Shay Agroskin
2023-03-23 16:54 ` Jakub Kicinski
2023-03-23 17:13 ` Shay Agroskin
2023-03-23 19:44 ` Shay Agroskin
2023-03-23 20:34 ` Jakub Kicinski
2023-03-25 13:49 ` Shay Agroskin
2023-03-27 17:33 ` Jakub Kicinski [this message]
2023-03-20 13:25 ` [PATCH v6 net-next 2/7] ethtool: Add support for configuring tx_push_buf_len Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 3/7] net: ena: Make few cosmetic preparations to support large LLQ Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 4/7] net: ena: Add an option to configure large LLQ headers Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 5/7] net: ena: Recalculate TX state variables every device reset Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 6/7] net: ena: Add support to changing tx_push_buf_len Shay Agroskin
2023-03-20 13:25 ` [PATCH v6 net-next 7/7] net: ena: Advertise TX push support Shay Agroskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230327103322.4f294683@kernel.org \
--to=kuba@kernel.org \
--cc=akiyano@amazon.com \
--cc=aliguori@amazon.com \
--cc=alisaidi@amazon.com \
--cc=andrew@lunn.ch \
--cc=benh@amazon.com \
--cc=darinzon@amazon.com \
--cc=davem@davemloft.net \
--cc=dwmw@amazon.com \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=huangguangbin2@huawei.com \
--cc=itzko@amazon.com \
--cc=johannes@sipsolutions.net \
--cc=matua@amazon.com \
--cc=msw@amazon.com \
--cc=nafea@amazon.com \
--cc=ndagan@amazon.com \
--cc=netanel@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=osamaabb@amazon.com \
--cc=pabeni@redhat.com \
--cc=saeedb@amazon.com \
--cc=shayagr@amazon.com \
--cc=vladimir.oltean@nxp.com \
--cc=wangjie125@huawei.com \
--cc=zorik@amazon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.