git: ethernet: If caller thread cpu is fixed, pass cpuid to ether_input_pkt()
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Sun Mar 9 05:17:00 PDT 2014
commit ff37a3565eba5b54853bbc55b4cbe08fb9511b90
Author: Sepherosa Ziehau <sephe at dragonflybsd.org>
Date: Sun Mar 9 19:28:18 2014 +0800
ethernet: If caller thread cpu is fixed, pass cpuid to ether_input_pkt()
So we could use optimized lwkt_sendmsg_oncpu() instead of lwkt_sendmsg(),
if the target netisr is on the same cpu as caller thread cpu. Mainly to
avoid unnecessary wakeup() IPIs to other cpus.
THE RESULT:
On i7-3770 w/ HT enabled (8 logical cpus); NIC is 82599ES w/ 8 RX rings
and 8 TX rings. Run:
repeat 10 tcp_stream -H ... -i 256 -l 10 -r
(256 netperf TCP_MAERTS instances for 10 seconds, 10 rounds)
Total amount of cross IPIs before this commit is 6946097. Total amount
of cross IPIs as of this commit is 5445324. ~22% unnecessary wakeup()
IPIs are avoided!
Summary of changes:
sys/dev/netif/bce/if_bce.c | 3 ++-
sys/dev/netif/bnx/if_bnx.c | 4 ++--
sys/dev/netif/emx/if_emx.c | 4 ++--
sys/dev/netif/igb/if_igb.c | 4 ++--
sys/dev/netif/ix/if_ix.c | 4 ++--
sys/dev/netif/jme/if_jme.c | 26 +++++++++++++-------------
sys/net/if_ethersubr.c | 31 +++++++++++++++++++++++--------
sys/net/if_var.h | 3 ++-
8 files changed, 48 insertions(+), 31 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ff37a3565eba5b54853bbc55b4cbe08fb9511b90
--
DragonFly BSD source repository
More information about the Commits
mailing list