BPF List
 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>,
	<magnus.karlsson@intel.com>, <ast@kernel.org>,
	<daniel@iogearbox.net>, <hawk@kernel.org>,
	<john.fastabend@gmail.com>, <bpf@vger.kernel.org>,
	"Luiz Capitulino" <luizcap@redhat.com>,
	Chandan Kumar Rout <chandanx.rout@intel.com>
Subject: Re: [PATCH net 3/4] ice: fix truesize operations for PAGE_SIZE >= 8192
Date: Tue, 20 Aug 2024 15:12:20 -0700	[thread overview]
Message-ID: <91b5e7da-ec4e-40f8-908f-faf7082b2f63@intel.com> (raw)
In-Reply-To: <20240820215620.1245310-4-anthony.l.nguyen@intel.com>



On 8/20/2024 2:56 PM, Tony Nguyen wrote:
> From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> 
> When working on multi-buffer packet on arch that has PAGE_SIZE >= 8192,
> truesize is calculated and stored in xdp_buff::frame_sz per each
> processed Rx buffer. This means that frame_sz will contain the truesize
> based on last received buffer, but commit 1dc1a7e7f410 ("ice:
> Centrallize Rx buffer recycling") assumed this value will be constant
> for each buffer, which breaks the page recycling scheme and mess up the
> way we update the page::page_offset.
> 
> To fix this, let us work on constant truesize when PAGE_SIZE >= 8192
> instead of basing this on size of a packet read from Rx descriptor. This
> way we can simplify the code and avoid calculating truesize per each
> received frame and on top of that when using
> xdp_update_skb_shared_info(), current formula for truesize update will
> be valid.
> 
> This means ice_rx_frame_truesize() can be removed altogether.
> Furthermore, first call to it within ice_clean_rx_irq() for 4k PAGE_SIZE
> was redundant as xdp_buff::frame_sz is initialized via xdp_init_buff()
> in ice_vsi_cfg_rxq(). This should have been removed at the point where
> xdp_buff struct started to be a member of ice_rx_ring and it was no
> longer a stack based variable.
> 
> There are two fixes tags as my understanding is that the first one
> exposed us to broken truesize and page_offset handling and then second
> introduced broken skb_shared_info update in ice_{construct,build}_skb().
> 
> Reported-and-tested-by: Luiz Capitulino <luizcap@redhat.com>
> Closes: https://lore.kernel.org/netdev/8f9e2a5c-fd30-4206-9311-946a06d031bb@redhat.com/
> Fixes: 1dc1a7e7f410 ("ice: Centrallize Rx buffer recycling")
> Fixes: 2fba7dc5157b ("ice: Add support for XDP multi-buffer on Rx side")
> 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>
> ---

Much simpler too!

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

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240820215620.1245310-1-anthony.l.nguyen@intel.com>
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 [this message]

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=91b5e7da-ec4e-40f8-908f-faf7082b2f63@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chandanx.rout@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=luizcap@redhat.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@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