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 63D381BE7D for ; Tue, 3 Jul 2018 08:43:40 +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 E350040255C9; Tue, 3 Jul 2018 06:43:39 +0000 (UTC) Received: from [10.36.112.21] (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FE322026D76; Tue, 3 Jul 2018 06:43:38 +0000 (UTC) To: Jason Wang , 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> <07e990f9-6411-6ae7-935c-c51cce80dd7a@redhat.com> From: Maxime Coquelin Message-ID: <1702eff2-3088-4793-5a0c-88b78fc66961@redhat.com> Date: Tue, 3 Jul 2018 08:43:36 +0200 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: <07e990f9-6411-6ae7-935c-c51cce80dd7a@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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.6]); Tue, 03 Jul 2018 06:43:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Jul 2018 06:43:39 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@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 06:43:40 -0000 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; >> +} >> + > >