diff options
author | 2018-01-25 14:50:52 +0000 | |
---|---|---|
committer | 2018-01-25 14:50:52 +0000 | |
commit | aa09ff9157159b26c431ba61a6f0a08308d123dd (patch) | |
tree | 796f0d265d5d2c9027b8d81337ad203366fcbd15 /VNFs/DPPD-PROX/rx_pkt.c | |
parent | 6a9be5e7db6445f0a144d8f51d4afc8eb40ceaac (diff) | |
parent | 2fbaf3b39062ae832ced4b62f823e6191ac79995 (diff) |
Merge "Fix dumping receive packets"
Diffstat (limited to 'VNFs/DPPD-PROX/rx_pkt.c')
-rw-r--r-- | VNFs/DPPD-PROX/rx_pkt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/VNFs/DPPD-PROX/rx_pkt.c b/VNFs/DPPD-PROX/rx_pkt.c index bd06b267..fd0f7e5c 100644 --- a/VNFs/DPPD-PROX/rx_pkt.c +++ b/VNFs/DPPD-PROX/rx_pkt.c @@ -77,7 +77,7 @@ static void next_port_pow2(struct rx_params_hw *rx_params_hw) static inline void dump_l3(struct task_base *tbase, struct rte_mbuf *mbuf) { if (unlikely(tbase->aux->task_rt_dump.n_print_rx)) { - if (tbase->aux->task_rt_dump.input->reply == NULL) { + if ((tbase->aux->task_rt_dump.input == NULL) || (tbase->aux->task_rt_dump.input->reply == NULL)) { plogdx_info(mbuf, "RX: "); } else { struct input *input = tbase->aux->task_rt_dump.input; @@ -408,7 +408,7 @@ uint16_t rx_pkt_dump(struct task_base *tbase, struct rte_mbuf ***mbufs) uint32_t n_dump = tbase->aux->task_rt_dump.n_print_rx; n_dump = ret < n_dump? ret : n_dump; - if (tbase->aux->task_rt_dump.input->reply == NULL) { + if ((tbase->aux->task_rt_dump.input == NULL) || (tbase->aux->task_rt_dump.input->reply == NULL)) { for (uint32_t i = 0; i < n_dump; ++i) { plogdx_info((*mbufs)[i], "RX: "); } @@ -453,12 +453,13 @@ uint16_t rx_pkt_trace(struct task_base *tbase, struct rte_mbuf ***mbufs) if (ret) { uint32_t n_trace = tbase->aux->task_rt_dump.n_trace; n_trace = ret < n_trace? ret : n_trace; + n_trace = n_trace <= MAX_RING_BURST ? n_trace : MAX_RING_BURST; for (uint32_t i = 0; i < n_trace; ++i) { uint8_t *pkt = rte_pktmbuf_mtod((*mbufs)[i], uint8_t *); - rte_memcpy(tbase->aux->task_rt_dump.pkt_cpy[tbase->aux->task_rt_dump.cur_trace + i], pkt, sizeof(tbase->aux->task_rt_dump.pkt_cpy[i])); - tbase->aux->task_rt_dump.pkt_cpy_len[tbase->aux->task_rt_dump.cur_trace + i] = rte_pktmbuf_pkt_len((*mbufs)[i]); - tbase->aux->task_rt_dump.pkt_mbuf_addr[tbase->aux->task_rt_dump.cur_trace + i] = (*mbufs)[i]; + rte_memcpy(tbase->aux->task_rt_dump.pkt_cpy[i], pkt, sizeof(tbase->aux->task_rt_dump.pkt_cpy[i])); + tbase->aux->task_rt_dump.pkt_cpy_len[i] = rte_pktmbuf_pkt_len((*mbufs)[i]); + tbase->aux->task_rt_dump.pkt_mbuf_addr[i] = (*mbufs)[i]; } tbase->aux->task_rt_dump.cur_trace += n_trace; |