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 <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
This commit is contained in:
Didier Pallard 2018-03-28 17:43:49 +02:00 committed by Ferruh Yigit
parent 595d08d105
commit d863f19efa

View File

@ -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 *