[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMArcTW6q=ga1juv_Qp-dKwRwxneAEsX4xQxN-n19oWM-VUQ+w@mail.gmail.com>
Date: Tue, 1 Oct 2019 22:53:34 +0900
From: Taehee Yoo <ap420073@...il.com>
To: Johannes Berg <johannes@...solutions.net>
Cc: David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>, linux-wireless@...r.kernel.org,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
j.vosburgh@...il.com, vfalico@...il.com,
Andy Gospodarek <andy@...yhouse.net>,
Jiří Pírko <jiri@...nulli.us>,
sd@...asysnail.net, Roopa Prabhu <roopa@...ulusnetworks.com>,
saeedm@...lanox.com, manishc@...vell.com, rahulv@...vell.com,
kys@...rosoft.com, haiyangz@...rosoft.com,
Stephen Hemminger <stephen@...workplumber.org>,
sashal@...nel.org, hare@...e.de, varun@...lsio.com,
ubraun@...ux.ibm.com, kgraul@...ux.ibm.com,
Jay Vosburgh <jay.vosburgh@...onical.com>,
Cody Schuffelen <schuffelen@...gle.com>, bjorn@...k.no
Subject: Re: [PATCH net v4 01/12] net: core: limit nested device depth
On Tue, 1 Oct 2019 at 16:11, Johannes Berg <johannes@...solutions.net> wrote:
>
> Hi,
>
Hi!
> Sorry for the delay.
>
> > These functions are used as a callback function of
> > netdev_walk_all_{upper/lower}_dev(). So these return types are needed.
>
> Ah yes, I missed that, sorry.
>
> > Without storing level storing, a walking graph routine is needed only
> > once. The routine would work as a nesting depth validator.
> > So that the detach routine doesn't need to walk the graph.
> > Whereas, in this patch, both attach and detach routine need to
> > walk graph. So, storing nesting variable way is slower than without
> > storing nesting variable way because of the detach routine's updating
> > upper and lower level routine.
>
> Right, that's what I thought.
>
> > But I'm sure that storing nesting variables is useful because other
> > modules already using nesting level values.
> > Please look at vlan_get_encap_level() and usecases.
>
> Indeed, I noticed that later.
>
> > If we don't provide nesting level variables, they should calculate
> > every time when they need it and this way is easier way to get a
> > nesting level. There are use-cases of lower_level variable
> > in the 11th patch.
>
> Yes, makes sense, agree. One could argue that you only ever need the
> "lower_level" stored, not the "upper_level", but I guess that doesn't
> really make a difference.
>
> Placing these in a better position in the struct might make sense - a
> cursory look suggested that they weren't filling any of the many holes
> there, did you pay attention to that or was the placement more or less
> random?
>
If I understand correctly, you said about the alignment of
"lower_level" and "upper_level".
I thought this place is a fine position for variables as regards the
alignment and I didn't try to put each variable in different places.
If I misunderstood your mention, please let me know.
Thank you
> johannes
>
Powered by blists - more mailing lists