diff mbox series

[v8,2/3] pcap: support MTU set for linux interfaces TX enhancment

Message ID 20220620083944.51517-3-ido@cgstowernetworks.com (mailing list archive)
State New
Delegated to: Ferruh Yigit
Headers show
Series pcap: support MTU set for linux interfaces | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ido Goshen June 20, 2022, 8:39 a.m. UTC
Drop only the oversized packets and not its entire burst
mbuf will be freed and will be counted as oerror

Signed-off-by: Ido Goshen <ido@cgstowernetworks.com>
---
 drivers/net/pcap/pcap_ethdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);