patch 'net/igc: fix Rx buffers when timestamping enabled' has been queued to stable release 23.11.3
Xueming Li
xuemingl at nvidia.com
Sat Dec 7 09:00:07 CET 2024
Hi,
FYI, your patch has been queued to stable release 23.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/10/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=57f022e772fe4d6249a18b05d6bf2810c1f5a410
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 57f022e772fe4d6249a18b05d6bf2810c1f5a410 Mon Sep 17 00:00:00 2001
From: Martin Weiser <martin.weiser at allegro-packets.com>
Date: Fri, 1 Nov 2024 14:57:26 +0100
Subject: [PATCH] net/igc: fix Rx buffers when timestamping enabled
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 4e08d335554ec6d975ded8a7badf81e0edb39234 ]
When hardware-timestamping is enabled (RTE_ETH_RX_OFFLOAD_TIMESTAMP),
the length of the prepended hardware timestamp was not subtracted from
the data length so that received packets were 16 bytes longer than
expected.
In scatter-gather mode only the first mbuf has a timestamp but the
data offset of the follow-up mbufs was not adjusted accordingly.
This caused 16 bytes of packet data to be missing between
the segments.
Fixes: 4f6fbbf6f17d ("net/igc: support IEEE 1588 PTP")
Signed-off-by: Martin Weiser <martin.weiser at allegro-packets.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/igc/igc_txrx.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index 5c60e3e997..a54c4681f7 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -347,6 +347,13 @@ igc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rxm->data_off = RTE_PKTMBUF_HEADROOM;
data_len = rte_le_to_cpu_16(rxd.wb.upper.length) - rxq->crc_len;
+ /*
+ * When the RTE_ETH_RX_OFFLOAD_TIMESTAMP offload is enabled the
+ * length in the descriptor still accounts for the timestamp so
+ * it must be subtracted.
+ */
+ if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)
+ data_len -= IGC_TS_HDR_LEN;
rxm->data_len = data_len;
rxm->pkt_len = data_len;
rxm->nb_segs = 1;
@@ -509,6 +516,24 @@ next_desc:
*/
rxm->data_off = RTE_PKTMBUF_HEADROOM;
data_len = rte_le_to_cpu_16(rxd.wb.upper.length);
+ if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
+ /*
+ * When the RTE_ETH_RX_OFFLOAD_TIMESTAMP offload is enabled
+ * the pkt_addr of all software ring entries is moved forward
+ * by IGC_TS_HDR_LEN (see igc_alloc_rx_queue_mbufs()) so that
+ * when the hardware writes the packet with a prepended
+ * timestamp the actual packet data still starts at the
+ * normal data offset. The length in the descriptor still
+ * accounts for the timestamp so it needs to be subtracted.
+ * Follow-up mbufs do not have the timestamp so the data
+ * offset must be adjusted to point to the start of the packet
+ * data.
+ */
+ if (first_seg == NULL)
+ data_len -= IGC_TS_HDR_LEN;
+ else
+ rxm->data_off -= IGC_TS_HDR_LEN;
+ }
rxm->data_len = data_len;
/*
@@ -557,6 +582,7 @@ next_desc:
last_seg->data_len = last_seg->data_len -
(RTE_ETHER_CRC_LEN - data_len);
last_seg->next = NULL;
+ rxm = last_seg;
} else {
rxm->data_len = (uint16_t)
(data_len - RTE_ETHER_CRC_LEN);
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-12-06 23:26:45.729222608 +0800
+++ 0049-net-igc-fix-Rx-buffers-when-timestamping-enabled.patch 2024-12-06 23:26:43.953044828 +0800
@@ -1 +1 @@
-From 4e08d335554ec6d975ded8a7badf81e0edb39234 Mon Sep 17 00:00:00 2001
+From 57f022e772fe4d6249a18b05d6bf2810c1f5a410 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4e08d335554ec6d975ded8a7badf81e0edb39234 ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index d0cee1b016..fabab5b1a3 100644
+index 5c60e3e997..a54c4681f7 100644
More information about the stable
mailing list