struct task_base *t;
int ret = 0;
+ if ((lconf->msg.type == LCONF_MSG_TRACE) && (lconf->tasks_all[lconf->msg.task_id]->tx_pkt == tx_pkt_drop_all)) {
+ /* We are asked to dump packets through command dump.
+ * This usually means map RX and TX packets before printing them.
+ * However we do not transmit the packets in this case => use the DUMP_RX function.
+ * This will prevent seeing the received packets also printed as TX[255] (= dropped)
+ */
+ lconf->msg.type = LCONF_MSG_DUMP_RX;
+ }
+
switch (lconf->msg.type) {
case LCONF_MSG_STOP:
msg_stop(lconf);
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;
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: ");
}
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;