Skip to content

Commit d2f8ffe

Browse files
authored
ptp: fix panic if run rx timing with pf (#913)
Signed-off-by: Frank Du <[email protected]>
1 parent 509eb8f commit d2f8ffe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/src/mt_ptp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,8 +1559,12 @@ static int ptp_stat(void* priv) {
15591559
int mt_ptp_init(struct mtl_main_impl* impl) {
15601560
int socket = mt_socket_id(impl, MTL_PORT_P);
15611561
int ret;
1562+
int num_port = mt_num_ports(impl);
1563+
1564+
for (int i = 0; i < num_port; i++) {
1565+
/* only probe on the MTL_PORT_P */
1566+
if ((i != MTL_PORT_P) && !mt_if_has_offload_timestamp(impl, i)) continue;
15621567

1563-
for (int i = 0; i < 1; i++) { /* only probe on the MTL_PORT_P */
15641568
struct mt_ptp_impl* ptp = mt_rte_zmalloc_socket(sizeof(*ptp), socket);
15651569
if (!ptp) {
15661570
err("%s(%d), ptp malloc fail\n", __func__, i);

lib/src/st2110/st_rx_video_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2579,7 +2579,7 @@ static int rv_handle_detect_pkt(struct st_rx_video_session_impl* s, struct rte_m
25792579
ops->fps = meta->fps;
25802580
ops->packing = meta->packing;
25812581
ops->interlaced = meta->interlaced;
2582-
if (ops->notify_detected) {
2582+
if (ops->notify_detected && (ops->flags & ST20_RX_FLAG_AUTO_DETECT)) {
25832583
struct st20_detect_reply reply = {0};
25842584
ret = ops->notify_detected(ops->priv, meta, &reply);
25852585
if (ret < 0) {

0 commit comments

Comments
 (0)