summaryrefslogtreecommitdiff
path: root/drivers/net/vmxnet3
diff options
context:
space:
mode:
authorDidier Pallard <didier.pallard@6wind.com>2018-03-28 17:43:49 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-04-27 17:34:41 +0100
commitd863f19efa4f8b4878221846f17e2d04fe5a7457 (patch)
treefa984e92c4743cef479f4e4e1061d34e30421647 /drivers/net/vmxnet3
parent595d08d10506c5193062d37612fc5629435d2db5 (diff)
downloaddpdk-next-eventdev-d863f19efa4f8b4878221846f17e2d04fe5a7457.zip
dpdk-next-eventdev-d863f19efa4f8b4878221846f17e2d04fe5a7457.tar.gz
dpdk-next-eventdev-d863f19efa4f8b4878221846f17e2d04fe5a7457.tar.xz
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>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_rxtx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 60a3322..f6e2d98 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 *