linux/drivers/net/ethernet/intel/fm10k
Jesse Brandeburg 0bcd952fee ethernet/intel: consolidate NAPI and NAPI exit
While reviewing code, I noticed that Eric Dumazet recommends that
drivers check the return code of napi_complete_done, and use that
to decide to enable interrupts or not when exiting poll.  One of
the Intel drivers was already fixed (ixgbe).

Upon looking at the Intel drivers as a whole, we are handling our
polling and NAPI exit in a few different ways based on whether we
have multiqueue and whether we have Tx cleanup included. Several
drivers had the bug of exiting NAPI with return 0, which appears
to mess up the accounting in the stack.

Consolidate all the NAPI routines to do best known way of exiting
and to just mostly look like each other.
1) check return code of napi_complete_done to control interrupt enable
2) return the actual amount of work done.
3) return budget immediately if need NAPI poll again

Tested the changes on e1000e with a high interrupt rate set, and
it shows about an 8% reduction in the CPU utilization when busy
polling because we aren't re-enabling interrupts when we're about
to be polled.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-21 10:35:23 -08:00
..
fm10k_common.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_common.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_dcbnl.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_debugfs.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_ethtool.c treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
fm10k_iov.c fm10k: ensure completer aborts are marked as non-fatal after a resume 2018-10-31 10:37:32 -07:00
fm10k_main.c ethernet/intel: consolidate NAPI and NAPI exit 2018-11-21 10:35:23 -08:00
fm10k_mbx.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_mbx.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_netdev.c fm10k: remove ndo_poll_controller 2018-09-23 21:55:24 -07:00
fm10k_pci.c fm10k: add missing device IDs to the upstream driver 2018-10-31 10:43:13 -07:00
fm10k_pf.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_pf.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_tlv.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_tlv.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_type.h fm10k: add missing device IDs to the upstream driver 2018-10-31 10:43:13 -07:00
fm10k_vf.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k_vf.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
fm10k.h fm10k: remove ndo_poll_controller 2018-09-23 21:55:24 -07:00
Makefile net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00