From patchwork Wed Nov 15 16:15:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 10059813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 317646019D for ; Wed, 15 Nov 2017 16:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D9E428AB4 for ; Wed, 15 Nov 2017 16:15:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10E532A07F; Wed, 15 Nov 2017 16:15:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 75A6D28AB4 for ; Wed, 15 Nov 2017 16:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s2WiIUKH5Smn5c88ET3KecSN+o6XKVj3WptfQKRlQBQ=; b=ozld6aJfgAgl6i syCnUY7/OPKuHI/CFZ+2/eck1DgxJlsemSxfne4V81EYZm6IreE9l2DYD00+qnT2o3JZp2/wcg3d5 2lTR9KL2PWgCzdk4SC/s9MNqTyjXL0cVpjVHnZVoEIV4Q3r3p9AoENkA0HD8wpWpArgwO6Njm6vRz 2bpvOz2Uwr2oOQJ3DBEVh5P+F68YSI4lCX/ylHgaZ60w1WS8wCo1oKuEuPLoYraCwJlu5q/CvMxk7 R7h7tefFTkjnhV94OCwEftUQGqYB/RkOcUb/zZZ7zW9GTXnoeaHUATGot8mr5RhLge7TyxLCL7bY6 fBBzG9iSi9mULibC4sbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eF0Lr-0006iL-2O; Wed, 15 Nov 2017 16:15:47 +0000 Received: from us-smtp-delivery-107.mimecast.com ([63.128.21.107]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eF0Ln-0006CB-Ax for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2017 16:15:45 +0000 Received: from CPH-EX1.SDESIGNS.COM (195-215-56-170-static.dk.customer.tdc.net [195.215.56.170]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-128-pHwRtAdiNQqNgr6-Bfmbmw-1; Wed, 15 Nov 2017 11:15:19 -0500 X-MC-Unique: pHwRtAdiNQqNgr6-Bfmbmw-1 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 15 Nov 2017 17:15:16 +0100 Subject: Re: [PATCH v3 3/4] net: nb8800: Move HW init to ndo_open() To: Mans Rullgard References: <230165aa-eaf1-6e2b-7ff3-45b3ee4ffc62@sigmadesigns.com> <103bc878-9311-a727-1c21-2070e0a480e5@sigmadesigns.com> <4e22ef54-d823-fc29-fedc-d447fa3d9c88@sigmadesigns.com> <30042004-4e13-b7e2-b49d-754db54cc5ce@sigmadesigns.com> From: Marc Gonzalez Message-ID: Date: Wed, 15 Nov 2017 17:15:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.27.0.114] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171115_081543_466059_8E01FE24 X-CRM114-Status: UNSURE ( 8.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , Mason , netdev , Thibaud Cornic , David Miller , Linux ARM Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 15/11/2017 16:11, Måns Rullgård wrote: > Well, that's not good. I'll see if I can replicate it later this week. In my latest test, I started from v4.14 and only applied the following patch: Once I booted the SMP8759 board, I ran ip addr add 172.27.64.23/18 brd 172.27.127.255 dev eth0 ip link set eth0 up sleep 5 iperf3 -s And from the PC, I ran iperf3 -c 172.27.64.23 -u -b 0 -l 1400 -t 120 [ 5] local 172.27.64.23 port 5201 connected to 172.27.64.1 port 53771 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 5] 0.00-1.00 sec 5.89 MBytes 49.4 Mbits/sec 0.044 ms 77062/81472 (95%) [ 5] 1.00-2.00 sec 6.25 MBytes 52.5 Mbits/sec 0.052 ms 80112/84796 (94%) [ 5] 2.00-3.00 sec 6.26 MBytes 52.5 Mbits/sec 0.054 ms 80112/84797 (94%) [ 5] 3.00-4.00 sec 6.26 MBytes 52.5 Mbits/sec 0.053 ms 80128/84814 (94%) [ 5] 4.00-5.00 sec 6.26 MBytes 52.5 Mbits/sec 0.049 ms 80112/84798 (94%) [ 5] 5.00-6.00 sec 6.26 MBytes 52.5 Mbits/sec 0.052 ms 80096/84783 (94%) [ 5] 6.00-7.00 sec 6.26 MBytes 52.5 Mbits/sec 0.047 ms 80096/84784 (94%) [ 5] 7.00-8.00 sec 6.26 MBytes 52.5 Mbits/sec 0.060 ms 80128/84815 (94%) iperf3: OUT OF ORDER - incoming packet = 731264 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731265 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731266 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731267 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731268 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731269 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731270 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731271 and received packet = 0 AND SP = 731279 iperf3: OUT OF ORDER - incoming packet = 731272 and received packet = 0 AND SP = 731279 [ 5] 8.00-9.00 sec 4.17 MBytes 35.0 Mbits/sec 0.149 ms 53104/56220 (94%) [ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (0%) [ 5] 10.00-11.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (0%) [ 5] 11.00-12.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (0%) [ 5] 12.00-13.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (0%) [ 5] 13.00-14.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (0%) ^C - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 5] 0.00-17.04 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 690950/731279 (94%) [SUM] 0.0-17.0 sec 9 datagrams received out-of-order iperf3: interrupt - the server has terminated # ping -c 10 172.27.64.1 PING 172.27.64.1 (172.27.64.1): 56 data bytes --- 172.27.64.1 ping statistics --- 10 packets transmitted, 0 packets received, 100% packet loss Given the out-of-order datagrams, I'm wondering if it's possible for the DMA engine to overwrite a not-yet-read descriptor? The EOC flag should stop the DMA engine though... Maybe some kind of race... I don't think I've been able to trigger the wedge when 256 descriptors are used. diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index e94159507847..5c109cc4bde8 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -317,6 +317,7 @@ static int nb8800_poll(struct napi_struct *napi, int budget) len = RX_BYTES_TRANSFERRED(rxd->report); + udelay(200); if (IS_RX_ERROR(rxd->report)) nb8800_rx_error(dev, rxd->report); else @@ -1246,10 +1247,12 @@ static int nb8800_hw_init(struct net_device *dev) nb8800_writeb(priv, NB8800_PQ1, val >> 8); nb8800_writeb(priv, NB8800_PQ2, val & 0xff); +#if 0 /* Auto-negotiate by default */ priv->pause_aneg = true; priv->pause_rx = true; priv->pause_tx = true; +#endif nb8800_mc_init(dev, 0); diff --git a/drivers/net/ethernet/aurora/nb8800.h b/drivers/net/ethernet/aurora/nb8800.h index aacc3cce2cc0..a2d4b841306a 100644 --- a/drivers/net/ethernet/aurora/nb8800.h +++ b/drivers/net/ethernet/aurora/nb8800.h @@ -8,7 +8,7 @@ #include #include -#define RX_DESC_COUNT 256 +#define RX_DESC_COUNT 16 #define TX_DESC_COUNT 256 #define NB8800_DESC_LOW 4