From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH v2 net-next 6/6] net: dsa: remove cross-chip support from the MRP notifiers
Date: Tue, 22 Jun 2021 09:46:17 +0200 [thread overview]
Message-ID: <20210622074617.4ny3xovptxtq64ce@soft-dev3-1.localhost> (raw)
In-Reply-To: <20210621164219.3780244-7-olteanv@gmail.com>
The 06/21/2021 19:42, Vladimir Oltean wrote:
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
>
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> With MRP hardware assist being supported only by the ocelot switch
> family, which by design does not support cross-chip bridging, the
> current match functions are at best a guess and have not been confirmed
> in any way to do anything relevant in a multi-switch topology.
>
> Drop the code and make the notifiers match only on the targeted switch
> port.
>
> Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> v1->v2: remove unused variable "err" in dsa_switch_mrp_add_ring_role()
>
> net/dsa/switch.c | 55 ++++++------------------------------------------
> 1 file changed, 7 insertions(+), 48 deletions(-)
>
> diff --git a/net/dsa/switch.c b/net/dsa/switch.c
> index 75f567390a6b..c1e5afafe633 100644
> --- a/net/dsa/switch.c
> +++ b/net/dsa/switch.c
> @@ -346,36 +346,16 @@ static int dsa_switch_change_tag_proto(struct dsa_switch *ds,
> return 0;
> }
>
> -static bool dsa_switch_mrp_match(struct dsa_switch *ds, int port,
> - struct dsa_notifier_mrp_info *info)
> -{
> - if (ds->index == info->sw_index && port == info->port)
> - return true;
> -
> - if (dsa_is_dsa_port(ds, port))
> - return true;
> -
> - return false;
> -}
> -
> static int dsa_switch_mrp_add(struct dsa_switch *ds,
> struct dsa_notifier_mrp_info *info)
> {
> - int err = 0;
> - int port;
> -
> if (!ds->ops->port_mrp_add)
> return -EOPNOTSUPP;
>
> - for (port = 0; port < ds->num_ports; port++) {
> - if (dsa_switch_mrp_match(ds, port, info)) {
> - err = ds->ops->port_mrp_add(ds, port, info->mrp);
> - if (err)
> - break;
> - }
> - }
> + if (ds->index == info->sw_index)
> + return ds->ops->port_mrp_add(ds, info->port, info->mrp);
>
> - return err;
> + return 0;
> }
>
> static int dsa_switch_mrp_del(struct dsa_switch *ds,
> @@ -390,39 +370,18 @@ static int dsa_switch_mrp_del(struct dsa_switch *ds,
> return 0;
> }
>
> -static bool
> -dsa_switch_mrp_ring_role_match(struct dsa_switch *ds, int port,
> - struct dsa_notifier_mrp_ring_role_info *info)
> -{
> - if (ds->index == info->sw_index && port == info->port)
> - return true;
> -
> - if (dsa_is_dsa_port(ds, port))
> - return true;
> -
> - return false;
> -}
> -
> static int
> dsa_switch_mrp_add_ring_role(struct dsa_switch *ds,
> struct dsa_notifier_mrp_ring_role_info *info)
> {
> - int err = 0;
> - int port;
> -
> if (!ds->ops->port_mrp_add)
> return -EOPNOTSUPP;
>
> - for (port = 0; port < ds->num_ports; port++) {
> - if (dsa_switch_mrp_ring_role_match(ds, port, info)) {
> - err = ds->ops->port_mrp_add_ring_role(ds, port,
> - info->mrp);
> - if (err)
> - break;
> - }
> - }
> + if (ds->index == info->sw_index)
> + return ds->ops->port_mrp_add_ring_role(ds, info->port,
> + info->mrp);
>
> - return err;
> + return 0;
> }
>
> static int
> --
> 2.25.1
>
--
/Horatiu
prev parent reply other threads:[~2021-06-22 7:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 16:42 [PATCH v2 net-next 0/6] Improvement for DSA cross-chip setups Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 1/6] net: dsa: assert uniqueness of dsa,member properties Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 2/6] net: dsa: export the dsa_port_is_{user,cpu,dsa} helpers Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 3/6] net: dsa: execute dsa_switch_mdb_add only for routing port in cross-chip topologies Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 4/6] net: dsa: calculate the largest_mtu across all ports in the tree Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 5/6] net: dsa: targeted MTU notifiers should only match on one port Vladimir Oltean
2021-06-21 16:42 ` [PATCH v2 net-next 6/6] net: dsa: remove cross-chip support from the MRP notifiers Vladimir Oltean
2021-06-22 7:46 ` Horatiu Vultur [this message]
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=20210622074617.4ny3xovptxtq64ce@soft-dev3-1.localhost \
--to=horatiu.vultur@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
--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).