Skip to content

Commit

Permalink
fix cinst
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Du <frank.du@intel.com>
  • Loading branch information
frankdjx committed Jan 15, 2024
1 parent 9ee4682 commit 1f26896
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions lib/src/st2110/st_rx_video_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,20 @@ static inline uint32_t rfc4175_rtp_seq_id(struct st20_rfc4175_rtp_hdr* rtp) {
return seq_id;
}

static inline void rv_tp_pkt_handle(struct st_rx_video_session_impl* s,
struct rte_mbuf* mbuf, enum mtl_session_port s_port,
struct st_rx_video_slot_impl* slot, uint32_t tmstamp,
int pkt_idx) {
struct mtl_main_impl* impl = rv_get_impl(s);
enum mtl_port port = mt_port_logic2phy(s->port_maps, s_port);

uint64_t pkt_ns = mt_mbuf_time_stamp(impl, mbuf, port);
struct st_rv_tp_slot* tp_slot = &s->tp->slots[slot->idx][s_port];
dbg("%s(%d,%d), tmstamp %u pkt_ns %" PRIu64 " pkt_idx %d\n", __func__, s->idx, s_port,
tmstamp, pkt_ns, pkt_idx);
rv_tp_on_packet(s, s_port, tp_slot, tmstamp, pkt_ns, pkt_idx);
}

static int rv_handle_frame_pkt(struct st_rx_video_session_impl* s, struct rte_mbuf* mbuf,
enum mtl_session_port s_port, bool ctrl_thread) {
struct st20_rx_ops* ops = &s->ops;
Expand Down Expand Up @@ -1487,18 +1501,6 @@ static int rv_handle_frame_pkt(struct st_rx_video_session_impl* s, struct rte_mb
return -EIO;
}

/* if enable_timing_parser */
if (s->enable_timing_parser) {
struct mtl_main_impl* impl = rv_get_impl(s);
enum mtl_port port = mt_port_logic2phy(s->port_maps, s_port);

uint64_t pkt_ns = mt_mbuf_time_stamp(impl, mbuf, port);
struct st_rv_tp_slot* tp_slot = &s->tp->slots[slot->idx][s_port];
dbg("%s(%d,%d), tmstamp %u pkt_ns %" PRIu64 " pkt_idx %d\n", __func__, s->idx, s_port,
tmstamp, pkt_ns, pkt_idx);
rv_tp_on_packet(s, s_port, tp_slot, tmstamp, pkt_ns, pkt_idx);
}

/* check if the same pkt got already */
if (slot->seq_id_got) {
if (seq_id_u32 >= slot->seq_id_base_u32)
Expand All @@ -1518,6 +1520,9 @@ static int rv_handle_frame_pkt(struct st_rx_video_session_impl* s, struct rte_mb
pkt_idx);
s->stat_pkts_redundant_dropped++;
slot->pkts_recv_per_port[s_port]++;
/* tp for the redundant packet */
if (s->enable_timing_parser)
rv_tp_pkt_handle(s, mbuf, s_port, slot, tmstamp, pkt_idx);
return 0;
}
if (pkt_idx != (slot->last_pkt_idx + 1)) {
Expand Down Expand Up @@ -1550,6 +1555,9 @@ static int rv_handle_frame_pkt(struct st_rx_video_session_impl* s, struct rte_mb
}
slot->last_pkt_idx = pkt_idx;

/* if enable_timing_parser */
if (s->enable_timing_parser) rv_tp_pkt_handle(s, mbuf, s_port, slot, tmstamp, pkt_idx);

bool dma_copy = false;
bool need_copy = true;
struct mtl_dma_lender_dev* dma_dev = s->dma_dev;
Expand Down

0 comments on commit 1f26896

Please sign in to comment.