[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240914085054.GB12935@kernel.org>
Date: Sat, 14 Sep 2024 09:50:54 +0100
From: Simon Horman <horms@...nel.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 3/4] net: dsa: populate dp->link_dp for cascade
ports
On Fri, Sep 13, 2024 at 04:15:06PM +0300, Vladimir Oltean wrote:
> Drivers may need to walk the tree hop by hop, activity which is
> currently impossible. This is because dst->rtable offers no guarantee as
> to whether we are looking at a dsa_link that represents a direct
> connection or not.
>
> Partially address the long-standing TODO that we have, and do introduce
> a link_dp member in struct dsa_port. This will actually represent the
> adjacent cascade port.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
...
> @@ -307,9 +308,23 @@ static struct dsa_link *dsa_link_touch(struct dsa_port *dp,
> INIT_LIST_HEAD(&dl->list);
> list_add_tail(&dl->list, &dst->rtable);
>
> + if (adjacent)
> + dp->link_dp = link_dp;
> +
> return dl;
> }
>
> +/**
> + * dsa_port_setup_routing_table(): Set up tree routing table based on
> + * information from this cascade port
> + * @dp: cascade port
> + *
> + * Parse the device tree node for the "link" array of phandles to other cascade
> + * ports, creating routing table elements from this source to each destination
> + * list element found. One assumption is being made, which is backed by the
> + * device tree bindings: that the first "link" element is the directly
> + * connected cascade port.
> + */
Hi Vladimir,
Another minor nit from my side (I think this is the last one).
Please consider documenting the return value of functions that return
a value using a "Return:" or "Returns:" section.
Flagged by ./scripts/kernel-doc -none -Wall
> static bool dsa_port_setup_routing_table(struct dsa_port *dp)
> {
> struct dsa_switch *ds = dp->ds;
> @@ -317,6 +332,7 @@ static bool dsa_port_setup_routing_table(struct dsa_port *dp)
> struct device_node *dn = dp->dn;
> struct of_phandle_iterator it;
> struct dsa_port *link_dp;
> + bool adjacent = true;
> struct dsa_link *dl;
> int err;
>
...
Powered by blists - more mailing lists