diff mbox series

net/ice: fix ieee1588fwd not show PTP timestamp

Message ID 20220120102152.281951-1-simei.su@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers show
Series net/ice: fix ieee1588fwd not show PTP timestamp | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Simei Su Jan. 20, 2022, 10:21 a.m. UTC
For received PTP packets, the flag "RTE_MBUF_F_RX_IEEE1588_TMST" has not
been set which leads to received PTP packet not timestamped by hardware
shown in testpmd/ieee1588 fwd.

Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Zhang, Qi Z Jan. 25, 2022, 12:56 a.m. UTC | #1
> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Thursday, January 20, 2022 6:22 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Wu, Wenjun1 <wenjun1.wu@intel.com>; Su, Simei
> <simei.su@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ice: fix ieee1588fwd not show PTP timestamp

Renamed to 
fix missing mbuf offload flag for Rx timestamp

> 
> For received PTP packets, the flag "RTE_MBUF_F_RX_IEEE1588_TMST" has
> not been set which leads to received PTP packet not timestamped by
> hardware shown in testpmd/ieee1588 fwd.
> 
> Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Simei Su <simei.su@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

> ---
>  drivers/net/ice/ice_rxtx.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index
> d50acf5..d7276d7 100644
> --- a/drivers/net/ice/ice_rxtx.c
> +++ b/drivers/net/ice/ice_rxtx.c
> @@ -1554,6 +1554,9 @@ ice_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile
> union ice_rx_flex_desc *rxdp)  #if (ICE_LOOK_AHEAD != 8)  #error "PMD ICE:
> ICE_LOOK_AHEAD must be 8\n"
>  #endif
> +
> +#define ICE_PTP_TS_VALID 0x1
> +
>  static inline int
>  ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)  { @@ -1634,6 +1637,10 @@
> ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
> 
> rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
>  				mb->timesync = rxq->queue_id;
>  				pkt_flags |= RTE_MBUF_F_RX_IEEE1588_PTP;
> +				if (rxdp[j].wb.time_stamp_low &
> +				    ICE_PTP_TS_VALID)
> +					pkt_flags |=
> +
> 	RTE_MBUF_F_RX_IEEE1588_TMST;
>  			}
>  #endif
>  			mb->ol_flags |= pkt_flags;
> --
> 2.9.5
diff mbox series

Patch

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index d50acf5..d7276d7 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -1554,6 +1554,9 @@  ice_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union ice_rx_flex_desc *rxdp)
 #if (ICE_LOOK_AHEAD != 8)
 #error "PMD ICE: ICE_LOOK_AHEAD must be 8\n"
 #endif
+
+#define ICE_PTP_TS_VALID 0x1
+
 static inline int
 ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
 {
@@ -1634,6 +1637,10 @@  ice_rx_scan_hw_ring(struct ice_rx_queue *rxq)
 				   rte_le_to_cpu_32(rxdp[j].wb.flex_ts.ts_high);
 				mb->timesync = rxq->queue_id;
 				pkt_flags |= RTE_MBUF_F_RX_IEEE1588_PTP;
+				if (rxdp[j].wb.time_stamp_low &
+				    ICE_PTP_TS_VALID)
+					pkt_flags |=
+						RTE_MBUF_F_RX_IEEE1588_TMST;
 			}
 #endif
 			mb->ol_flags |= pkt_flags;