From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id AD0A71B740 for ; Mon, 9 Apr 2018 08:20:07 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 314C081A88C2; Mon, 9 Apr 2018 06:20:07 +0000 (UTC) Received: from localhost (dhcp-192-241.str.redhat.com [10.33.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D58A4215CDC8; Mon, 9 Apr 2018 06:20:06 +0000 (UTC) Date: Mon, 9 Apr 2018 08:20:05 +0200 From: Jens Freimann To: Tiwei Bie Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com Message-ID: <20180409062005.zfy3gwj474hjgwwj@dhcp-192-241.str.redhat.com> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-8-jfreimann@redhat.com> <20180408045132.6uhtd5d6nq3zaxy5@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180408045132.6uhtd5d6nq3zaxy5@debian> User-Agent: NeoMutt/20180223 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 09 Apr 2018 06:20:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Mon, 09 Apr 2018 06:20:07 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jfreimann@redhat.com' RCPT:'' 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: Mon, 09 Apr 2018 06:20:08 -0000 On Sun, Apr 08, 2018 at 12:51:32PM +0800, Tiwei Bie wrote: >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? mistake during rebase, will fix. > >> + >> +/* 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. I've added support for this due already (because of your comment on the rxvq flush). Will be in v4. >> + } >> +} >> + >> +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. ok. > > >> @@ -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(). I see, would virtio_init_device() work? thanks! regards, Jens > >> + } >> + >> 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 >>