[PATCH v7 2/3] pcap: support MTU set for linux interfaces TX enhancment
Ido Goshen
ido at cgstowernetworks.com
Sun Jun 19 11:30:33 CEST 2022
Drop only the oversized packets and not its entrie burst
mbuf will be freed and will be counted as oerror
Signed-off-by: Ido Goshen <ido at cgstowernetworks.com>
---
drivers/net/pcap/pcap_ethdev.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index 2221c53051..ff98762058 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -494,8 +494,14 @@ eth_pcap_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
*/
ret = pcap_sendpacket(pcap,
rte_pktmbuf_read(mbuf, 0, len, temp_data), len);
- if (unlikely(ret != 0))
- break;
+ if (unlikely(ret != 0)) {
+ if (errno == EMSGSIZE) {
+ rte_pktmbuf_free(mbuf);
+ continue;
+ } else {
+ break;
+ }
+ }
num_tx++;
tx_bytes += len;
rte_pktmbuf_free(mbuf);
--
2.17.1
More information about the dev
mailing list