From owner-freebsd-arm@freebsd.org Thu May 4 14:51:29 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69954D5DC5E for ; Thu, 4 May 2017 14:51:29 +0000 (UTC) (envelope-from olavi.m.kumpulainen@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D39AB104A for ; Thu, 4 May 2017 14:51:28 +0000 (UTC) (envelope-from olavi.m.kumpulainen@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id j1so9474778lfh.2 for ; Thu, 04 May 2017 07:51:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version; bh=Gj4d0JRHLAOIImm7fJD5XKLzNObxGk0dXU2Y0WJIlAU=; b=YICdQcp5zIxZ/z7aFh8fhfMn1K3VPieTBVW/UIVTZRxuKPFhqhKJQ8rxinP8XEeVBs tNmOJA3N1ktPUq0Kw4Q5uMEzY3xy2/TcOWZN+f8BWtC0w0nvzBs9vVFAONMXwOhzO2wu m97U8JdY3aKscn7t3zFqWwEEFbybE21EeyRXlMaZKoK+z5vTu30fvz3tUWRnKudsiu7+ D+kk4KApMG51BtrLQ5QcFkOLoaeWvFzsTXXd/y9uPNC9DZdc082ubDA1do0CmSzEllWS EAWPCP5g7PxnKBFSGTldzGvBdd1oH/BjzLKYN2rJ1qRLCIe1JUgqSOodHMjFtbL1VCHO nGiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=Gj4d0JRHLAOIImm7fJD5XKLzNObxGk0dXU2Y0WJIlAU=; b=Gj3T8nZ1wSaHoSyEFW5TJ+O5csn09ee8mBCO6ONVpEmIPRu1ha96ra4Wl2ASXVeDW9 DLthMJNmXRPUV5LV2f499JOO479Lv12Nh15gAHkmFLv7iT/oes+k+ty6La+8pFNPtkVM 4xIEkJFbtqblORncVidb0RPW1lHzCRSDNnUmKAUsXdfV8imIAhFOFZbkyJJ1gGavrcl+ EfhDky0q68KZREUKT2Ouahgmr4mcKoDEh2iY0dy/iKJ0r+SDDOiLG/X3gw1C012jpMdp VS7N1Zsfa09oaEorgimKoQagF8KoMlxLdn2lU+OcUt15J5lT/PbLdaqvxCwWY9rL0Yo8 x5HQ== X-Gm-Message-State: AN3rC/5JjVLDSuftNvwlH9hoQPZ9mw2ipGjTVGqJhn366WD6gTfVDF/l Bm61ab2NxyhA6N9dfhU= X-Received: by 10.46.22.76 with SMTP id 12mr15368423ljw.55.1493909486654; Thu, 04 May 2017 07:51:26 -0700 (PDT) Received: from [192.168.1.112] (c83-251-251-174.bredband.comhem.se. [83.251.251.174]) by smtp.gmail.com with ESMTPSA id v6sm75244ljd.17.2017.05.04.07.51.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 07:51:25 -0700 (PDT) To: freebsd-arm@FreeBSD.org From: Olavi Kumpulainen Subject: cpsw drops packets when stressed on BBB and 11.0-STABLE Message-ID: <25b417df-9073-0e3e-39f7-64ca241d516d@gmail.com> Date: Thu, 4 May 2017 16:51:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 14:51:29 -0000 Hi, I'm running a snapshot build of FreeBSD-11, FreeBSD beaglebone 11.0-STABLE FreeBSD 11.0-STABLE #0 r317153: Thu Apr 20 09:21:26 UTC 2017 root@releng2.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/BEAGLEBONE arm on a BBB. I see that cpsw drops outgoing packets when stressed. Out of some reason, dev.cpswss.0.stats.RxStartOfFrameOverruns increments when packets are dropped which may be a hint on what’s going on. The fact that RxStartOf... increases is confusing, because the packets seem to be dropped in transmission. Anyway - I’ve found a simple way to reproduce the problem, namely by sending long pings. On the BBB: # tcpdump -ni cpsw0 icmp& Initial state of RxStartOfFrameOverruns in BBB after playing around a bit: # sysctl dev.cpswss.0.stats.RxStartOfFrameOverruns dev.cpswss.0.stats.RxStartOfFrameOverruns: 86 # ping -c 1 -s 14000 192.168.0.3 PING 192.168.0.3 (192.168.0.3): 14000 data bytes 11:36:57.965980 IP 192.168.0.158 > 192.168.0.3: ICMP echo request, id 53762, seq 0, length 1480 11:36:57.966658 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.966826 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.966923 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967009 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967090 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967173 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967254 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967336 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 11:36:57.967414 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 (10 packets has supposedly been put into the tx ring in BBB) Looking at RxStartOfFrameOverruns in the BBB, I see an increment by 5… #sysctl dev.cpswss.0.stats.RxStartOfFrameOverruns dev.cpswss.0.stats.RxStartOfFrameOverruns: 91 I've set up a tcpdump on the target machine: $ sudo tcpdump -ni eth2 icmp 13:52:42.603199 IP 192.168.0.158 > 192.168.0.3: ICMP echo request, id 53762, seq 0, length 1480 13:52:42.604697 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 (Eight fragments lost!) Without tcpump in BBB, more packets seem to go through (showing tcpdump on target); 13:56:08.396553 IP 192.168.0.158 > 192.168.0.3: ICMP echo request, id 55554, seq 0, length 1480 13:56:08.397781 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 13:56:08.399029 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 13:56:08.400157 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 13:56:08.401409 IP 192.168.0.158 > 192.168.0.3: ip-proto-1 (Five packets lost) Again, there's an increment in RxStartOfFrame...: # sysctl dev.cpswss.0.stats.RxStartOfFrameOverruns dev.cpswss.0.stats.RxStartOfFrameOverruns: 96 I added a printf in tx_enqueue() in an attempt to see what’s going on, but doing so “fixed the bug” – obviously by adding a delay in the forwarding code. Maybe we have a timing/race between the driver and the cpsw hardware? Also, I tested sending 14k pings from the standard-installed Linux in the BBB and that worked just fine. So the packets aren't lost between the hosts (the machines are connected via the same switch). Any ideas? Cheers - /Olavi