diff mbox series

[Intel-wired-lan,iwl-net] idpf: set completion tag for "empty" bufs associated with a packet

Message ID 20241007202435.664345-1-joshua.a.hay@intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [Intel-wired-lan,iwl-net] idpf: set completion tag for "empty" bufs associated with a packet | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 2 blamed authors not CCed: anthony.l.nguyen@intel.com przemyslaw.kitszel@intel.com; 5 maintainers not CCed: anthony.l.nguyen@intel.com edumazet@google.com przemyslaw.kitszel@intel.com pabeni@redhat.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 5 this patch: 5
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 50 this patch: 50
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-10-07--21-00 (tests: 766)

Commit Message

Joshua Hay Oct. 7, 2024, 8:24 p.m. UTC
Commit d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
inadvertently removed code that was necessary for the tx buffer cleaning
routine to iterate over all buffers associated with a packet.

When a frag is too large for a single data descriptor, it will be split
across multiple data descriptors. This means the frag will span multiple
buffers in the buffer ring in order to keep the descriptor and buffer
ring indexes aligned. The buffer entries in the ring are technically
empty and no cleaning actions need to be performed. These empty buffers
can precede other frags associated with the same packet. I.e. a single
packet on the buffer ring can look like:

	buf[0]=skb0.frag0
	buf[1]=skb0.frag1
	buf[2]=empty
	buf[3]=skb0.frag2

The cleaning routine iterates through these buffers based on a matching
completion tag. If the completion tag is not set for buf2, the loop will
end prematurely. Frag2 will be left uncleaned and next_to_clean will be
left pointing to the end of packet, which will break the cleaning logic
for subsequent cleans. This consequently leads to tx timeouts.

Assign the empty bufs the same completion tag for the packet to ensure
the cleaning routine iterates over all of the buffers associated with
the packet.

Fixes: d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Madhu chittim <madhu.chittim@intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Horman Oct. 17, 2024, 9:04 a.m. UTC | #1
On Mon, Oct 07, 2024 at 01:24:35PM -0700, Joshua Hay wrote:
> Commit d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
> inadvertently removed code that was necessary for the tx buffer cleaning
> routine to iterate over all buffers associated with a packet.
> 
> When a frag is too large for a single data descriptor, it will be split
> across multiple data descriptors. This means the frag will span multiple
> buffers in the buffer ring in order to keep the descriptor and buffer
> ring indexes aligned. The buffer entries in the ring are technically
> empty and no cleaning actions need to be performed. These empty buffers
> can precede other frags associated with the same packet. I.e. a single
> packet on the buffer ring can look like:
> 
> 	buf[0]=skb0.frag0
> 	buf[1]=skb0.frag1
> 	buf[2]=empty
> 	buf[3]=skb0.frag2
> 
> The cleaning routine iterates through these buffers based on a matching
> completion tag. If the completion tag is not set for buf2, the loop will
> end prematurely. Frag2 will be left uncleaned and next_to_clean will be
> left pointing to the end of packet, which will break the cleaning logic
> for subsequent cleans. This consequently leads to tx timeouts.
> 
> Assign the empty bufs the same completion tag for the packet to ensure
> the cleaning routine iterates over all of the buffers associated with
> the packet.
> 
> Fixes: d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
> Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
> Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Reviewed-by: Madhu chittim <madhu.chittim@intel.com>

Thanks for the detailed description.

Reviewed-by: Simon Horman <horms@kernel.org>
Singh, Krishneil K Nov. 15, 2024, 12:59 a.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Simon Horman
> Sent: Thursday, October 17, 2024 2:04 AM
> To: Hay, Joshua A <joshua.a.hay@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; Lobakin, Aleksander
> <aleksander.lobakin@intel.com>; Chittim, Madhu
> <madhu.chittim@intel.com>; netdev@vger.kernel.org
> Subject: Re: [Intel-wired-lan] [PATCH iwl-net] idpf: set completion tag for
> "empty" bufs associated with a packet
> 
> On Mon, Oct 07, 2024 at 01:24:35PM -0700, Joshua Hay wrote:
> > Commit d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
> > inadvertently removed code that was necessary for the tx buffer cleaning
> > routine to iterate over all buffers associated with a packet.
> >
> > When a frag is too large for a single data descriptor, it will be split
> > across multiple data descriptors. This means the frag will span multiple
> > buffers in the buffer ring in order to keep the descriptor and buffer
> > ring indexes aligned. The buffer entries in the ring are technically
> > empty and no cleaning actions need to be performed. These empty buffers
> > can precede other frags associated with the same packet. I.e. a single
> > packet on the buffer ring can look like:
> >
> > 	buf[0]=skb0.frag0
> > 	buf[1]=skb0.frag1
> > 	buf[2]=empty
> > 	buf[3]=skb0.frag2
> >
> > The cleaning routine iterates through these buffers based on a matching
> > completion tag. If the completion tag is not set for buf2, the loop will
> > end prematurely. Frag2 will be left uncleaned and next_to_clean will be
> > left pointing to the end of packet, which will break the cleaning logic
> > for subsequent cleans. This consequently leads to tx timeouts.
> >
> > Assign the empty bufs the same completion tag for the packet to ensure
> > the cleaning routine iterates over all of the buffers associated with
> > the packet.
> >
> > Fixes: d9028db618a6 ("idpf: convert to libeth Tx buffer completion")
> > Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
> > Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> > Reviewed-by: Madhu chittim <madhu.chittim@intel.com>
> 
> Thanks for the detailed description.
> 
> Reviewed-by: Simon Horman <horms@kernel.org>

Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index d4e6f0e10487..60d15b3e6e2f 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -2448,6 +2448,7 @@  static void idpf_tx_splitq_map(struct idpf_tx_queue *tx_q,
 			 * rest of the packet.
 			 */
 			tx_buf->type = LIBETH_SQE_EMPTY;
+			idpf_tx_buf_compl_tag(tx_buf) = params->compl_tag;
 
 			/* Adjust the DMA offset and the remaining size of the
 			 * fragment.  On the first iteration of this loop,