[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABikg9yVfO_97qXgbS3xn-2mkonrREvHBs0_ocbDnshi+B7LBA@mail.gmail.com>
Date: Thu, 13 Oct 2022 18:53:42 +0300
From: Sergei Antonov <saproj@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: David Laight <David.Laight@...lab.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>
Subject: Re: [PATCH v2 net] net: ftmac100: do not reject packets bigger than 1514
On Thu, 13 Oct 2022 at 17:10, Andrew Lunn <andrew@...n.ch> wrote:
>
> > > Without an 802.1Q tag (probably a VLAN tag?) the max frame has
> > > 1514 data bytes (inc mac addresses, but excl crc).
> > > Unless you are using VLANs that should be the frame limit.
> > > The IP+TCP is limited to the 1500 byte payload.
> >
> > Exactly! Incoming packets first go through a switch chip (Marvell
> > 88E6060), so packets should get tagged.
> >
> > > So if the sender is generating longer packets it is buggy!
> >
> > Looking into it.
> >
> > On the sender computer:
> > sudo ifconfig eno1 mtu 1500 up
> > ssh receiver_computer
> >
> > On the receiver computer:
> > in ftmac100_rx_packet_error() I call
> > ftmac100_rxdes_frame_length(rxdes) and it returns 1518. I suppose, it
> > is 1500 + 18(ethernet overhead) + 4(switch tag) - 4(crc).
> >
> > Would you like me to dump the entire packet and verify?
>
> You did not mention DSA before. That is an important fact.
>
> What should happen is that the DSA framework should take the DSA frame
> header into account. It should be calling into the MAC driver and
> asking it to change its MTU to allow for the additional 4 bytes of the
> switch tag.
>
> But there is some history here. For a long time, it was just assumed
> the MAC driver would accept any length of packet, i.e. the MRU,
> Maximum Receive Unit, was big enough for DSA to just work. A Marvell
> switch is normally combined with a Marvell MAC, and this was
> true. This worked for a long time, until it did not work for some
> combination of switch and MAC. It then became necessary to change the
> MTU on the master interface, so it would actually receive the bigger
> frames. But we had the backwards compatibility problem, that some MAC
> drivers which work with DSA because there MRU is sufficient, don't
> support changing the MTU. So we could not make it fatal if the change
> of the MTU failed.
>
> Does this driver support the MTU change op? If not, you should try
> implementing it.
Well, the ftmac100 driver does not implement _change_mtu() function,
but netdev->mtu is correctly set to 1504 because of DSA. So I am
submitting a v3 version of the patch using netdev->mtuft. Please, have
a look at it.
Powered by blists - more mailing lists