summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_auereg.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2001-11-29 22:46:48 +0000
committerluigi <luigi@FreeBSD.org>2001-11-29 22:46:48 +0000
commit21d95a8778ba9e3b0c772562bf186d63935a003a (patch)
tree797adae1a314e6970fa5583f123d967aa2b1c164 /sys/dev/usb/if_auereg.h
parent09990be9983e807bd7d1049320397cc1c984483f (diff)
downloadFreeBSD-src-21d95a8778ba9e3b0c772562bf186d63935a003a.zip
FreeBSD-src-21d95a8778ba9e3b0c772562bf186d63935a003a.tar.gz
For i386 architecture, remove an expensive m_devget() (and the
underlying unaligned bcopy) on incoming packets that are already available (albeit unaligned) in a buffer. The performance improvement varies, depending on CPU and memory speed, but can be quite large especially on slow CPUs. I have seen over 50% increase on forwarding speed on the sis driver for the 486/133 (embedded systems), which does exactly the same thing. The behaviour is controlled by a sysctl variable, hw.dc_quick which defaults to 1. Set it to 0 to restore the old behaviour. After running a few experiments (in userland, though) I am convinced that doing the m_devget() is detrimental to performance in almost all cases. Even if your CPU has degraded performance with misaligned data, the bcopy() in the driver has the same overhead due to misaligment as the one that you save in the uiomove(), plus you do one extra copy and pollute the cache. But more often than not, you do not even have to touch the payload, e.g. when you are forwarding packets, and even in the often-cited case of NFS, you often end up passing a pointer to the payload to the disk controller. In any case, you can play with the sysctl variable to toggle between the two behaviours, and see if it makes a difference. MFC-after: 3 days
Diffstat (limited to 'sys/dev/usb/if_auereg.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud