summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ix.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-03-01 04:47:34 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-03-01 04:47:34 +0000
commitd29a5aa65bfd884803a1eb5820f990d919696aa4 (patch)
tree0e10b6d89ffbde9050d79e56c155936c59a8ed9e /sys/dev/pci/if_ix.c
parent43f1cf5d7d05c478c6845bbe4a02d5584230ac7e (diff)
rework how ifiq_input decides the stack is busy and whether it should drop
previously ifiq_input uses the traditional backpressure or defense mechanism and counts packets to decide when to shed load by dropping. currently it ends up waiting for 10240 packets to get queued on the stack before it would decide to drop packets. this may be ok for some machines, but for a lot this was too much. this diff reworks how ifiqs measure how busy the stack is by introducing an ifiq_pressure counter that is incremented when ifiq_input is called, and cleared when ifiq_process calls the network stack to process the queue. if ifiq_input is called multiple times before ifiq_process in a net taskq runs, ifiq_pressure goes up, and ifiq_input uses a high value to decide the stack is busy and it should drop. i was hoping there would be no performance impact from this change, but hrvoje popovski notes a slight bump in forwarding performance. my own testing shows that the ifiq input list length grows to a fraction of the 10240 it used to get to, which means the maximum burst of packets through the stack is smoothed out a bit. instead of big lists of packets followed by big periods of drops, we get relatively small bursts of packets with smaller gaps where we drop. the follow-on from this is to make drivers implementing rx ring moderation to use the return value of ifiq_input to scale the ring allocation down, allowing the hardware to drop packets so software doesnt have to.
Diffstat (limited to 'sys/dev/pci/if_ix.c')
0 files changed, 0 insertions, 0 deletions