From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8D5C27F1C for ; Sun, 8 Apr 2018 06:53:36 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2018 21:53:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,422,1517904000"; d="scan'208";a="218578246" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by fmsmga005.fm.intel.com with ESMTP; 07 Apr 2018 21:53:33 -0700 Date: Sun, 8 Apr 2018 12:51:32 +0800 From: Tiwei Bie To: Jens Freimann Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com Message-ID: <20180408045132.6uhtd5d6nq3zaxy5@debian> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-8-jfreimann@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180405101031.26468-8-jfreimann@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v3 07/21] net/virtio: implement transmit path for packed queues 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: Sun, 08 Apr 2018 04:53:38 -0000 On Thu, Apr 05, 2018 at 12:10:17PM +0200, Jens Freimann wrote: [...] > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c > index a8aa87b32..9f9b5a8f8 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -38,6 +38,101 @@ > #define VIRTIO_DUMP_PACKET(m, len) do { } while (0) > #endif > > +#define VIRTIO_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \ > + ETH_TXQ_FLAGS_NOOFFLOADS) Why add this? > + > +/* Cleanup from completed transmits. */ > +static void > +virtio_xmit_cleanup_packed(struct virtqueue *vq) > +{ > + uint16_t idx; > + uint16_t size = vq->vq_nentries; > + struct vring_desc_packed *desc = vq->vq_ring.desc_packed; > + > + idx = vq->vq_used_cons_idx & (size - 1); > + while (desc_is_used(&desc[idx]) && > + vq->vq_free_cnt < size) { > + vq->vq_free_cnt++; > + idx = ++vq->vq_used_cons_idx & (size - 1); Driver needs to keep track of the number of descriptors to be skipped for each used descriptor. > + } > +} > + > +uint16_t > +virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) > +{ [...] > +} > int > virtio_dev_rx_queue_done(void *rxq, uint16_t offset) > { Please add an empty line between the functions. > @@ -547,6 +642,10 @@ virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev, > > PMD_INIT_FUNC_TRACE(); > > + if (vtpci_packed_queue(hw)) { > + vq->vq_ring.avail_wrap_counter = 1; virtio_dev_tx_queue_setup_finish() will be called during a dev_stop()/dev_start(). The problem is that, the dev_stop() doesn't really stop the device. So we can't reset the wrap counter to 1 in dev_start(). > + } > + > if (hw->use_simple_tx) { > for (desc_idx = 0; desc_idx < mid_idx; desc_idx++) { > vq->vq_ring.avail->ring[desc_idx] = > @@ -567,7 +666,8 @@ virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev, > vq->vq_ring.avail->ring[desc_idx] = desc_idx; > } > > - VIRTQUEUE_DUMP(vq); > + if (!vtpci_packed_queue(hw)) The check isn't needed. > + VIRTQUEUE_DUMP(vq); > > return 0; > } > -- > 2.14.3 >