When a packet cannot be transmitted, the driver is supposed to free this
packet and report it as handled.
This is to prevent the application from retrying to send the same packet
and ending up in a liveloop since the driver will never manage to send
it.
Fixes:
49a0a2ffd5db ("net/pcap: fix possible mbuf double freeing")
Fixes:
6db141c91e1f ("pcap: support jumbo frames")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
mbuf->pkt_len,
RTE_ETHER_MAX_JUMBO_FRAME_LEN);
- break;
+ rte_pktmbuf_free(mbuf);
+ continue;
}
}
dumper_q->tx_stat.bytes += tx_bytes;
dumper_q->tx_stat.err_pkts += nb_pkts - num_tx;
- return num_tx;
+ return nb_pkts;
}
/*
mbuf->pkt_len,
RTE_ETHER_MAX_JUMBO_FRAME_LEN);
- break;
+ rte_pktmbuf_free(mbuf);
+ continue;
}
}
tx_queue->tx_stat.pkts += num_tx;
tx_queue->tx_stat.bytes += tx_bytes;
- tx_queue->tx_stat.err_pkts += nb_pkts - num_tx;
+ tx_queue->tx_stat.err_pkts += i - num_tx;
- return num_tx;
+ return i;
}
/*