Skip to content

Commit 274025a

Browse files
Add: Unified stats retrival api (#1235)
Add unified api to retrive the sessions stats, for both the legacy and pipeline sessions.
1 parent 9168009 commit 274025a

31 files changed

+1351
-476
lines changed

include/experimental/st40_pipeline_api.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,34 @@ struct st40p_tx_ops {
135135
uint8_t tx_dst_mac[MTL_SESSION_PORT_MAX][MTL_MAC_ADDR_LEN];
136136
};
137137

138+
/**
139+
* Retrieve the general statistics(I/O) for one rx st2110-40(pipeline) session.
140+
*
141+
* @param handle
142+
* The handle to the rx st2110-40(pipeline) session.
143+
* @param port
144+
* The port index.
145+
* @param stats
146+
* A pointer to stats structure.
147+
* @return
148+
* - >=0 succ.
149+
* - <0: Error code.
150+
*/
151+
int st40p_tx_get_session_stats(st40p_tx_handle handle, struct st40_tx_user_stats* stats);
152+
153+
/**
154+
* Reset the general statistics(I/O) for one rx st2110-40(pipeline) session.
155+
*
156+
* @param handle
157+
* The handle to the rx st2110-40(pipeline) session.
158+
* @param port
159+
* The port index.
160+
* @return
161+
* - >=0 succ.
162+
* - <0: Error code.
163+
*/
164+
int st40p_tx_reset_session_stats(st40p_tx_handle handle);
165+
138166
/** Create one tx st2110-40 pipeline session */
139167
st40p_tx_handle st40p_tx_create(mtl_handle mt, struct st40p_tx_ops* ops);
140168

include/st20_api.h

Lines changed: 66 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,31 +1679,67 @@ struct st22_rx_ops {
16791679
};
16801680

16811681
/**
1682-
* A structure used to retrieve general statistics(I/O) for a st20 tx port.
1683-
*/
1684-
struct st20_tx_port_status {
1685-
/** Total number of transmitted packets. */
1686-
uint64_t packets;
1687-
/** Total number of transmitted bytes. */
1688-
uint64_t bytes;
1689-
/** Total number of build packets. */
1690-
uint64_t build;
1691-
/** Total number of transmitted frames. */
1692-
uint64_t frames;
1682+
* A structure used to retrieve general statistics(I/O) for a st20 tx session.
1683+
*/
1684+
struct st20_tx_user_stats {
1685+
struct st_tx_user_stats common;
1686+
uint64_t stat_pkts_dummy;
1687+
uint64_t stat_epoch_troffset_mismatch;
1688+
uint64_t stat_trans_troffset_mismatch;
1689+
uint64_t stat_trans_recalculate_warmup;
1690+
uint64_t stat_user_busy;
1691+
uint64_t stat_lines_not_ready;
1692+
uint64_t stat_vsync_mismatch;
1693+
uint64_t stat_pkts_chain_realloc_fail;
1694+
uint64_t stat_user_meta_cnt;
1695+
uint64_t stat_user_meta_pkt_cnt;
1696+
uint64_t stat_recoverable_error;
1697+
uint64_t stat_unrecoverable_error;
1698+
uint64_t stat_interlace_first_field;
1699+
uint64_t stat_interlace_second_field;
16931700
};
16941701

16951702
/**
1696-
* A structure used to retrieve general statistics(I/O) for a st20 rx port.
1697-
*/
1698-
struct st20_rx_port_status {
1699-
/** Total number of received packets. */
1700-
uint64_t packets;
1701-
/** Total number of received bytes. */
1702-
uint64_t bytes;
1703-
/** Total number of received frames. */
1704-
uint64_t frames;
1705-
/** Total number of received packets which are not valid. */
1706-
uint64_t err_packets;
1703+
* A structure used to retrieve general statistics(I/O) for a st20 rx session.
1704+
*/
1705+
struct st20_rx_user_stats {
1706+
struct st_rx_user_stats common;
1707+
uint64_t stat_bytes_received;
1708+
uint64_t stat_slices_received;
1709+
uint64_t stat_pkts_idx_dropped;
1710+
uint64_t stat_pkts_offset_dropped;
1711+
uint64_t stat_frames_dropped;
1712+
uint64_t stat_pkts_idx_oo_bitmap;
1713+
uint64_t stat_frames_pks_missed;
1714+
uint64_t stat_pkts_rtp_ring_full;
1715+
uint64_t stat_pkts_no_slot;
1716+
uint64_t stat_pkts_redundant_dropped;
1717+
uint64_t stat_pkts_wrong_interlace_dropped;
1718+
uint64_t stat_pkts_wrong_len_dropped;
1719+
uint64_t stat_pkts_enqueue_fallback;
1720+
uint64_t stat_pkts_dma;
1721+
uint64_t stat_pkts_slice_fail;
1722+
uint64_t stat_pkts_slice_merged;
1723+
uint64_t stat_pkts_multi_segments_received;
1724+
uint64_t stat_pkts_not_bpm;
1725+
uint64_t stat_pkts_wrong_payload_hdr_split;
1726+
uint64_t stat_mismatch_hdr_split_frame;
1727+
uint64_t stat_pkts_copy_hdr_split;
1728+
uint64_t stat_vsync_mismatch;
1729+
uint64_t stat_slot_get_frame_fail;
1730+
uint64_t stat_slot_query_ext_fail;
1731+
uint64_t stat_pkts_simulate_loss;
1732+
uint64_t stat_pkts_user_meta;
1733+
uint64_t stat_pkts_user_meta_err;
1734+
uint64_t stat_pkts_retransmit;
1735+
uint64_t stat_interlace_first_field;
1736+
uint64_t stat_interlace_second_field;
1737+
uint64_t stat_st22_boxes;
1738+
uint64_t stat_burst_pkts_max;
1739+
uint64_t stat_burst_succ_cnt;
1740+
uint64_t stat_burst_pkts_sum;
1741+
uint64_t incomplete_frames_cnt;
1742+
uint64_t stat_pkts_wrong_kmod_dropped;
17071743
};
17081744

17091745
/**
@@ -1837,7 +1873,7 @@ int st20_tx_put_mbuf(st20_tx_handle handle, void* mbuf, uint16_t len);
18371873
int st20_tx_get_sch_idx(st20_tx_handle handle);
18381874

18391875
/**
1840-
* Retrieve the general statistics(I/O) for one tx st2110-20(video) session port.
1876+
* Retrieve the general statistics(I/O) for one tx st2110-20(video) session.
18411877
*
18421878
* @param handle
18431879
* The handle to the tx st2110-20(video) session.
@@ -1849,11 +1885,10 @@ int st20_tx_get_sch_idx(st20_tx_handle handle);
18491885
* - >=0 succ.
18501886
* - <0: Error code.
18511887
*/
1852-
int st20_tx_get_port_stats(st20_tx_handle handle, enum mtl_session_port port,
1853-
struct st20_tx_port_status* stats);
1888+
int st20_tx_get_session_stats(st20_tx_handle handle, struct st20_tx_user_stats* stats);
18541889

18551890
/**
1856-
* Reset the general statistics(I/O) for one tx st2110-20(video) session port.
1891+
* Reset the general statistics(I/O) for one tx st2110-20(video) session.
18571892
*
18581893
* @param handle
18591894
* The handle to the tx st2110-20(video) session.
@@ -1863,7 +1898,7 @@ int st20_tx_get_port_stats(st20_tx_handle handle, enum mtl_session_port port,
18631898
* - >=0 succ.
18641899
* - <0: Error code.
18651900
*/
1866-
int st20_tx_reset_port_stats(st20_tx_handle handle, enum mtl_session_port port);
1901+
int st20_tx_reset_session_stats(st20_tx_handle handle);
18671902

18681903
/**
18691904
* Retrieve the pixel group info from st2110-20(video) format.
@@ -2187,7 +2222,7 @@ bool st20_rx_dma_enabled(st20_rx_handle handle);
21872222
int st20_rx_timing_parser_critical(st20_rx_handle handle, struct st20_rx_tp_pass* pass);
21882223

21892224
/**
2190-
* Retrieve the general statistics(I/O) for one rx st2110-20(video) session port.
2225+
* Retrieve the general statistics(I/O) for one rx st2110-20(video) session.
21912226
*
21922227
* @param handle
21932228
* The handle to the rx st2110-20(video) session.
@@ -2199,11 +2234,10 @@ int st20_rx_timing_parser_critical(st20_rx_handle handle, struct st20_rx_tp_pass
21992234
* - >=0 succ.
22002235
* - <0: Error code.
22012236
*/
2202-
int st20_rx_get_port_stats(st20_rx_handle handle, enum mtl_session_port port,
2203-
struct st20_rx_port_status* stats);
2237+
int st20_rx_get_session_stats(st20_rx_handle handle, struct st20_rx_user_stats* stats);
22042238

22052239
/**
2206-
* Reset the general statistics(I/O) for one rx st2110-20(video) session port.
2240+
* Reset the general statistics(I/O) for one rx st2110-20(video) session.
22072241
*
22082242
* @param handle
22092243
* The handle to the rx st2110-20(video) session.
@@ -2213,7 +2247,7 @@ int st20_rx_get_port_stats(st20_rx_handle handle, enum mtl_session_port port,
22132247
* - >=0 succ.
22142248
* - <0: Error code.
22152249
*/
2216-
int st20_rx_reset_port_stats(st20_rx_handle handle, enum mtl_session_port port);
2250+
int st20_rx_reset_session_stats(st20_rx_handle handle);
22172251

22182252
/**
22192253
* Create one rx st2110-22(compressed video) session.

include/st30_api.h

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,90 @@ struct st30_rx_ops {
528528
uint16_t sample_num __mtl_deprecated_msg("Not use anymore, plan to remove");
529529
};
530530

531+
/**
532+
* A structure used to retrieve general statistics(I/O) for a st30 tx session.
533+
*/
534+
struct st30_tx_user_stats {
535+
struct st_tx_user_stats common;
536+
uint64_t stat_epoch_mismatch;
537+
uint64_t stat_epoch_late;
538+
uint64_t stat_recoverable_error;
539+
uint64_t stat_unrecoverable_error;
540+
uint64_t stat_pkts_burst;
541+
uint64_t stat_pad_pkts_burst;
542+
uint64_t stat_warmup_pkts_burst;
543+
uint64_t stat_mismatch_sync_point;
544+
uint64_t stat_recalculate_warmup;
545+
uint64_t stat_hit_backup_cp;
546+
};
547+
548+
/**
549+
* A structure used to retrieve general statistics(I/O) for a st30 rx session.
550+
*/
551+
struct st30_rx_user_stats {
552+
struct st_rx_user_stats common;
553+
uint64_t stat_pkts_redundant;
554+
uint64_t stat_pkts_dropped;
555+
uint64_t stat_pkts_len_mismatch_dropped;
556+
uint64_t stat_slot_get_frame_fail;
557+
};
558+
559+
/**
560+
* Retrieve the general statistics(I/O) for one tx st2110-30(audio) session.
561+
*
562+
* @param handle
563+
* The handle to the tx st2110-30(audio) session.
564+
* @param port
565+
* The port index.
566+
* @param stats
567+
* A pointer to stats structure.
568+
* @return
569+
* - >=0 succ.
570+
* - <0: Error code.
571+
*/
572+
int st30_tx_get_session_stats(st30_tx_handle handle, struct st30_tx_user_stats* stats);
573+
574+
/**
575+
* Reset the general statistics(I/O) for one tx st2110-30(audio) session.
576+
*
577+
* @param handle
578+
* The handle to the tx st2110-30(audio) session.
579+
* @param port
580+
* The port index.
581+
* @return
582+
* - >=0 succ.
583+
* - <0: Error code.
584+
*/
585+
int st30_tx_reset_session_stats(st30_tx_handle handle);
586+
587+
/**
588+
* Retrieve the general statistics(I/O) for one rx st2110-30(audio) session.
589+
*
590+
* @param handle
591+
* The handle to the rx st2110-30(audio) session.
592+
* @param port
593+
* The port index.
594+
* @param stats
595+
* A pointer to stats structure.
596+
* @return
597+
* - >=0 succ.
598+
* - <0: Error code.
599+
*/
600+
int st30_rx_get_session_stats(st30_rx_handle handle, struct st30_rx_user_stats* stats);
601+
602+
/**
603+
* Reset the general statistics(I/O) for one rx st2110-30(audio) session.
604+
*
605+
* @param handle
606+
* The handle to the rx st2110-30(audio) session.
607+
* @param port
608+
* The port index.
609+
* @return
610+
* - >=0 succ.
611+
* - <0: Error code.
612+
*/
613+
int st30_rx_reset_session_stats(st30_rx_handle handle);
614+
531615
/**
532616
* Create one tx st2110-30(audio) session.
533617
*

include/st30_pipeline_api.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,34 @@ struct st30p_tx_ops {
158158
int socket_id;
159159
};
160160

161+
/**
162+
* Retrieve the general statistics(I/O) for one rx st2110-30(pipeline) session.
163+
*
164+
* @param handle
165+
* The handle to the rx st2110-30(pipeline) session.
166+
* @param port
167+
* The port index.
168+
* @param stats
169+
* A pointer to stats structure.
170+
* @return
171+
* - >=0 succ.
172+
* - <0: Error code.
173+
*/
174+
int st30p_tx_get_session_stats(st30p_tx_handle handle, struct st30_tx_user_stats* stats);
175+
176+
/**
177+
* Reset the general statistics(I/O) for one rx st2110-30(pipeline) session.
178+
*
179+
* @param handle
180+
* The handle to the rx st2110-30(pipeline) session.
181+
* @param port
182+
* The port index.
183+
* @return
184+
* - >=0 succ.
185+
* - <0: Error code.
186+
*/
187+
int st30p_tx_reset_session_stats(st30p_tx_handle handle);
188+
161189
/**
162190
* Get one tx frame from the tx st2110-30 pipeline session.
163191
* Call st30p_tx_put_frame to return the frame to session.
@@ -235,6 +263,34 @@ struct st30p_rx_ops {
235263
int socket_id;
236264
};
237265

266+
/**
267+
* Retrieve the general statistics(I/O) for one rx st2110-30(pipeline) session.
268+
*
269+
* @param handle
270+
* The handle to the rx st2110-30(pipeline) session.
271+
* @param port
272+
* The port index.
273+
* @param stats
274+
* A pointer to stats structure.
275+
* @return
276+
* - >=0 succ.
277+
* - <0: Error code.
278+
*/
279+
int st30p_rx_get_session_stats(st30p_rx_handle handle, struct st30_rx_user_stats* stats);
280+
281+
/**
282+
* Reset the general statistics(I/O) for one rx st2110-30(pipeline) session.
283+
*
284+
* @param handle
285+
* The handle to the rx st2110-30(pipeline) session.
286+
* @param port
287+
* The port index.
288+
* @return
289+
* - >=0 succ.
290+
* - <0: Error code.
291+
*/
292+
int st30p_rx_reset_session_stats(st30p_rx_handle handle);
293+
238294
/**
239295
* Get one rx frame from the rx st2110-30 pipeline session.
240296
* Call st30p_rx_put_frame to return the frame to session.

0 commit comments

Comments
 (0)