netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Uvarov <muvarov@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Tim Harvey <tharvey@gateworks.com>,
	netdev <netdev@vger.kernel.org>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Fugang Duan <fugang.duan@nxp.com>
Subject: Re: DSA mv88e6xxx RX frame errors and TCP/IP RX failure
Date: Thu, 31 Aug 2017 12:20:55 +0300	[thread overview]
Message-ID: <CAJGZr0JpkzAeMKHeQ1dD2Zr8oGFBWWYs2MPVk=ak1RPfeFof2g@mail.gmail.com> (raw)
In-Reply-To: <20170831014624.GA18554@lunn.ch>

check with ping -s 1500 that packets passed to cpu. mv88e6xxx add
additional dsa tag before the frame so small packets can pass and big
rejected.

also ethtool -S dsaethdevX shows more details stats for Marvell chips.

or opposite, lower mtu on cpu to 1400 and check that ping works. So
from description of patch above it has to work.

Maxim.

2017-08-31 4:46 GMT+03:00 Andrew Lunn <andrew@lunn.ch>:
>> >                        /* Report late collisions as a frame error. */
>> >                         if (status & (BD_ENET_RX_NO | BD_ENET_RX_CL))
>> >                                 ndev->stats.rx_frame_errors++;
>> >
>> > I don't see anywhere else frame errors are counted, but it would be
>> > good to prove we are looking in the right place.
>> >
>>
>> Andrew,
>>
>> (adding IMX FEC driver maintainer to CC)
>>
>> Yes, that's one of them being hit. It looks like ifconfig reports
>> 'frame' as the accumulation of a few stats so here are some more
>> specifics from /sys/class/net/eth0/statistics:
>>
>> root@xenial:/sys/devices/soc0/soc/2100000.aips-bus/2188000.ethernet/net/eth0/statistics#
>> for i in `ls rx_*`; do echo $i:$(cat $i); done
>> rx_bytes:103229
>> rx_compressed:0
>> rx_crc_errors:22
>> rx_dropped:0
>> rx_errors:22
>> rx_fifo_errors:0
>> rx_frame_errors:22
>> rx_length_errors:22
>> rx_missed_errors:0
>> rx_nohandler:0
>> rx_over_errors:0
>> rx_packets:1174
>> root@xenial:/sys/devices/soc0/soc/2100000.aips-bus/2188000.ethernet/net/eth0/statistics#
>> ifconfig eth0
>> eth0      Link encap:Ethernet  HWaddr 00:D0:12:41:F3:E7
>>           inet6 addr: fe80::2d0:12ff:fe41:f3e7/64 Scope:Link
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:1207 errors:22 dropped:0 overruns:0 frame:66
>>           TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:106009 (103.5 KiB)  TX bytes:4604 (4.4 KiB)
>>
>> Instrumenting fec driver I see the following getting hit:
>>
>> status & BD_ENET_RX_LG /* rx_length_errors: Frame too long */
>> status & BD_ENET_RX_CR  /* rx_crc_errors: CRC Error */
>> status & BD_ENET_RX_CL /* rx_frame_errors: Collision? */
>>
>> Is this a frame size issue where the MV88E6176 is sending frames down
>> that exceed the MTU because of headers added?
>
> I did fix an issue recently with that. See
>
> commit fbbeefdd21049fcf9437c809da3828b210577f36
> Author: Andrew Lunn <andrew@lunn.ch>
> Date:   Sun Jul 30 19:36:05 2017 +0200
>
>     net: fec: Allow reception of frames bigger than 1522 bytes
>
>     The FEC Receive Control Register has a 14 bit field indicating the
>     longest frame that may be received. It is being set to 1522. Frames
>     longer than this are discarded, but counted as being in error.
>
>     When using DSA, frames from the switch has an additional header,
>     either 4 or 8 bytes if a Marvell switch is used. Thus a full MTU frame
>     of 1522 bytes received by the switch on a port becomes 1530 bytes when
>     passed to the host via the FEC interface.
>
>     Change the maximum receive size to 2048 - 64, where 64 is the maximum
>     rx_alignment applied on the receive buffer for AVB capable FEC
>     cores. Use this value also for the maximum receive buffer size. The
>     driver is already allocating a receive SKB of 2048 bytes, so this
>     change should not have any significant effects.
>
>     Tested on imx51, imx6, vf610.
>
>     Signed-off-by: Andrew Lunn <andrew@lunn.ch>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
>
> However, this is was of an all/nothing problem. All frames with the
> full MTU were getting dropped, where as i think you are only seeing a
> few dropped?
>
> Anyway, try cherry picking that patch and see if it helps.
>
>         Andrew



-- 
Best regards,
Maxim Uvarov

  reply	other threads:[~2017-08-31  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 19:53 DSA mv88e6xxx RX frame errors and TCP/IP RX failure Tim Harvey
2017-08-30 22:06 ` Andrew Lunn
2017-08-31  0:22   ` Tim Harvey
2017-08-31  0:38     ` Ilia Mirkin
2017-08-31  1:46     ` Andrew Lunn
2017-08-31  9:20       ` Maxim Uvarov [this message]
2017-08-31 15:37       ` Tim Harvey
2017-08-31 17:41         ` Andrew Lunn
2017-08-31 17:44           ` David Miller

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='CAJGZr0JpkzAeMKHeQ1dD2Zr8oGFBWWYs2MPVk=ak1RPfeFof2g@mail.gmail.com' \
    --to=muvarov@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=fugang.duan@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tharvey@gateworks.com \
    --cc=vivien.didelot@savoirfairelinux.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).