From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v6 14/15] vhost: add notification for packed ring Date: Tue, 3 Jul 2018 08:43:36 +0200 Message-ID: <1702eff2-3088-4793-5a0c-88b78fc66961@redhat.com> References: <20180702081629.29258-1-maxime.coquelin@redhat.com> <20180702081629.29258-15-maxime.coquelin@redhat.com> <07e990f9-6411-6ae7-935c-c51cce80dd7a@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: mst@redhat.com, wexu@redhat.com To: Jason Wang , tiwei.bie@intel.com, zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 63D381BE7D for ; Tue, 3 Jul 2018 08:43:40 +0200 (CEST) In-Reply-To: <07e990f9-6411-6ae7-935c-c51cce80dd7a@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 07/03/2018 07:57 AM, Jason Wang wrote: > > > 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? Yeah, maybe this is no necessary. > Btw, looks like we don't care about the return value so using void instead? Right, it could be a void. Thanks! Maxime > Thanks > >> +    return 0; >> +} >> + > >