From owner-freebsd-arm@FreeBSD.ORG Sat Mar 21 08:19:06 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BF4889 for ; Sat, 21 Mar 2015 08:19:06 +0000 (UTC) Received: from moon.peach.ne.jp (moon.peach.ne.jp [203.141.148.98]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10C45752 for ; Sat, 21 Mar 2015 08:19:04 +0000 (UTC) Received: from moon.peach.ne.jp (localhost [127.0.0.1]) by moon.peach.ne.jp (Postfix) with ESMTP id 7A3986811E; Sat, 21 Mar 2015 17:19:02 +0900 (JST) Received: from artemis (unknown [172.18.0.21]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by moon.peach.ne.jp (Postfix) with ESMTPSA id 511FC68118; Sat, 21 Mar 2015 17:19:02 +0900 (JST) Message-ID: <3429DC2CFDA24B9585F82FA9A8EF7D28@ad.peach.ne.jp> From: "Daisuke Aoyama" To: "Hans Petter Selasky" , References: <1DA948EA255F4963ACBC0EBE7D046401@ad.peach.ne.jp> <34D37D2811D246BEB11080D19F03FECE@ad.peach.ne.jp> <579F7C2BEACC4FF684780E575AC9C474@ad.peach.ne.jp> <54F9BBA8.8080002@selasky.org> In-Reply-To: <54F9BBA8.8080002@selasky.org> Subject: Re: Ready for NAS4Free on ODROID-C1 Date: Sat, 21 Mar 2015 17:19:11 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2015 08:19:06 -0000 Hi, >> Changes: >> Add USB fast writing patch (3x faster but may break some condition on RPi) >Do you have a link for this patch? New version is released, and the source diff is also uploaded. Please use the link below. I drop out v1.1 patch. It does not work under some condition. Now, I'm making v1.2 patch and testing it. However, I will plan to make v1.3 for reading. This is not final version. I tested only bulk transfer on ODROID-C1 and tested HOST mode only (mainly using USB HDD or USB flashdrive) The source diff against to HEAD r279589: http://www.peach.ne.jp/archives/oc1/patch/dwc_otg-20150321.patch Current score is around Raw Read 14.5MB/s (1.3x faster), UFS Write 26.0MB/s (4.0x faster). Writing is 74% of amd64 kernel score since the unit is around 35MB/s on amd64. NAS4Free SMB performance is R:16.43MB/s, W:23.96MB/s at 4GB x 9 = total 36GB transfer The HDD is Toshiba MK5065GSX (2.5inch/5400rpm/8MB cache). Example of dd: I changed dd size from 16MiB to 32MiB because writing is fast enough. # mount /dev/da0p1 /mnt # dd if=/dev/zero of=/mnt/test.dat bs=1m count=32 32+0 records in 32+0 records out 33554432 bytes transferred in 1.287799 secs (26055644 bytes/sec) # umount /mnt # mount /dev/da0p1 /mnt # dd if=/mnt/test.dat of=/dev/null bs=1m 32+0 records in 32+0 records out 33554432 bytes transferred in 2.255524 secs (14876557 bytes/sec) Example main OUT transaction: Before: Polling/Wait SOF if need/CH alloc/set pktcnt=1/write FIFO/XXX/ACK/CH free/SOF if need/CH alloc/set pktcnt=1/write FIFO/XXX/ACK/ ... /XXX/ACK/CH free/END (XXX means useless polling loop triggered by other transfer,always polling all intr_q, CH free need 2 x SOF = 250us, usually NAK/NYET is hidden in this delay) After patched: NPTX empty intr/CH alloc/set pktcnt=N/write FIFO/ACK intr/write FIFO/ACK intr/ ... /ACK+XFERCOMPL intr/CH free(restart other xfer)/END (run interrupt delivered channel only, CH free need only CHHLTD intr or RXFLVL intr) Changes on v1.2 USB driver: get rid of polling functiuon (still use one time scan) get rid of waiting SOF use INT_RXFLVL for receiving IN packet use INT_CHHLTD for host channel disable (always issue) use TX FIFO size as multiple of 512 restart/allocate HC by PTX/NPTX FIFO empty intr(half or complete empty) clear HC registers at alloc/free don't free host channel until transfer is completed or aborted. (BULK RX/TX only at this time) add bulk transfer that support multiple packets add interrupt driven HC handling add NYET/PING/ACK/NAK support verify NPTXQSPCAVAIL and NPTXFSPCAVAIL before writing FIFO some bugfixs and improvements Known problems: It seems short(small) packet is slow. Performance on RPi is slow. Debug message can't use under RPi (Probably, CPU is too slow?) if_smsc does not work as expected on RPi. I don't know reason but I see 280K intr/sec in systat. Probably, it's a result of many NAKs for 20480 BULK transfer. ---------------------------------------------------------------------- my USB device list on ODROID-C1: (umass,ukbd,uplcom,axe) # usbconfig list ugen0.1: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) ugen0.2: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA) ugen0.3: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA) ugen0.4: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA) ugen0.5: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (250mA) ugen0.6: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) ugen0.7: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA) ugen0.8: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (70mA) ---------------------------------------------------------------------- Regards, -- Daisuke Aoyama