All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next 5/6] net: dsa: targeted MTU notifiers should only match on one port
Date: Sun, 20 Jun 2021 07:25:52 -0700	[thread overview]
Message-ID: <a3f51f33-32de-9ac0-8b4d-68d785cb1991@gmail.com> (raw)
In-Reply-To: <20210618183017.3340769-6-olteanv@gmail.com>



On 6/18/2021 11:30 AM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> dsa_slave_change_mtu() calls dsa_port_mtu_change() twice:
> - it sends a cross-chip notifier with the MTU of the CPU port which is
>   used to update the DSA links.
> - it sends one targeted MTU notifier which is supposed to only match the
>   user port on which we are changing the MTU. The "propagate_upstream"
>   variable is used here to bypass the cross-chip notifier system from
>   switch.c
> 
> But due to a mistake, the second, targeted notifier matches not only on
> the user port, but also on the DSA link which is a member of the same
> switch, if that exists.
> 
> And because the DSA links of the entire dst were programmed in a
> previous round to the largest_mtu via a "propagate_upstream == true"
> notification, then the dsa_port_mtu_change(propagate_upstream == false)
> call that is immediately upcoming will break the MTU on the one DSA link
> which is chip-wise local to the dp whose MTU is changing right now.
> 
> Example given this daisy chain topology:
> 
>    sw0p0     sw0p1     sw0p2     sw0p3     sw0p4
> [  cpu  ] [  user ] [  user ] [  dsa  ] [  user ]
> [   x   ] [       ] [       ] [   x   ] [       ]
>                                   |
>                                   +---------+
>                                             |
>    sw1p0     sw1p1     sw1p2     sw1p3     sw1p4
> [  user ] [  user ] [  user ] [  dsa  ] [  dsa  ]
> [       ] [       ] [       ] [       ] [   x   ]
> 
> ip link set sw0p1 mtu 9000
> ip link set sw1p1 mtu 9000 # at this stage, sw0p1 and sw1p1 can talk
>                            # to one another using jumbo frames
> ip link set sw0p2 mtu 1500 # this programs the sw0p3 DSA link first to
>                            # the largest_mtu of 9000, then reprograms it to
>                            # 1500 with the "propagate_upstream == false"
>                            # notifier, breaking communication between
>                            # sw0p1 and sw1p1
> 
> To escape from this situation, make the targeted match really match on a
> single port - the user port, and rename the "propagate_upstream"
> variable to "targeted_match" to clarify the intention and avoid future
> issues.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  reply	other threads:[~2021-06-20 14:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 18:30 [PATCH net-next 0/6] Improvement for DSA cross-chip setups Vladimir Oltean
2021-06-18 18:30 ` [PATCH net-next 1/6] net: dsa: assert uniqueness of dsa,member properties Vladimir Oltean
2021-06-19  1:59   ` Florian Fainelli
2021-06-21 13:53   ` Andrew Lunn
2021-06-18 18:30 ` [PATCH net-next 2/6] net: dsa: export the dsa_port_is_{user,cpu,dsa} helpers Vladimir Oltean
2021-06-19  2:00   ` Florian Fainelli
2021-06-21 13:55   ` Andrew Lunn
2021-06-18 18:30 ` [PATCH net-next 3/6] net: dsa: execute dsa_switch_mdb_add only for routing port in cross-chip topologies Vladimir Oltean
2021-06-20 14:24   ` Florian Fainelli
2021-06-18 18:30 ` [PATCH net-next 4/6] net: dsa: calculate the largest_mtu across all ports in the tree Vladimir Oltean
2021-06-20 14:23   ` Florian Fainelli
2021-06-18 18:30 ` [PATCH net-next 5/6] net: dsa: targeted MTU notifiers should only match on one port Vladimir Oltean
2021-06-20 14:25   ` Florian Fainelli [this message]
2021-06-18 18:30 ` [PATCH net-next 6/6] net: dsa: remove cross-chip support from the MRP notifiers Vladimir Oltean
2021-06-20 14:22   ` Florian Fainelli

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=a3f51f33-32de-9ac0-8b4d-68d785cb1991@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.