From owner-freebsd-questions@freebsd.org Tue Feb 16 13:06:41 2016 Return-Path: Delivered-To: freebsd-questions@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 5AFC7AAA2B9 for ; Tue, 16 Feb 2016 13:06:41 +0000 (UTC) (envelope-from alberto.piai@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 EA8CC1D38 for ; Tue, 16 Feb 2016 13:06:40 +0000 (UTC) (envelope-from alberto.piai@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id g62so190765063wme.0 for ; Tue, 16 Feb 2016 05:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=pOd2m4YzGVKZbWBZ+sLnBcplYyFMj3jIOhYQjxm8TUY=; b=p9Hx4y+qAhnF/vFNSKrpOPXEV8sNxrXgsPULdjdeJr6Q2dhlLGtTbxti+UWcP71Ee6 xqbXecHPcPDVOZyqP+/X8jMB/X9PeMFNAZNKj0Sucz8we6kbDnUVA/9yGZJFPJdNNC0R P2RmkZ9yB0BlmM5TptZYyWe1yAP/O0uXTt4DB88qGZ+V8XohaXfQtlvxiHZoGlSkFAc5 P8ePWNj4yXuEQOYPtap4qD9ZsTcwfwcWbOkOvB+cwnKQ+CrqX8iyqNHcsfr56mRXPC5a zfwcXalmWOP692CD0YbB0qx4qUdQVrf0jjnHRkk0ukqS67zJ5N+xsFeXdf8TWRzCRuzJ BDKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=pOd2m4YzGVKZbWBZ+sLnBcplYyFMj3jIOhYQjxm8TUY=; b=Fem3LrK9ontv8oTG9FcoadJKUTuwQcZ/9nFvB7U3C6sDb5gA7n/u0Wq1LOi9TWJYd1 YyjJDkbHTeqQVKVLTg2bTJzwcmeVVIjsqgoHh7e2oL8cNo/AqvCv8l1mFndCYEUBdzey Eo60zRVEhe+gRwm+ybPOrcI8wZG3bSIa8+lNV93dCiYMkary5RxZRlPL3Bv+mSg4criC o8QUnSu5Qn07AONJJsLUsnqo9aE4zxymOHQkEyi2hC4W3XOfbzhouWprFUCg9zGSYwSD Oq8GErtYaYbmqNrRyJLMLoo76gZ1tKqkYPteVhacXvXO0zQJff2K3VT3PEHf1XU9rEBm g36A== X-Gm-Message-State: AG10YOTK0wRvYQEMrvgt2oMNDvwaSoIc+LmJQd1xjOGeS6NKl/ynH+dZDyyNkSXUkk9/BfqAFDk+/3ScfipMlA== MIME-Version: 1.0 X-Received: by 10.28.32.147 with SMTP id g141mr18796130wmg.19.1455627999440; Tue, 16 Feb 2016 05:06:39 -0800 (PST) Received: by 10.28.35.198 with HTTP; Tue, 16 Feb 2016 05:06:39 -0800 (PST) Date: Tue, 16 Feb 2016 14:06:39 +0100 Message-ID: Subject: USB ethenret performance problem From: Alberto Piai To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2016 13:06:41 -0000 Hello, I'm running pfSense 2.2.6 in a KVM virtual machine. The pfSense vm has two NICs: - LAN: em0, bridged from the vm host - WAN: ue0, attached directly to the guest using usb passthrough and an emulated EHCI controller The LAN interface works as expected. The WAN is correctly recognized from the guest box, the axe(4) driver takes over and everything seems to work smoothly: ``` root: dmesg | grep usb usbus0: controller did not stop usbus0 on uhci0 usbus1: controller did not stop usbus1 on uhci1 usbus2: controller did not stop usbus2 on uhci2 usbus3: EHCI version 1.0 usbus3 on ehci0 usbus0: 12Mbps Full Speed USB v1.0 usbus1: 12Mbps Full Speed USB v1.0 usbus2: 12Mbps Full Speed USB v1.0 usbus3: 480Mbps High Speed USB v2.0 ugen1.1: at usbus1 uhub0: on usbus1 ugen0.1: at usbus0 uhub1: on usbus0 ugen2.1: at usbus2 uhub2: on usbus2 ugen3.1: at usbus3 uhub3: on usbus3 Root mount waiting for: usbus3 usbus2 usbus1 usbus0 Root mount waiting for: usbus3 Root mount waiting for: usbus3 Root mount waiting for: usbus3 ugen3.2: at usbus3 axe0: on usbus3 ``` The ethernet interface is correctly attached to the faster controller (usbus3), and recognized as "100baseTX ". ue0 gets a public IP from my ISP, and everything seems to work fine, except... ``` fetch -o /dev/null http://brainlock.eu/speedtest.dat /dev/null 7% of 100 MB 923 kBps 01m55s ``` The top throughput that I can get is ~8 mbps (I've seen about 16 mbps when using bittorrent, though). My downstream is 100mbps. Connecting directly from the host, I get almost the full bandwidth. Booting the exact same VM from a linux live cd, I can also download at almost 100mbps. Booting a plain FreeBSD VM from ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.2-RELEASE/amd64/Lat= est/ I get the same ~8mbps. This excludes a problem with the KVM usb passthrough / controller emulation (linux as a guest works fine), and it excludes a pfSense specific issue (plain FreeBSD exhibits the same problem). The guest vm doesn't seem overloaded: while downloading, top shows ~10%system, ~8%interrupt, ~82%idle. Latency is fine, and netstat doesn't show packets being dropped. Am I missing something really obvious here? If not, maybe somebody has ideas on how to further analyze/debug this? (I'm not a believer in random googling for magic solutions, but before bothering the mailing list I tried the suggestion that pops up often in the search results =E2=80=93 disabling tx and rx checksums. Makes no difference= .) Thank you! Alberto