Skip to content

Commit f59d70d

Browse files
committed
Merge branch 'main' into pstaszczuk/media-files-ramdisk
2 parents 1202f41 + f2e7955 commit f59d70d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1551
-481
lines changed

.github/workflows/nightly-tests.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: nightly-tests-bare-metal
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *' # Every day at midnight UTC
5+
env:
6+
BUILD_TYPE: 'Release'
7+
DPDK_VERSION: '25.03'
8+
DPDK_REBUILD: 'false'
9+
permissions:
10+
contents: read
11+
jobs:
12+
validation-build-mtl:
13+
runs-on: [Linux, self-hosted, DPDK]
14+
timeout-minutes: 60
15+
outputs:
16+
pipenv-activate: ${{ steps.pipenv-install.outputs.VIRTUAL_ENV }}
17+
steps:
18+
- name: 'preparation: Harden Runner'
19+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
20+
with:
21+
egress-policy: audit
22+
- name: 'preparation: Restore valid repository owner and print env'
23+
if: always()
24+
run: |
25+
sudo chown -R "${USER}" "$(pwd)" || true
26+
env | grep TEST_ || true
27+
- name: 'preparation: Checkout MTL'
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
ref: '${{ github.ref }}'
31+
- name: 'preparation: Checkout DPDK'
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
if: env.DPDK_REBUILD == 'true'
34+
with:
35+
repository: 'DPDK/dpdk'
36+
ref: 'v${{ env.DPDK_VERSION }}'
37+
path: 'dpdk'
38+
- name: 'preparation: Checkout openh264'
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
repository: 'cisco/openh264'
42+
ref: 'openh264v2.4.0'
43+
path: 'openh264'
44+
- name: 'preparation: Checkout FFmpeg'
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
with:
47+
repository: 'FFmpeg/FFmpeg'
48+
ref: 'release/7.0'
49+
path: 'ffmpeg'
50+
- name: 'configuration: Install the build dependency'
51+
run: |
52+
sudo apt update
53+
sudo apt-get remove -y pipenv || true
54+
sudo apt-get install -y \
55+
git gcc meson tar zip \
56+
pkg-config \
57+
python3 \
58+
python3-pyelftools \
59+
python3-virtualenv \
60+
python3-pip \
61+
libnuma-dev \
62+
libjson-c-dev \
63+
libpcap-dev \
64+
libgtest-dev \
65+
libsdl2-dev \
66+
libsdl2-ttf-dev \
67+
libssl-dev \
68+
systemtap-sdt-dev \
69+
libbpf-dev \
70+
libelf1 \
71+
gstreamer1.0-plugins-base \
72+
gstreamer1.0-plugins-good \
73+
gstreamer1.0-tools \
74+
gstreamer1.0-libav \
75+
libgstreamer1.0-dev \
76+
libgstreamer-plugins-base1.0-dev
77+
- name: 'configuration: Apply dpdk patches'
78+
if: env.DPDK_REBUILD == 'true'
79+
run: |
80+
patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
81+
- name: 'installation: Build dpdk'
82+
working-directory: dpdk
83+
if: env.DPDK_REBUILD == 'true'
84+
run: |
85+
meson build
86+
ninja -C build
87+
sudo ninja -C build install
88+
- name: 'installation: Build mtl'
89+
run: |
90+
./build.sh
91+
sudo ldconfig
92+
- name: 'installation: Build openh264'
93+
working-directory: openh264
94+
run: |
95+
make -j "$(nproc)"
96+
sudo make install
97+
sudo ldconfig
98+
- name: 'installation: Build FFmpeg'
99+
working-directory: ffmpeg
100+
run: |
101+
git am ../ecosystem/ffmpeg_plugin/7.0/*.patch
102+
cp ../ecosystem/ffmpeg_plugin/mtl_*.c -rf libavdevice/
103+
cp ../ecosystem/ffmpeg_plugin/mtl_*.h -rf libavdevice/
104+
./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-libopenh264 --enable-encoder=libopenh264 --enable-mtl
105+
make -j "$(nproc)"
106+
sudo make install
107+
sudo ldconfig
108+
- name: 'installation: Build GStreamer'
109+
working-directory: ecosystem/gstreamer_plugin
110+
run: |
111+
./build.sh
112+
- name: 'installation: Install pipenv environment'
113+
working-directory: tests/validation
114+
id: pipenv-install
115+
run: |
116+
python3 -m venv venv
117+
source venv/bin/activate
118+
pip install -r requirements.txt
119+
echo "VIRTUAL_ENV=$PWD/venv/bin/activate" >> "$GITHUB_ENV"
120+
validation-run-tests:
121+
needs: [validation-build-mtl]
122+
runs-on: [Linux, self-hosted, DPDK]
123+
timeout-minutes: 720
124+
env:
125+
PYTEST_RETRIES: '3'
126+
steps:
127+
- name: 'preparation: Harden Runner'
128+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
129+
with:
130+
egress-policy: audit
131+
- name: 'preparation: Evaluate chosen validation-test-port-p and validation-test-port-r'
132+
run: |
133+
eval "export TEST_PORT_P=TEST_VF_PORT_P_0"
134+
eval "export TEST_PORT_R=TEST_VF_PORT_P_1"
135+
echo "TEST_PORT_P=${TEST_PORT_P}" >> "$GITHUB_ENV"
136+
echo "TEST_PORT_R=${TEST_PORT_R}" >> "$GITHUB_ENV"
137+
echo "TEST_PORT_P=${TEST_PORT_P}"
138+
echo "TEST_PORT_R=${TEST_PORT_R}"
139+
- name: 'preparation: Kill MtlManager and pytest routines'
140+
run: |
141+
sudo killall -SIGINT pipenv || true
142+
sudo killall -SIGINT pytest || true
143+
sudo killall -SIGINT MtlManager || true
144+
- name: 'preparation: Create VFs'
145+
run: |
146+
sudo rmmod irdma || true
147+
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
148+
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true
149+
- name: 'preparation: Start MtlManager at background'
150+
run: |
151+
sudo MtlManager &
152+
- name: 'execution: Run nightly-bare-metal tests in virtual environment'
153+
run: |
154+
sudo tests/validation/venv/bin/python3 -m pytest --topology_config=tests/validation/configs/topology_config.yaml --test_config=tests/validation/configs/test_config.yaml -m nightly --template=html/index.html --report=report.html
155+
- name: "upload report"
156+
id: upload-report
157+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
158+
with:
159+
name: nightly-tests-report
160+
path: |
161+
report.html

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.

0 commit comments

Comments
 (0)