From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DC257A0096 for ; Wed, 5 Jun 2019 03:42:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 589C71B95D; Wed, 5 Jun 2019 03:42:30 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id F0B9E1B958; Wed, 5 Jun 2019 03:42:28 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2019 18:42:27 -0700 X-ExtLoop1: 1 Received: from npg-dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.151]) by orsmga007.jf.intel.com with ESMTP; 04 Jun 2019 18:42:26 -0700 Date: Wed, 5 Jun 2019 09:41:17 +0800 From: Tiwei Bie To: Andrew Rybchenko Cc: Maxime Coquelin , Zhihong Wang , dev@dpdk.org, Dilshod Urazov , stable@dpdk.org Message-ID: <20190605014117.GA20728@___> References: <1559587805-1637-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1559587805-1637-1-git-send-email-arybchenko@solarflare.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] net/virtio: add Tx preparation 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Thanks for the patch! On Mon, Jun 03, 2019 at 07:50:05PM +0100, Andrew Rybchenko wrote: [...] > uint16_t > +virtio_xmit_pkts_prepare(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) > +{ > + uint16_t nb_tx; > + int error; > + > + for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) { > + struct rte_mbuf *m = tx_pkts[nb_tx]; > + > +#ifdef RTE_LIBRTE_ETHDEV_DEBUG > + error = rte_validate_tx_offload(m); > + if (unlikely(error)) { > + rte_errno = -error; > + break; > + } > +#endif > + > + error = rte_net_intel_cksum_prepare(m); > + if (unlikely(error)) { > + rte_errno = -error; It's a bit confusing here. Based on the API doc of rte_eth_tx_prepare(): https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4360-L4362 It should set negative value to rte_errno when error happens, and that's also what some other PMDs do, e.g.: https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/iavf/iavf_rxtx.c#L1701 https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/iavf/iavf_rxtx.c#L1725 https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/drivers/net/vmxnet3/vmxnet3_rxtx.c#L364 But some PMDs and rte_eth_tx_prepare() itself don't do this: https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4377 https://github.com/DPDK/dpdk/blob/7f9f46d6cef5b03681a3935b9a18378e08ca6f62/lib/librte_ethdev/rte_ethdev.h#L4387 > + break; > + } > + > + if (m->ol_flags & PKT_TX_TCP_SEG) > + virtio_tso_fix_cksum(m); > + } > + > + return nb_tx; > +} > + > +uint16_t > virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts, > uint16_t nb_pkts) > { > -- > 1.8.3.1 >