Skip to content

Commit d10b5c9

Browse files
committed
Update to latest v22.09
Signed-off-by: Du, Frank <[email protected]>
1 parent f457fdd commit d10b5c9

27 files changed

+138
-61
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* License: update to BSD-3
55
* dpdk: update DPDK to v22.07
66
* ice: update driver to 1.9.11
7+
* vf: add SRIOV based virtual NIC support, see vf.md.
8+
* vm: add SRIOV+KVM based virtulization support, see vm.md.
79
* CSC: Color format SIMD convert API from CPU little endian format to RFC4175 YUV422 10bit BE, see st_convert_api.h.
810
* AF_XDP: introduce AF_XDP PMD experimental support, see af_xdp.md.
911
* pipeline: introduce pipeline friendly API for both st20 tx and rx, see st_pipeline_api.h for detail.
10-
* tasklet: support unregister now.
1112
* iova: add map/unmap support for IO device, see st_dma_map and st_dma_unmap.
1213
* Header split: introduce hdr split offload experimental support, see header_split.md.
1314
* Ext frame: external frame mode to support user allocated memory, see st20_ext_frame and ST20_TX_FLAG_EXT_FRAME/ST20P_TX_FLAG_EXT_FRAME.
@@ -17,7 +18,6 @@
1718
* API: change st20_frame_meta to st20_rx_frame_meta, also add st20_tx_frame_meta for get_next_frame of st20 tx.
1819
* API: change st_frame_meta to st_frame, also change the callback arg of st20p.notify_frame_done from void* to struct st_frame*.
1920
* plugin: add kahawai as a plugin to OBS, only rx path now.
20-
* tasklet: add thread and sleep option for core usage, see ST_FLAG_TASKLET_THREAD and ST_FLAG_TASKLET_SLEEP.
2121
* fps: add 120(119.88) fps support, see ST_FPS_P119_88.
2222

2323
## Change log for 22.06:

app/sample/rx_st20_pipeline_sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ int main() {
359359
for (int i = 0; i < session_num; i++) {
360360
if (app[i]) {
361361
if (app[i]->handle) st20p_rx_free(app[i]->handle);
362-
if (app[i]->dma_mem) st_dma_mem_free(dev_handle, app[i]->dma_mem);
362+
if (dev_handle && app[i]->dma_mem) st_dma_mem_free(dev_handle, app[i]->dma_mem);
363363
if (app[i]->ext_frames) free(app[i]->ext_frames);
364364
free(app[i]);
365365
}

app/src/parse_json.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,11 @@ int st_app_parse_json(st_json_context_t* ctx, const char* filename) {
13831383
int num_interfaces = json_object_array_length(interfaces_array);
13841384
ctx->interfaces =
13851385
(st_json_interface_t*)st_app_zmalloc(num_interfaces * sizeof(st_json_interface_t));
1386+
if (!ctx->interfaces) {
1387+
err("%s, failed to allocate interfaces\n", __func__);
1388+
ret = -ST_JSON_NULL;
1389+
goto error;
1390+
}
13861391
for (int i = 0; i < num_interfaces; ++i) {
13871392
ret = st_json_parse_interfaces(json_object_array_get_idx(interfaces_array, i),
13881393
&ctx->interfaces[i]);
@@ -1427,14 +1432,39 @@ int st_app_parse_json(st_json_context_t* ctx, const char* filename) {
14271432
/* allocate tx sessions */
14281433
ctx->tx_video_sessions = (st_json_video_session_t*)st_app_zmalloc(
14291434
ctx->tx_video_session_cnt * sizeof(st_json_video_session_t));
1435+
if (!ctx->tx_video_sessions) {
1436+
err("%s, failed to allocate tx_video_sessions\n", __func__);
1437+
ret = -ST_JSON_NULL;
1438+
goto error;
1439+
}
14301440
ctx->tx_audio_sessions = (st_json_audio_session_t*)st_app_zmalloc(
14311441
ctx->tx_audio_session_cnt * sizeof(st_json_audio_session_t));
1442+
if (!ctx->tx_audio_sessions) {
1443+
err("%s, failed to allocate tx_audio_sessions\n", __func__);
1444+
ret = -ST_JSON_NULL;
1445+
goto error;
1446+
}
14321447
ctx->tx_anc_sessions = (st_json_ancillary_session_t*)st_app_zmalloc(
14331448
ctx->tx_anc_session_cnt * sizeof(st_json_ancillary_session_t));
1449+
if (!ctx->tx_anc_sessions) {
1450+
err("%s, failed to allocate tx_anc_sessions\n", __func__);
1451+
ret = -ST_JSON_NULL;
1452+
goto error;
1453+
}
14341454
ctx->tx_st22p_sessions = (st_json_st22p_session_t*)st_app_zmalloc(
14351455
ctx->tx_st22p_session_cnt * sizeof(st_json_st22p_session_t));
1456+
if (!ctx->tx_st22p_sessions) {
1457+
err("%s, failed to allocate tx_st22p_sessions\n", __func__);
1458+
ret = -ST_JSON_NULL;
1459+
goto error;
1460+
}
14361461
ctx->tx_st20p_sessions = (st_json_st20p_session_t*)st_app_zmalloc(
14371462
ctx->tx_st20p_session_cnt * sizeof(st_json_st20p_session_t));
1463+
if (!ctx->tx_st20p_sessions) {
1464+
err("%s, failed to allocate tx_st20p_sessions\n", __func__);
1465+
ret = -ST_JSON_NULL;
1466+
goto error;
1467+
}
14381468

14391469
int num_inf = 0;
14401470
int num_video = 0;
@@ -1692,14 +1722,39 @@ int st_app_parse_json(st_json_context_t* ctx, const char* filename) {
16921722
/* allocate tx sessions */
16931723
ctx->rx_video_sessions = (st_json_video_session_t*)st_app_zmalloc(
16941724
ctx->rx_video_session_cnt * sizeof(st_json_video_session_t));
1725+
if (!ctx->rx_video_sessions) {
1726+
err("%s, failed to allocate rx_video_sessions\n", __func__);
1727+
ret = -ST_JSON_NULL;
1728+
goto error;
1729+
}
16951730
ctx->rx_audio_sessions = (st_json_audio_session_t*)st_app_zmalloc(
16961731
ctx->rx_audio_session_cnt * sizeof(st_json_audio_session_t));
1732+
if (!ctx->rx_audio_sessions) {
1733+
err("%s, failed to allocate rx_audio_sessions\n", __func__);
1734+
ret = -ST_JSON_NULL;
1735+
goto error;
1736+
}
16971737
ctx->rx_anc_sessions = (st_json_ancillary_session_t*)st_app_zmalloc(
16981738
ctx->rx_anc_session_cnt * sizeof(st_json_ancillary_session_t));
1739+
if (!ctx->rx_anc_sessions) {
1740+
err("%s, failed to allocate rx_anc_sessions\n", __func__);
1741+
ret = -ST_JSON_NULL;
1742+
goto error;
1743+
}
16991744
ctx->rx_st22p_sessions = (st_json_st22p_session_t*)st_app_zmalloc(
17001745
ctx->rx_st22p_session_cnt * sizeof(st_json_st22p_session_t));
1746+
if (!ctx->rx_st22p_sessions) {
1747+
err("%s, failed to allocate rx_st22p_sessions\n", __func__);
1748+
ret = -ST_JSON_NULL;
1749+
goto error;
1750+
}
17011751
ctx->rx_st20p_sessions = (st_json_st20p_session_t*)st_app_zmalloc(
17021752
ctx->rx_st20p_session_cnt * sizeof(st_json_st20p_session_t));
1753+
if (!ctx->rx_st20p_sessions) {
1754+
err("%s, failed to allocate rx_st20p_sessions\n", __func__);
1755+
ret = -ST_JSON_NULL;
1756+
goto error;
1757+
}
17031758

17041759
int num_inf = 0;
17051760
int num_video = 0;

app/src/rx_video_app.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ static void app_rx_video_consume_frame(struct st_app_rx_video_session* s, void*
5353
st_memcpy(d->front_frame, frame, d->front_frame_size);
5454
else if (s->st20_pg.fmt == ST20_FMT_YUV_422_10BIT)
5555
st20_rfc4175_422be10_to_422le8(frame, d->front_frame, s->width, s->height);
56-
else /* fmt mismatch*/
56+
else /* fmt mismatch*/ {
57+
st_pthread_mutex_unlock(&d->display_frame_mutex);
5758
return;
59+
}
5860
st_pthread_mutex_unlock(&d->display_frame_mutex);
5961
st_pthread_mutex_lock(&d->display_wake_mutex);
6062
st_pthread_cond_signal(&d->display_wake_cond);

doc/build_WIN.md

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -79,52 +79,7 @@ patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk
7979
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0008-Windows-need-set-the-timer-resolution-to-maximum-to-.patch
8080
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0009-Windows-dsa-driver-need-set-to-reset-status-first.patch
8181
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0010-Windows-version-currently-no-BPF-support.patch
82-
```
83-
For DPDK version 21.11 patches
84-
```
85-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0001-build-enable-IEEE1588-PTP-option.patch
86-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0002-Change-to-enable-PTP.patch
87-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0003-net-ice-support-max-burst-size-configuration.patch
88-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0004-eanble-PF-ICE-rate-limit.patch
89-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0005-update-VF-rate-limit.patch
90-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0006-net-iavf-support-max-burst-size-configuration.patch
91-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0007-pcapng-add-ns-timestamp-for-copy-api.patch
92-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0008-net-ice-support-256-queues.patch
93-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0009-net-iavf-refine-queue-rate-limit-configure.patch
94-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0001-Add-DDP-package-load-support-in-windows.patch
95-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0002-Change-list-remove-and-add-position-to-avoid-race-co.patch
96-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0003-Mingw-compiler-do-have-same-implementation.patch
97-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0004-Mingw-do-have-pthread-implementation-change-to-adapt.patch
98-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0005-To-change-for-windows-trained-pad_interval-pass-in-v.patch
99-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0006-Add-Windows-10-May-2019-and-newer-version-1GB-huge-p.patch
100-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0007-Enable-descriptor-prefetch-for-CBDMA-version-3.4.patch
101-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0008-Windows-need-set-the-timer-resolution-to-maximum-to-.patch
102-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0009-Windows-dsa-driver-need-set-to-reset-status-first.patch
103-
```
104-
105-
For DPDK version 22.03 patches
106-
```
107-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0001-build-enable-IEEE1588-PTP-option.patch
108-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0002-Change-to-enable-PTP.patch
109-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0003-net-ice-support-max-burst-size-configuration.patch
110-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0004-eanble-PF-ICE-rate-limit.patch
111-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0005-update-VF-rate-limit.patch
112-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0006-net-iavf-support-max-burst-size-configuration.patch
113-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0007-pcapng-add-ns-timestamp-for-copy-api.patch
114-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0008-net-ice-support-256-queues.patch
115-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0009-net-iavf-refine-queue-rate-limit-configure.patch
116-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0010-net-af_xdp-parse-numa-node-id-from-sysfs.patch
117-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/0011-Add-support-for-i225-IT-PHY.patch
118-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0001-Add-DDP-package-load-support-in-windows.patch
119-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0002-Change-list-remove-and-add-position-to-avoid-race-co.patch
120-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0003-Mingw-compiler-do-have-same-implementation.patch
121-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0004-Mingw-do-have-pthread-implementation-change-to-adapt.patch
122-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0005-To-change-for-windows-trained-pad_interval-pass-in-v.patch
123-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0006-Add-Windows-10-May-2019-and-newer-version-1GB-huge-p.patch
124-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0007-Enable-descriptor-prefetch-for-CBDMA-version-3.4.patch
125-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0008-Windows-need-set-the-timer-resolution-to-maximum-to-.patch
126-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0009-Windows-dsa-driver-need-set-to-reset-status-first.patch
127-
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0010-Windows-version-currently-no-BPF-support.patch
82+
patch -p1 < {path_to_repo_dir}/libraries.media.st2110.kahawai/patches/dpdk/{dpdk_dir_ver}/windows/0011-Remove-affinity-binding-for-windows-will-have-perfor.patch
12883
```
12984

13085
### 3.2 Build and install DPDK

lib/src/pipeline/st20_pipeline_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ void* st20p_rx_get_fb_addr(st20p_rx_handle handle, uint16_t idx) {
626626
return NULL;
627627
}
628628

629-
if (idx < 0 || idx >= ctx->framebuff_cnt) {
629+
if (idx >= ctx->framebuff_cnt) {
630630
err("%s, invalid idx %d, should be in range [0, %d]\n", __func__, cidx,
631631
ctx->framebuff_cnt);
632632
return NULL;

lib/src/pipeline/st20_pipeline_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ void* st20p_tx_get_fb_addr(st20p_tx_handle handle, uint16_t idx) {
652652
return NULL;
653653
}
654654

655-
if (idx < 0 || idx >= ctx->framebuff_cnt) {
655+
if (idx >= ctx->framebuff_cnt) {
656656
err("%s, invalid idx %d, should be in range [0, %d]\n", __func__, cidx,
657657
ctx->framebuff_cnt);
658658
return NULL;

lib/src/st_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ int st_dev_request_rx_queue(struct st_main_impl* impl, enum st_port port,
15861586
st_pthread_mutex_unlock(&inf->rx_queues_mutex);
15871587

15881588
err("%s(%d), fail to find free rx queue for %s\n", __func__, port,
1589-
flow->hdr_split ? "hdr_split" : "normal");
1589+
flow && flow->hdr_split ? "hdr_split" : "normal");
15901590
return -ENOMEM;
15911591
}
15921592

lib/src/st_rx_audio_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ static int rx_audio_ops_check(struct st30_rx_ops* ops) {
10241024
err("%s, invalid rtp_ring_size %d\n", __func__, ops->rtp_ring_size);
10251025
return -EINVAL;
10261026
}
1027-
if ((ops->sample_size < 0) || (ops->sample_size > ST_PKT_MAX_RTP_BYTES)) {
1027+
if (ops->sample_size > ST_PKT_MAX_RTP_BYTES) {
10281028
err("%s, invalid sample_size %d\n", __func__, ops->sample_size);
10291029
return -EINVAL;
10301030
}

lib/src/st_rx_video_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3876,7 +3876,7 @@ void* st22_rx_get_fb_addr(st22_rx_handle handle, uint16_t idx) {
38763876

38773877
s = s_impl->impl;
38783878

3879-
if (idx < 0 || idx >= s->st20_frames_cnt) {
3879+
if (idx >= s->st20_frames_cnt) {
38803880
err("%s, invalid idx %d, should be in range [0, %d]\n", __func__, idx,
38813881
s->st20_frames_cnt);
38823882
return NULL;

0 commit comments

Comments
 (0)