From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id A78A24F9A for ; Wed, 28 Mar 2018 17:44:35 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id x4so6162684wmh.5 for ; Wed, 28 Mar 2018 08:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=29eb3Ck9UKfiiAHyrxHCokTxwfIq68Dq8FSfXKsLinc=; b=Jl+28KegC8QmzMw3a8Y7pM3MaxNoYWh6b75jc2stZiIAEQgRPCHLeae87PIxeP+djG VmCj4989aQwxWhV+weryBIcVUnbTaeccoviNzE3FoTGzwEwT/D3lOeVBD0LEgglqqWOq 6ACC1jRYnYvd1TG+rHF9OjayBxJy00TgWxxD3QgTlthfP+e6hJ2s+EhsI9sFoyfocZ0W S7ZBXzluLvE/vC7Uokvq/Oi6rSp9Wemlx4/pcBg8bDwWcaLhmsU0zPYX6gdOUNMSwxk7 cGfQAMWUUaeJnu66177mR2svjca0TI2IqDMSLMBgSMhnqUluChPIdQNn1mvVugNAfMZZ lEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=29eb3Ck9UKfiiAHyrxHCokTxwfIq68Dq8FSfXKsLinc=; b=cs3/tEEyDYlPB+RVf15petayj7YhyNdtCDaqk7j+o0ReP0dPtwFnwtHzKTeSRnliYP 1ldb5Vds0OejZmMo1YKUWBRF0OlVc6TyvgmIh0G8aQqxE1h046lTk9kZTDxLOCbqQKch 2mlvyORIWMDonJKTSvDfzHbVLhEBh3taEpaUzBr6qHER6sr4X9wkJASVNYS/T2hk3Dvm /7De+SkgaybSV+sybT+hPH/2cx2ZFnzCqt50T24OZVkTKr7Nh5lW72Fk2nk13PZjjZZv RWGrLI6mkT3tWeLA6lclq7WHztWrADcZaoVZXnBc61kHqfuJc+nZdWaWIiIn19grqeRT yRlg== X-Gm-Message-State: AElRT7HBPqIZWxtyCZijhyy4UlsBnGuslMmlEPWpnD8/WdVCSz7FeGgH eRIBLQ3Fzv+p9fDwREiEtsT8oWgk X-Google-Smtp-Source: AIpwx4/KyrHDeQ9W9ZCtfD9P4AZOnCbPJ3Mn8lUpOZUBYhzSLcrZmqTc0Crxs+b8W07LSc4ch694IQ== X-Received: by 10.28.52.17 with SMTP id b17mr2915449wma.142.1522251875183; Wed, 28 Mar 2018 08:44:35 -0700 (PDT) Received: from pala.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id o23sm7957279wrf.93.2018.03.28.08.44.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 08:44:34 -0700 (PDT) From: Didier Pallard To: dev@dpdk.org Date: Wed, 28 Mar 2018 17:43:49 +0200 Message-Id: <20180328154349.24976-9-didier.pallard@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180328154349.24976-1-didier.pallard@6wind.com> References: <20180328154349.24976-1-didier.pallard@6wind.com> Subject: [dpdk-dev] [PATCH 8/8] net/vmxnet3: skip empty segments in transmission X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2018 15:44:36 -0000 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 --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 1d344b26e..32991f4e6 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 * -- 2.11.0