@@ -86,6 +86,14 @@ static int rx_st40p_rtp_ready(void* priv) {
8686 mbuf = st40_rx_get_mbuf (ctx -> transport , & usrptr , & len );
8787 if (!mbuf ) return - EBUSY ;
8888
89+ struct rte_mbuf * pkt = mbuf ;
90+ enum mtl_port port = mt_port_by_id (ctx -> impl , pkt -> port );
91+ uint64_t receive_timestamp = 0 ;
92+ if (port < MTL_PORT_MAX )
93+ receive_timestamp = mt_mbuf_time_stamp (ctx -> impl , pkt , port );
94+ else
95+ receive_timestamp = mtl_ptp_read_time (ctx -> impl );
96+
8997 uint32_t hdr_bytes = sizeof (struct st40_rfc8331_rtp_hdr );
9098 if (len < hdr_bytes ) {
9199 warn ("%s(%d), RTP packet too small (%u < %u)\n" , __func__ , ctx -> idx , len , hdr_bytes );
@@ -109,6 +117,7 @@ static int rx_st40p_rtp_ready(void* priv) {
109117 }
110118
111119 frame_info = & framebuff -> frame_info ;
120+ frame_info -> receive_timestamp = receive_timestamp ;
112121
113122 /* parse RTP packet and copy metadata */
114123 payload = (uint8_t * )(hdr + 1 );
@@ -314,6 +323,7 @@ static int rx_st40p_init_fbs(struct st40p_rx_ctx* ctx, struct st40p_rx_ops* ops)
314323 frame_info -> udw_buffer_fill = 0 ;
315324 frame_info -> meta_num = 0 ;
316325 frame_info -> meta = framebuff -> meta ;
326+ frame_info -> receive_timestamp = 0 ;
317327 frame_info -> priv = framebuff ;
318328
319329 dbg ("%s(%d), init fb %u\n" , __func__ , idx , i );
0 commit comments