From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by dpdk.org (Postfix) with ESMTP id 27C7F1B71D for ; Tue, 17 Oct 2017 15:21:25 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 8854BBCF; Tue, 17 Oct 2017 09:21:24 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 17 Oct 2017 09:21:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=EXzb1dhjBGhE4xP7o6NKr3dq5HeXMclddNb3RDF/qb8=; b=L4LSZG6Z 6wrmxvg6tnkv9g1hZg+4F45eEsUKzYQUWh+csPE4gZwxyZ2cR27jftWv2jU5P1jj D4R+5d72asPQ1hChDaaM8+rN6vFsrsN6GMbOXV5dBkLA6tzeUG7QJbkaoan1STak VFwR1ytrhX51/zcEiRn2M5b9hsEVs3jX1/mp6OA3hfh+k/xf6tua9U670kpU19Qv J17LvQXKcLs18lCmsNmLNt3wM5d3u0glfyOt/MAONGJE7gqrtslBtvW17wvdvWMT KWNU3mW41IUtujt078+mdQjeM67xLTXbpSb6OoZMz3etcWAOuWBQz3VaTObO0dcH 72m3E7PFahhZHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=EXzb1dhjBGhE4xP7o6NKr3dq5HeXM clddNb3RDF/qb8=; b=DjKxMIwzWeKsgiipzSMHNn7obd7QrVZTpYCzTFpRRN7MJ AZNiAVUQjMPy43UXDffr4hGI/kLAfBlzZkXJUOiJoZEiaVOe9ZbsMT/WfZdqf99+ Gvn6oMm6nD4/KsYFSlGz9ftSlBY9pZ81JDWtfa0W1TQXbdQfw8xyzDEcv85nq0q7 Eg32XlaKZdr1EK9a16aI1WXm0wBcLotxRDNDW9b85djgNszZdL7rhCG4Junkg0m2 1BQE+JkQTq4EtzJkpnx/ljpwG2cFyfoxLlJuyTL1WcZKkqOJJUMcBiiluDuckmws mgJoFSmE4BJEMJWXegpr1qVDC39KwyPIn7/aMCtww== X-ME-Sender: Received: from yliu-home (unknown [124.79.168.36]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A0E3245E3; Tue, 17 Oct 2017 09:21:22 -0400 (EDT) Date: Tue, 17 Oct 2017 21:21:15 +0800 From: Yuanhan Liu To: Zhiyong Yang Cc: dev@dpdk.org, maxime.coquelin@redhat.com, jianfeng.tan@intel.com Message-ID: <20171017132114.GX1545@yliu-home> References: <20171011043935.16813-1-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171011043935.16813-1-zhiyong.yang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix wrong TX pkt length stats 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: Tue, 17 Oct 2017 13:21:26 -0000 On Wed, Oct 11, 2017 at 12:39:35PM +0800, Zhiyong Yang wrote: > In the function virtqueue_enqueue_xmit(), when can_push == 1 is true, > vtnet_hdr_size is added to pkt_len by calling rte_pktmbuf_prepend. > So, virtio header len should be subtracted before calling stats > function. Nice catch! > Fixes: 58169a9c8153 ("net/virtio: support Tx checksum offload") It should also Cc stable. > Signed-off-by: Zhiyong Yang > --- > drivers/net/virtio/virtio_rxtx.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c > index 609b4138a..bf14f9a99 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -1079,6 +1079,12 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) > /* Enqueue Packet buffers */ > virtqueue_enqueue_xmit(txvq, txm, slots, use_indirect, can_push); > > + /* In function virtqueue_enqueue_xmit(), when can_push == 1 Hmm..., why not modifying it directly in virtqueue_enqueue_xmit()? --yliu > + * is true, vtnet_hdr_size is added to pkt_len of mbuf. So, it > + * should be subtracted before calling stats function. > + */ > + if (can_push == 1) > + txm->pkt_len -= txvq->vq->hw->vtnet_hdr_size; > txvq->stats.bytes += txm->pkt_len; > virtio_update_packet_stats(&txvq->stats, txm); > } > -- > 2.13.3