patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix jumbo packet descriptors for NFDk
@ 2023-10-10  6:06 Chaoyong He
  2023-10-16 13:25 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-10-10  6:06 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, chaoyong.he, stable

From: Long Wu <long.wu@corigine.com>

When sending a jumbo packet on NFDk the packet must be split between
multiple descriptors. The first descriptor contains the packet header
and is limited to NFDK_DESC_TX_DMA_LEN_HEAD bytes. If the packet is
large, one or more payload descriptors, without a packet header, and
a size limit of NFDK_DESC_TX_DMA_LEN bytes are appended.

When adjusting the coding style for the for NFDk datapath an error was
made and the total packet size was modified when creating the first
descriptor. This resulted in no payload descriptors being created and
the jumbo packets where truncated.

Fix this by not modifying the total packet length when constructing the
first descriptor, allowing one or more payload descriptors to be
created.

Fixes: d7f6d9b21ffa ("net/nfp: adjust coding style for NFDk")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index d4bd5edb0a..3f8230f89c 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -354,8 +354,10 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
 		 * than packet head len.
 		 */
 		if (dma_len > NFDK_DESC_TX_DMA_LEN_HEAD)
-			dma_len = NFDK_DESC_TX_DMA_LEN_HEAD;
-		dlen_type = dma_len | (NFDK_DESC_TX_TYPE_HEAD & (type << 12));
+			tmp_dlen = NFDK_DESC_TX_DMA_LEN_HEAD;
+		else
+			tmp_dlen = dma_len;
+		dlen_type = tmp_dlen | (NFDK_DESC_TX_TYPE_HEAD & (type << 12));
 		ktxds->dma_len_type = rte_cpu_to_le_16(dlen_type);
 		dma_addr = rte_mbuf_data_iova(pkt);
 		ktxds->dma_addr_hi = rte_cpu_to_le_16(dma_addr >> 32);
@@ -366,7 +368,6 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
 		 * Preserve the original dlen_type, this way below the EOP logic
 		 * can use dlen_type.
 		 */
-		tmp_dlen = dlen_type & NFDK_DESC_TX_DMA_LEN_HEAD;
 		dma_len -= tmp_dlen;
 		dma_addr += tmp_dlen + 1;
 
-- 
2.39.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/nfp: fix jumbo packet descriptors for NFDk
  2023-10-10  6:06 [PATCH] net/nfp: fix jumbo packet descriptors for NFDk Chaoyong He
@ 2023-10-16 13:25 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-10-16 13:25 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, Long Wu, stable

On 10/10/2023 7:06 AM, Chaoyong He wrote:
> From: Long Wu <long.wu@corigine.com>
> 
> When sending a jumbo packet on NFDk the packet must be split between
> multiple descriptors. The first descriptor contains the packet header
> and is limited to NFDK_DESC_TX_DMA_LEN_HEAD bytes. If the packet is
> large, one or more payload descriptors, without a packet header, and
> a size limit of NFDK_DESC_TX_DMA_LEN bytes are appended.
> 
> When adjusting the coding style for the for NFDk datapath an error was
> made and the total packet size was modified when creating the first
> descriptor. This resulted in no payload descriptors being created and
> the jumbo packets where truncated.
> 
> Fix this by not modifying the total packet length when constructing the
> first descriptor, allowing one or more payload descriptors to be
> created.
> 
> Fixes: d7f6d9b21ffa ("net/nfp: adjust coding style for NFDk")
> Cc: chaoyong.he@corigine.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> 

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-16 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10  6:06 [PATCH] net/nfp: fix jumbo packet descriptors for NFDk Chaoyong He
2023-10-16 13:25 ` Ferruh Yigit

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).