From: Simon Horman <horms@kernel.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/4] net: dsa: populate dp->link_dp for cascade ports
Date: Sat, 14 Sep 2024 09:50:54 +0100 [thread overview]
Message-ID: <20240914085054.GB12935@kernel.org> (raw)
In-Reply-To: <20240913131507.2760966-4-vladimir.oltean@nxp.com>
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@nxp.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;
>
...
next prev parent reply other threads:[~2024-09-14 8:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 13:15 [PATCH net-next 0/4] Cascaded management xmit for SJA1105 DSA driver Vladimir Oltean
2024-09-13 13:15 ` [PATCH net-next 1/4] net: dsa: free routing table on probe failure Vladimir Oltean
2024-09-13 13:15 ` [PATCH net-next 2/4] dt-bindings: net: dsa: the adjacent DSA port must appear first in "link" property Vladimir Oltean
2024-09-13 17:04 ` Conor Dooley
2024-09-13 17:26 ` Andrew Lunn
2024-09-13 18:50 ` Vladimir Oltean
2024-09-13 19:23 ` Andrew Lunn
2024-09-13 13:15 ` [PATCH net-next 3/4] net: dsa: populate dp->link_dp for cascade ports Vladimir Oltean
2024-09-14 8:50 ` Simon Horman [this message]
2024-09-13 13:15 ` [PATCH net-next 4/4] net: dsa: sja1105: implement management routes for cascaded switches Vladimir Oltean
2024-09-14 8:47 ` Simon Horman
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=20240914085054.GB12935@kernel.org \
--to=horms@kernel.org \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=vladimir.oltean@nxp.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).