netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>, <davem@davemloft.net>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <edumazet@google.com>,
	<netdev@vger.kernel.org>
Cc: Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Chandan Kumar Rout <chandanx.rout@intel.com>
Subject: Re: [PATCH net 1/4] ice: fix page reuse when PAGE_SIZE is over 8k
Date: Tue, 20 Aug 2024 15:10:29 -0700	[thread overview]
Message-ID: <b795aee4-d96e-4e9b-8b07-75e42b91a0cf@intel.com> (raw)
In-Reply-To: <20240820215620.1245310-2-anthony.l.nguyen@intel.com>



On 8/20/2024 2:56 PM, Tony Nguyen wrote:
> From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> 
> Architectures that have PAGE_SIZE >= 8192 such as arm64 should act the
> same as x86 currently, meaning reuse of a page should only take place
> when no one else is busy with it.
> 
> Do two things independently of underlying PAGE_SIZE:
> - store the page count under ice_rx_buf::pgcnt
> - then act upon its value vs ice_rx_buf::pagecnt_bias when making the
>   decision regarding page reuse
> 
> Fixes: 2b245cb29421 ("ice: Implement transmit and NAPI support")
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---

Seems reasonable.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/intel/ice/ice_txrx.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
> index 8d25b6981269..50211188c1a7 100644
> --- a/drivers/net/ethernet/intel/ice/ice_txrx.c
> +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
> @@ -837,16 +837,15 @@ ice_can_reuse_rx_page(struct ice_rx_buf *rx_buf)
>  	if (!dev_page_is_reusable(page))
>  		return false;
>  
> -#if (PAGE_SIZE < 8192)
>  	/* if we are only owner of page we can reuse it */
>  	if (unlikely(rx_buf->pgcnt - pagecnt_bias > 1))
>  		return false;
> -#else
> +#if (PAGE_SIZE >= 8192)

Whats with adding PAGE_SIZE >= 8192 here? Oh. I see you removed the
previous check, so this code only ever executed if page size was large. Ok.

>  #define ICE_LAST_OFFSET \
>  	(SKB_WITH_OVERHEAD(PAGE_SIZE) - ICE_RXBUF_2048)
>  	if (rx_buf->page_offset > ICE_LAST_OFFSET)
>  		return false;
> -#endif /* PAGE_SIZE < 8192) */
> +#endif /* PAGE_SIZE >= 8192) */
>  
>  	/* If we have drained the page fragment pool we need to update
>  	 * the pagecnt_bias and page count so that we fully restock the
> @@ -949,12 +948,7 @@ ice_get_rx_buf(struct ice_rx_ring *rx_ring, const unsigned int size,
>  	struct ice_rx_buf *rx_buf;
>  
>  	rx_buf = &rx_ring->rx_buf[ntc];
> -	rx_buf->pgcnt =
> -#if (PAGE_SIZE < 8192)
> -		page_count(rx_buf->page);
> -#else
> -		0;
> -#endif
> +	rx_buf->pgcnt = page_count(rx_buf->page);

yea, seems weird that if page size is large we would just not track the
count? Yea this new flow makes more sense to me.

>  	prefetchw(rx_buf->page);
>  
>  	if (!size)

  reply	other threads:[~2024-08-20 22:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 21:56 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-08-20 (ice) Tony Nguyen
2024-08-20 21:56 ` [PATCH net 1/4] ice: fix page reuse when PAGE_SIZE is over 8k Tony Nguyen
2024-08-20 22:10   ` Jacob Keller [this message]
2024-08-20 21:56 ` [PATCH net 2/4] ice: fix ICE_LAST_OFFSET formula Tony Nguyen
2024-08-20 22:14   ` Jacob Keller
2024-08-20 21:56 ` [PATCH net 3/4] ice: fix truesize operations for PAGE_SIZE >= 8192 Tony Nguyen
2024-08-20 22:12   ` Jacob Keller
2024-08-20 21:56 ` [PATCH net 4/4] ice: use internal pf id instead of function number Tony Nguyen
2024-08-20 22:15   ` Jacob Keller
2024-08-22  1:10 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2024-08-20 (ice) patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b795aee4-d96e-4e9b-8b07-75e42b91a0cf@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=chandanx.rout@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).