netvsc: optimize receive completions
authorstephen hemminger <stephen@networkplumber.org>
Fri, 28 Jul 2017 15:59:45 +0000 (08:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Jul 2017 22:25:43 +0000 (15:25 -0700)
commit7426b1a51803ba2d368177363a134b98b0a8d1c0
tree76bc72d1dca7afb26bced93ee47e979be4dedaab
parent02b6de01af1d116c107d61fa3e8583be3b97ac3c
netvsc: optimize receive completions

Optimize how receive completion ring are managed.
   * Allocate only as many slots as needed for all buffers from host
   * Allocate before setting up sub channel for better error detection
   * Don't need to keep copy of initial receive section message
   * Precompute the watermark for when receive flushing is needed
   * Replace division with conditional test
   * Replace atomic per-device variable with per-channel check.
   * Handle corner case where receive completion send
     fails if ring buffer to host is full.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/rndis_filter.c