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 145D25F33 for ; Wed, 21 Mar 2018 09:46:08 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 997154026788; Wed, 21 Mar 2018 08:46: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 C640810EE850; Wed, 21 Mar 2018 08:46:00 +0000 (UTC) Date: Wed, 21 Mar 2018 09:45:59 +0100 From: Jens Freimann To: Tiwei Bie Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com Message-ID: <20180321084559.7v5rbf6d34ijad53@dhcp-192-241.str.redhat.com> References: <20180316152120.13199-1-jfreimann@redhat.com> <20180316152120.13199-14-jfreimann@redhat.com> <20180319110256.yaibpb37fybrohky@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180319110256.yaibpb37fybrohky@debian> User-Agent: NeoMutt/20180223 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 21 Mar 2018 08:46:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 21 Mar 2018 08:46:07 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jfreimann@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 13/17] vhost: packed queue enqueue path 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, 21 Mar 2018 08:46:08 -0000 On Mon, Mar 19, 2018 at 07:02:56PM +0800, Tiwei Bie wrote: >On Fri, Mar 16, 2018 at 04:21:16PM +0100, Jens Freimann wrote: >[...] >> +static inline uint32_t __attribute__((always_inline)) >> +vhost_enqueue_burst_packed(struct virtio_net *dev, uint16_t queue_id, >> + struct rte_mbuf **pkts, uint32_t count) >> +{ >> + struct vhost_virtqueue *vq; >> + struct vring_desc_packed *descs; >> + uint16_t idx; >> + uint16_t mask; >> + uint16_t i; >> + >> + vq = dev->virtqueue[queue_id]; >> + >> + rte_spinlock_lock(&vq->access_lock); >> + >> + if (unlikely(vq->enabled == 0)) { >> + i = 0; >> + goto out_access_unlock; >> + } >> + >> + if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) >> + vhost_user_iotlb_rd_lock(vq); >> + >> + descs = vq->desc_packed; >> + mask = vq->size - 1; > >Queue size may not be a power of 2 in packed ring. yes, you are right. my patches don't support this yet, but I plan to add it in the next version. Thanks for the review! regards, Jens