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 DFF7E1BECB for ; Tue, 3 Jul 2018 07:58:04 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 69D31401CC41; Tue, 3 Jul 2018 05:58:04 +0000 (UTC) Received: from [10.72.12.60] (ovpn-12-60.pek2.redhat.com [10.72.12.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45F022026D76; Tue, 3 Jul 2018 05:58:00 +0000 (UTC) To: Maxime Coquelin , tiwei.bie@intel.com, zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org Cc: mst@redhat.com, wexu@redhat.com References: <20180702081629.29258-1-maxime.coquelin@redhat.com> <20180702081629.29258-15-maxime.coquelin@redhat.com> From: Jason Wang Message-ID: <07e990f9-6411-6ae7-935c-c51cce80dd7a@redhat.com> Date: Tue, 3 Jul 2018 13:57:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180702081629.29258-15-maxime.coquelin@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 03 Jul 2018 05:58:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 03 Jul 2018 05:58:04 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v6 14/15] vhost: add notification for packed ring 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, 03 Jul 2018 05:58:05 -0000 On 2018年07月02日 16:16, Maxime Coquelin wrote: > +static inline int > +vhost_enable_notify_split(struct vhost_virtqueue *vq, int enable) > +{ > + if (enable) > + vq->used->flags &= ~VRING_USED_F_NO_NOTIFY; > + else > + vq->used->flags |= VRING_USED_F_NO_NOTIFY; > + > + return 0; > +} > + > +static inline int > +vhost_enable_notify_packed(struct virtio_net *dev, > + struct vhost_virtqueue *vq, int enable) > +{ > + uint16_t flags; > + > + if (!enable) { > + vq->device_event->desc_event_flags = RING_EVENT_FLAGS_DISABLE; > + return 0; > + } > + > + flags = RING_EVENT_FLAGS_ENABLE; > + if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) { > + flags = RING_EVENT_FLAGS_DESC; > + vq->device_event->desc_event_off_wrap = vq->last_avail_idx | > + vq->avail_wrap_counter << 15; > + } > + > + rte_smp_wmb(); > + > + vq->device_event->desc_event_flags = flags; > + > + rte_smp_wmb(); > + We don't do this for split version. Any specific reason for this? Btw, looks like we don't care about the return value so using void instead? Thanks > + return 0; > +} > +