Am Freitag, 24. November 2006 06:00 schrieb Nikita V. Youshchenko: > > However, I've located one more problem which I don't know yet how to fix > > correctly. > > AFAIR, device may pass several incoming frames in one urb, and second > > and later frames are 2-byte-aligned. > > This may cause situations when IP layer gets IP packet not aligned at > > 32-bit word boundary and occasionally crash because of unligned access > > (hardware and/or codebase I'm working with really dislikes unaligned > > accesses from kernel). > > > > Looks the only way to fix that is to detect such cases, and copy data? > > But this will hurt performance on systems that can handle unaligned > > accesses ... > > One more attempt, with typo fixed ... > > Attached is a patch that handles this, based on additional Kconfig key. > I've tested this on hardware and kernel I'm working with, and then > forward-ported to 2.6.19-pre6
Don't introduce a config option. If you do this by ifdef, use ifdef on the arches that you used as default. On those arches the memmove is definitely a win. You could even test it unconditionally on i386 or x86_64. A copy may be faster than keeping it in place, as you touch the data many times, but copy it only once. Regards Oliver ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel