summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/rx_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/rx_pkt.c')
-rw-r--r--VNFs/DPPD-PROX/rx_pkt.c11
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;