netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vivien Didelot <vivien.didelot@gmail.com>,
	kernel@pengutronix.de, Jakub Kicinski <kuba@kernel.org>,
	UNGLinuxDriver@microchip.com,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net-next v2 1/1] net: dsa: microchip: ksz9477: implement MTU configuration
Date: Tue, 8 Mar 2022 12:59:55 +0100	[thread overview]
Message-ID: <20220308115955.GB1086@pengutronix.de> (raw)
In-Reply-To: <20220308112156.6s2ssnkhifxuuw2w@skbuf>

On Tue, Mar 08, 2022 at 01:21:56PM +0200, Vladimir Oltean wrote:
> On Tue, Mar 08, 2022 at 11:06:44AM +0100, Oleksij Rempel wrote:
> > > > > I was saying:
> > > > > 
> > > > > ip link set lan1 up
> > > > > ip link add link lan1 name lan1.5 type vlan id 5
> > > > > ip addr add 172.17.0.2/24 dev lan1.5 && ip link set lan1.5 up
> > > > > iperf3 -c 172.17.0.10
> > > > 
> > > > It works.
> > > 
> > > This is akin to saying that without any calls to ksz9477_change_mtu(),
> > > just writing VLAN_ETH_FRAME_LEN + ETH_FCS_LEN into REG_SW_MTU__2 is
> > > sufficient to get VLAN-tagged MTU-sized packets to pass through the CPU
> > > port and the lan1 user port.
> > > 
> > > So my question is: is this necessary?
> > > 
> > > 	if (dsa_is_cpu_port(ds, port))
> > > 		new_mtu += KSZ9477_INGRESS_TAG_LEN;
> > > 
> > 
> > No.
> > 
> > I did some extra tests with following results: REG_SW_MTU__2 should be
> > configured to 1518 to pass 1514 frame. Independent if the frame is
> > passed between external ports or external to CPU port. So, I assume,
> > ETH_FRAME_LEN + ETH_FCS_LEN should be used instead of VLAN_ETH_FRAME_LEN
> > + ETH_FCS_LEN. Correct?
> 
> Oleksij, to be clear, I only had an issue with consistency.
> You were adding KSZ9477_INGRESS_TAG_LEN during ksz9477_change_mtu() but
> not during initial setup. That prompted the question: is that particular
> member of the sum needed or not? Either it's needed in both places, or
> in none.
> 
> Then, apart from removing KSZ9477_INGRESS_TAG_LEN, you've also made an
> unsolicited change (subtracted VLAN_HLEN from the value programmed to
> hardware) without a clear confirmation that you understand what this
> does, and without explicitly saying that the iperf3 test above still
> works with this formula applied.
> 
> Since the VLAN header is part of L2, it means that a port configured for
> MTU 1500 must also support VLAN-tagged packets with an L2 payload of
> 1500 octets. 1500 + ETH_HLEN + VLAN_HLEN == 1518 octets.

Ah.. now it solves my brain knot.

> And since you need to add ETH_HLEN + ETH_FCS_LEN, I have an unconfirmed
> hunch that VLAN_HLEN is also needed for the case above.

Yes, you are right.

> So, I'm sorry for being paranoid, but you aren't really giving me a
> choice but to ask again, and again.

Thank you for being paranoid. Sorry, i'll send new patch.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2022-03-08 12:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23  8:40 [PATCH net-next v2 1/1] net: dsa: microchip: ksz9477: implement MTU configuration Oleksij Rempel
2022-02-23 23:38 ` Vladimir Oltean
2022-02-24  4:59   ` Oleksij Rempel
2022-02-24  9:33     ` Vladimir Oltean
2022-02-24  9:38       ` Oleksij Rempel
2022-02-24  9:46         ` Vladimir Oltean
2022-02-25 11:47           ` Oleksij Rempel
2022-02-25 11:58             ` Vladimir Oltean
2022-02-25 12:54               ` Oleksij Rempel
2022-02-25 16:35                 ` Vladimir Oltean
2022-03-08 10:06                   ` Oleksij Rempel
2022-03-08 11:21                     ` Vladimir Oltean
2022-03-08 11:59                       ` Oleksij Rempel [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=20220308115955.GB1086@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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).