]> git.droids-corp.org - dpdk.git/commitdiff
net/ice: fix mbuf offload flag for Rx timestamp
authorSimei Su <simei.su@intel.com>
Thu, 20 Jan 2022 10:21:52 +0000 (18:21 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 25 Jan 2022 00:58:27 +0000 (01:58 +0100)
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>
drivers/net/ice/ice_rxtx.c

index ba40a0dc87475e79b36c1baeb0bd513d0741f0b3..58700f1b92b3a41f22f92041fbca541287f3e13d 100644 (file)
@@ -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;