netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Question] Should NLMSG_DONE has flag NLM_F_MULTI?
@ 2022-08-24  3:20 Hangbin Liu
  2022-08-25  1:39 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2022-08-24  3:20 UTC (permalink / raw)
  To: netdev; +Cc: Dmitry Safonov, Florian Westphal, Arkadi Sharshevsky

Hi,

When checking the NLMSG_DONE message in kernel, I saw lot of functions would
set NLM_F_MULTI flag. e.g. netlink_dump_done(),
devlink_dpipe_{tables, entries, headers}_fill().

But from rfc3549[1]:

   [...] For multipart
   messages, the first and all following headers have the NLM_F_MULTI
   Netlink header flag set, except for the last header which has the
   Netlink header type NLMSG_DONE.

What I understand is the last nlmsghdr(NLMSG_DONE message) doesn't need to
have NLM_F_MULTI flag. Am I missing something?

[1] https://www.rfc-editor.org/rfc/rfc3549.html#section-2.3.2

Thanks
Hangbin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question] Should NLMSG_DONE has flag NLM_F_MULTI?
  2022-08-24  3:20 [Question] Should NLMSG_DONE has flag NLM_F_MULTI? Hangbin Liu
@ 2022-08-25  1:39 ` Jakub Kicinski
  2022-08-25  4:20   ` Hangbin Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-08-25  1:39 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: netdev, Dmitry Safonov, Florian Westphal, Arkadi Sharshevsky,
	Jiri Pirko

On Wed, 24 Aug 2022 11:20:18 +0800 Hangbin Liu wrote:
> When checking the NLMSG_DONE message in kernel, I saw lot of functions would
> set NLM_F_MULTI flag. e.g. netlink_dump_done(),
> devlink_dpipe_{tables, entries, headers}_fill().
> 
> But from rfc3549[1]:
> 
>    [...] For multipart
>    messages, the first and all following headers have the NLM_F_MULTI
>    Netlink header flag set, except for the last header which has the
>    Netlink header type NLMSG_DONE.
> 
> What I understand is the last nlmsghdr(NLMSG_DONE message) doesn't need to
> have NLM_F_MULTI flag. Am I missing something?
> 
> [1] https://www.rfc-editor.org/rfc/rfc3549.html#section-2.3.2

Looks like you're right, we seem to fairly consistently set it.
Yet another thing in Netlink we defined and then used differently?
In practice it likely does not matter, I'd think.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question] Should NLMSG_DONE has flag NLM_F_MULTI?
  2022-08-25  1:39 ` Jakub Kicinski
@ 2022-08-25  4:20   ` Hangbin Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Hangbin Liu @ 2022-08-25  4:20 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, Dmitry Safonov, Florian Westphal, Arkadi Sharshevsky,
	Jiri Pirko

On Wed, Aug 24, 2022 at 06:39:45PM -0700, Jakub Kicinski wrote:
> On Wed, 24 Aug 2022 11:20:18 +0800 Hangbin Liu wrote:
> > When checking the NLMSG_DONE message in kernel, I saw lot of functions would
> > set NLM_F_MULTI flag. e.g. netlink_dump_done(),
> > devlink_dpipe_{tables, entries, headers}_fill().
> > 
> > But from rfc3549[1]:
> > 
> >    [...] For multipart
> >    messages, the first and all following headers have the NLM_F_MULTI
> >    Netlink header flag set, except for the last header which has the
> >    Netlink header type NLMSG_DONE.
> > 
> > What I understand is the last nlmsghdr(NLMSG_DONE message) doesn't need to
> > have NLM_F_MULTI flag. Am I missing something?
> > 
> > [1] https://www.rfc-editor.org/rfc/rfc3549.html#section-2.3.2
> 
> Looks like you're right, we seem to fairly consistently set it.
> Yet another thing in Netlink we defined and then used differently?
> In practice it likely does not matter, I'd think.

Yes, thanks for the confirmation. I have no plan to change the current
kernel behavior. But for my later patch, I will not add NLM_F_MULTI for
NLMSG_DONE message.

Thanks
Hangbin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-25  4:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-24  3:20 [Question] Should NLMSG_DONE has flag NLM_F_MULTI? Hangbin Liu
2022-08-25  1:39 ` Jakub Kicinski
2022-08-25  4:20   ` Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).