From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jiri@resnulli.us>
Subject: Re: [RFC 07/20] net: dsa: list ports in switch\\
Date: Thu, 28 Apr 2016 11:29:32 -0700 [thread overview]
Message-ID: <5722568C.8000003@gmail.com> (raw)
In-Reply-To: <871t5pr3zm.fsf@ketchup.mtl.sfl>
On 28/04/16 11:18, Vivien Didelot wrote:
> Florian Fainelli <f.fainelli@gmail.com> writes:
>
>> On 27/04/16 16:15, Andrew Lunn wrote:
>>> On Wed, Apr 27, 2016 at 06:30:04PM -0400, Vivien Didelot wrote:
>>>> List DSA port structures in their switch structure, so that drivers can
>>>> iterate on them to retrieve information such as their ports membership.
>>>
>>> And this would be so much easier using a plan array.
>>
>> Agreed, I do not see much value in doing this at the moment. Even if you
>> have unused ports in a switch, allocating an array is a small price to
>> pay compared to directly indexing by port number.
>>
>> NAK from me unless there is a compelling reason for doing so.
>
> The point of having a list is 1) get rid of the DSA_MAX_PORTS and have
> variable number of ports 2) lists make iteration easier with variable
> number of switchs/ports, e.g.:
You could get rid of the DSA_MAX_PORTS by asking switch drivers how many
ports they support and allocate that dynamically.
>
> dsa_tree_for_each_switch(dst, ds)
> dsa_switch_for_each_port(ds, dp)
> /* do something with the port */;
This is not more compact or efficient than an array walk, but at this
point this becoming preference over anything.
>
> Anyway, I'm writing a proposal for a new design of DSA, in order to
> support the D in DSA. That way, we'll avoid reviewing details of the
> implementation and have a big picture of the necessary API changes.
Quite frankly, I think your set of changes are submitted at a terrible
time, I would very much prefer to allow Andrew to complete his work on
re-designing the DSA layer to allow different kinds of switches, thus
allowing other people to support more HW in a blink of an eye, and
therefore allowing us all to get a clearer picture of what these little
switches are capable, rather than some patches that produce a lot of
churn with little documented benefits outside of the cross-chip operations.
Don't get me wrong, I think we should get to the point where you want us
to go, and work in that area is very much appreciated!
Thanks
--
Florian
next prev parent reply other threads:[~2016-04-28 18:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 22:29 [RFC 00/20] net: dsa: dsa_port structure and tree-wide ops Vivien Didelot
2016-04-27 22:29 ` [RFC 01/20] net: dsa: introduce a dsa_port structure Vivien Didelot
2016-04-27 23:07 ` Andrew Lunn
2016-04-27 22:29 ` [RFC 02/20] net: dsa: be consistent with NETDEV_CHANGEUPPER Vivien Didelot
2016-04-27 22:30 ` [RFC 03/20] net: dsa: pass dsa_port down to drivers bridge ops Vivien Didelot
2016-04-27 23:12 ` Andrew Lunn
2016-04-27 22:30 ` [RFC 04/20] net: dsa: pass dsa_port down to drivers FDB ops Vivien Didelot
2016-04-27 22:30 ` [RFC 05/20] net: dsa: pass dsa_port down to drivers VLAN ops Vivien Didelot
2016-04-27 22:30 ` [RFC 06/20] net: dsa: move bridge device in dsa_port Vivien Didelot
2016-04-27 22:30 ` [RFC 07/20] net: dsa: list ports in switch Vivien Didelot
2016-04-27 23:15 ` [RFC 07/20] net: dsa: list ports in switch\\ Andrew Lunn
2016-04-28 17:00 ` Florian Fainelli
2016-04-28 18:18 ` Vivien Didelot
2016-04-28 18:29 ` Florian Fainelli [this message]
2016-04-27 22:30 ` [RFC 08/20] net: dsa: bcm_sf2: use bridge device from dsa_port Vivien Didelot
2016-04-27 22:30 ` [RFC 09/20] net: dsa: mv88e6xxx: check HW vlan with dsa_port Vivien Didelot
2016-04-27 22:30 ` [RFC 10/20] net: dsa: mv88e6xxx: setup a dsa_port Vivien Didelot
2016-04-27 22:30 ` [RFC 11/20] net: dsa: mv88e6xxx: use bridge from dsa_port Vivien Didelot
2016-04-27 22:30 ` [RFC 12/20] net: dsa: rename dst->ds to dst->switches Vivien Didelot
2016-04-27 23:20 ` Andrew Lunn
2016-04-27 22:30 ` [RFC 13/20] net: dsa: list switches in tree Vivien Didelot
2016-04-27 22:30 ` [RFC 14/20] net: dsa: add tree-wide bridge ops Vivien Didelot
2016-04-27 22:30 ` [RFC 15/20] net: dsa: add tree-wide FDB ops Vivien Didelot
2016-04-27 22:30 ` [RFC 16/20] net: dsa: add tree-wide VLAN ops Vivien Didelot
2016-04-27 22:30 ` [RFC 17/20] net: dsa: mv88e6xxx: factorize port bridge change Vivien Didelot
2016-04-27 22:30 ` [RFC 18/20] net: dsa: mv88e6xxx: add flags to info Vivien Didelot
2016-04-27 22:30 ` [RFC 19/20] net: dsa: mv88e6xxx: conditionally init PVT Vivien Didelot
2016-04-27 22:30 ` [RFC 20/20] net: dsa: mv88e6xxx: setup PVT on cross-chip ops Vivien Didelot
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=5722568C.8000003@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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 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).