i40e: optimise prefetch page refcount
authorLi RongQing <lirongqing@baidu.com>
Tue, 18 Aug 2020 07:07:57 +0000 (15:07 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 14 Sep 2020 16:45:34 +0000 (09:45 -0700)
commit1fa5cef283420b3dad93cd6ab04d7125bc1562de
tree1c7286e4032a86334a4b14de7737c7c23bc08f13
parentf49be6dcd74bfb99b6f9deba4a976f74aad1e844
i40e: optimise prefetch page refcount

refcount of rx_buffer page will be added here originally, so prefetchw
is needed, but after commit 1793668c3b8c ("i40e/i40evf: Update code to
better handle incrementing page count"), and refcount is not added
every time, so change prefetchw as prefetch.

Now it mainly services page_address(), but which accesses struct page
only when WANT_PAGE_VIRTUAL or HASHED_PAGE_VIRTUAL is defined otherwise
it returns address based on offset, so we prefetch it conditionally.

Jakub suggested to define prefetch_page_address in a common header.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
include/linux/prefetch.h