From: Didier Pallard Date: Wed, 28 Mar 2018 15:43:49 +0000 (+0200) Subject: net/vmxnet3: skip empty segments in transmission X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d863f19efa4f8b4878221846f17e2d04fe5a7457;p=dpdk.git net/vmxnet3: skip empty segments in transmission Packets containing empty segments are dropped by hypervisor, prevent this case by skipping empty segments in transmission. Also drop empty mbufs to be sure that at least one segment is transmitted for each mbuf. Signed-off-by: Didier Pallard Acked-by: Yong Wang --- diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 60a33223a6..f6e2d98777 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -457,6 +457,14 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, rte_pktmbuf_pkt_len(txm) <= txq->txdata_desc_size) { struct Vmxnet3_TxDataDesc *tdd; + /* Skip empty packets */ + if (unlikely(rte_pktmbuf_pkt_len(txm) == 0)) { + txq->stats.drop_total++; + rte_pktmbuf_free(txm); + nb_tx++; + continue; + } + tdd = (struct Vmxnet3_TxDataDesc *) ((uint8 *)txq->data_ring.base + txq->cmd_ring.next2fill * @@ -477,6 +485,11 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, * maximum size of mbuf segment size. */ gdesc = txq->cmd_ring.base + txq->cmd_ring.next2fill; + + /* Skip empty segments */ + if (unlikely(m_seg->data_len == 0)) + continue; + if (copy_size) { uint64 offset = (uint64)txq->cmd_ring.next2fill *