From owner-freebsd-net@freebsd.org Tue Apr 24 04:59:53 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F3F3FBA90F for ; Tue, 24 Apr 2018 04:59:53 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (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 B60F26FCF0 for ; Tue, 24 Apr 2018 04:59:52 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x236.google.com with SMTP id f15so11229310pfn.0 for ; Mon, 23 Apr 2018 21:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8JMtg0s3OzOuwdtYBnQCDWoBqMw7ruSGwASRIQCyMtI=; b=i5Tz+RQ2IUbXtltDdOcF+au/2uD/GHY7F3ogzeP/44BqxxqD+hzowhGJd6tEg9KDQ4 Ct3uarSDkQEzzHbNqX35fYDsB6s+mxUfBfka0/CHV/vzFN/lArBD6H072J472bBtllU5 DI7cAJ8uz2ib/I+lJdxvJb+PQmQsMdLPtKsGQZZmbh6plRM16bu05VdEyNtSI4g6cPB4 PxVyFv/qz4G5xvWij4r9ZPWzDjKij/QFfqnaYJgN4LZJRvOHnsBSHwoJgovHjPUVvOAZ rU2AhvA2qHjF/LbG8POl6BEbsUjY1a1tl8n7B23QtxCaE/Nbvg4yI9MZiW6N2eJ0gH8p +7ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=8JMtg0s3OzOuwdtYBnQCDWoBqMw7ruSGwASRIQCyMtI=; b=VnnCQVp9Iwk49OKI8dhgThCP3Zmf595gL+m8CO7dHMVSHrGFS1Ax8vgkUo6ZKNdCpk zVeZv98sFgLM6vP8yppqeBYs7jO9XWr7t3SSG64zsRlT4g0pLdpEwf5ENvZf2ZMVp2Co 6pBL9qldbc/ctWHRA3vOxiJElkBBXePryuTzjgc9Fs/ndSy3aZHe1Jt/ySJmkPT7KwXc HzqN8Gdp6slz7vUBLmOJpQUOYlJxZuv6NbGvxCZr89JLsZWDCptQC1m3LHgKt/MnKCyt bZw8pzMdcdZoqLbIf0cpxDyB8RPbd6OOrfNIArJW5R2tfwOEowxIPiCk6X0ZPG/pc8/K p3gQ== X-Gm-Message-State: ALQs6tA7F/L20mzBZUgpC1eEgEWvyr5cBGb2HLaSa3A7fjR3ciaBrLyq 7ywFVCBGByDNJsK3ZCGIzLDMdQ== X-Google-Smtp-Source: AIpwx4/0tzDDVRpYp894KGdlvSyIZAGUAuCkLtuYwMRZoGchhyZTz8Kd5agtN2ysr+ESOgJQxBCg1g== X-Received: by 2002:a17:902:6045:: with SMTP id a5-v6mr23288732plt.138.1524545991825; Mon, 23 Apr 2018 21:59:51 -0700 (PDT) Received: from localhost ([58.237.141.52]) by smtp.gmail.com with ESMTPSA id r81sm28264960pfj.79.2018.04.23.21.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 21:59:50 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Tue, 24 Apr 2018 13:59:46 +0900 Date: Tue, 24 Apr 2018 13:59:46 +0900 To: Dieter BSD Cc: freebsd-net@freebsd.org Subject: Re: AX88179 USB-to-Ethernet is slow and silently corrupts data Message-ID: <20180424045946.GB3123@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 04:59:53 -0000 On Tue, Apr 10, 2018 at 03:54:58PM -0700, Dieter BSD wrote: > 10.3-RELEASE > amd64 with ECC memory > VIA VL805 USB 3.0 controller > ue0 is Siig USB-to-Ethernet Chipset: AX88179 > > ugen0.7: at usbus0, cfg=0 md=HOST > spd=SUPER (5.0Gbps) pwr=ON (124mA) > > ue0: flags=8c43 metric 0 > mtu 1500 > options=8000b > inet 10.0.210.66 netmask 0xffffff00 broadcast 10.0.210.255 > nd6 options=29 > media: Ethernet autoselect (1000baseT ) > status: active > > If media is set to "1000baseT " it "works", but slowly, and > received data is silently corrupted. :-( Transmitted data is not > corrupted (tested with > 30 GB). > > ifconfig ue0 -txcsum > "works", but still gives silent data corruption > > ifconfig ue0 -rxcsum (acts the same with or without txcsum) > ping out > netstat sees packets both directions, but ping doesn't see the response: > 8 packets transmitted, 0 packets received, 100.0% packet loss > ping in > netstat sees packets in, but no responses going out > > I can see that some Ethernet controllers would not support checksum offloading, > but it seems to me that turning the checksum offloading off should always > work? (at the expense of more cpu load) > > Previously (2016 May): > # ifconfig ue0 media 100baseTX-FDX > fixed the input error problem and the data corruption problem, > at the expense of making it even slower. > > Sent data from machine A with 10Mbps Ethernet. (Netgear Ethernet switch > converts 10Mbps to 1000Mbps) Netstat did not report any input errors on > ue0 and there was no data corruption. So ue0 can handle gigabit data rate, > but gets input errors if packets arrive too frequently. > > I tried moving it to a USB-2 port. No data corruption, but USB-2 is slow. > > The chip performs a lot better for tweaktown: > http://www.tweaktown.com/reviews/7243/vantec-cb-u300gna-usb-3-gigabit-network-adapter-review/index.html > (Vantec CB-U300GNA with the same Asix AX88179 chip) > "full duplex gigabit with 952 Mbps consistently across the chart" > > http://www.vantecusa.com/products_detail.php?p_id=143&p_name=USB+3.0+Gigabit+Ethernet+Adapter&pc_id=21&pc_name=Network&pt_id=5&pt_name=Accessories > > Asix AX88179 chip: > http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=131;71;112 > "Supports Jumbo frame up to 4KB" > > But ifconfig rejects any value > 1500: > ifconfig ue0 mtu 1501 > ifconfig: ioctl SIOCSIFMTU (set mtu): Invalid argument > > I tried mtu of 100, 500, 1000, 1400 but they all give > rcp: lost connection > > USB disks are fast, so the USB controller seems to work ok. > > I also tried a Tek Republic TUN-300 which has the same AX88179, > and it acts the same as the Siig. > > So, transmit works, but is slow. Receive works if the amount of traffic > is low enough (limit rate of data sent, limit Ethernet speed, or > use USB-2). But if data is received too fast it gets silently corrupted. > Setting -rxcsum does not work, and cannot set mtu other than 1500. > [Removed freebsd-usb@, freebsd-hackers@ and freebsd-drivers@ in the CC list] > Questions: > Why does -rxcsum not work? The driver implements RX checksum offloading but it seems it has some issue in RX data handling. > Why does attempting to set a larger mtu fail? Jumbo frame support was not implemented in axge(4). > Why does setting a smaller mtu make rcp fail? > Why is the chip acting slow? > How do I get it to work properly? (fast and without data corruption) In order to narrow down the issue it would be helpful to know: - Disable all H/W checksum offloading features. - Which phy driver is used for axge(4)? You can see the phy driver name below axge(4) attachment in dmesg output. - Do you use manual media configuration instead of auto-negotiation? - Does the issue happen at which media speed(10Mbps, 100Mbps or 1000Mbs)? - Does the issue happen with which USB driver(ehci(4) or xhci(4))? - Which direction of packet flow is broken(TX or RX or both)? You need two boxes(one with ue(4) and the other with good working system). If TX flow of ue(4) is broken, your good working system will report number of bad input packets. If RX flow of ue(4) is broken, you may receive corrupted data without errors. Use TCP to test for TX/RX flow.