[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200728131423.2430b3f1@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 28 Jul 2020 13:14:23 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, Li RongQing <lirongqing@...du.com>,
netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
jeffrey.t.kirsher@...el.com,
Andrew Bowers <andrewx.bowers@...el.com>
Subject: Re: [net-next 2/6] i40e: prefetch struct page of Rx buffer
conditionally
On Tue, 28 Jul 2020 12:08:38 -0700 Tony Nguyen wrote:
> From: Li RongQing <lirongqing@...du.com>
>
> page_address() 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
>
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index 3e5c566ceb01..5d408fe26063 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -1953,7 +1953,9 @@ static struct i40e_rx_buffer *i40e_get_rx_buffer(struct i40e_ring *rx_ring,
> struct i40e_rx_buffer *rx_buffer;
>
> rx_buffer = i40e_rx_bi(rx_ring, rx_ring->next_to_clean);
> +#if defined(WANT_PAGE_VIRTUAL) || defined(HASHED_PAGE_VIRTUAL)
> prefetchw(rx_buffer->page);
> +#endif
Looks like something that belongs in a common header not (potentially
multiple) C sources.
Powered by blists - more mailing lists