[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f158d504-4247-8156-97c2-11a6049d4af3@gmail.com>
Date: Thu, 3 Dec 2020 20:04:41 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Tobias Waldekranz <tobias@...dekranz.com>, davem@...emloft.net,
kuba@...nel.org
Cc: andrew@...n.ch, vivien.didelot@...il.com, olteanv@...il.com,
j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net,
netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 2/4] net: dsa: Link aggregation support
On 12/2/2020 1:13 AM, Tobias Waldekranz wrote:
> Monitor the following events and notify the driver when:
>
> - A DSA port joins/leaves a LAG.
> - A LAG, made up of DSA ports, joins/leaves a bridge.
> - A DSA port in a LAG is enabled/disabled (enabled meaning
> "distributing" in 802.3ad LACP terms).
>
> Each LAG interface to which a DSA port is attached is represented by a
> `struct dsa_lag` which is globally reachable from the switch tree and
> from each associated port.
>
> When a LAG joins a bridge, the DSA subsystem will treat that as each
> individual port joining the bridge. The driver may look at the port's
> LAG pointer to see if it is associated with any LAG, if that is
> required. This is analogue to how switchdev events are replicated out
> to all lower devices when reaching e.g. a LAG.
>
> Signed-off-by: Tobias Waldekranz <tobias@...dekranz.com>
Vladimir and Andrew have already spotted what I was going to comment on,
just a few suggestions below:
[snip]
> +struct dsa_lag {
> + struct net_device *dev;
> + int id;
unsigned int?
> +
> + struct list_head ports;
> +
> + /* For multichip systems, we must ensure that each hash bucket
> + * is only enabled on a single egress port throughout the
> + * whole tree, lest we send duplicates. Therefore we must
> + * maintain a global list of active tx ports, so that each
> + * switch can figure out which buckets to enable on which
> + * ports.
> + */
> + struct list_head tx_ports;
> + int num_tx;
unsigned int?
Which if you change the type would require you to also change the types
of some iterators you used.
--
Florian
Powered by blists - more mailing lists