From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 61F4691C0 for ; Thu, 15 Oct 2015 15:19:04 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BAF47C0BB28B; Thu, 15 Oct 2015 13:19:03 +0000 (UTC) Received: from redhat.com (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t9FDJ09v018769; Thu, 15 Oct 2015 09:19:01 -0400 Date: Thu, 15 Oct 2015 16:18:59 +0300 From: "Michael S. Tsirkin" To: Marcel Apfelbaum Message-ID: <20151015161150-mutt-send-email-mst@redhat.com> References: <1444907319-26348-1-git-send-email-marcel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444907319-26348-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] vhost-user: enable virtio 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2015 13:19:04 -0000 On Thu, Oct 15, 2015 at 02:08:39PM +0300, Marcel Apfelbaum wrote: > Make vhost-user virtio 1.0 compatible by adding it to the > supported features and keeping the header length > the same as for mergeable RX buffers. > > Signed-off-by: Marcel Apfelbaum Looks good to me Acked-by: Michael S. Tsirkin Just one question: dpdk is only supported on little-endian platforms at the moment, right? virtio 1 spec requires little endian. > --- > > To be applied on top of: > [dpdk-dev] [PATCH v6 00/13] vhost-user multiple queues enabling > > Thanks, > Marcel > > lib/librte_vhost/virtio-net.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > index a51327d..ee4650e 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -75,6 +75,7 @@ static struct virtio_net_config_ll *ll_root; > (1ULL << VIRTIO_NET_F_CTRL_VQ) | \ > (1ULL << VIRTIO_NET_F_CTRL_RX) | \ > (1ULL << VIRTIO_NET_F_MQ) | \ > + (1ULL << VIRTIO_F_VERSION_1) | \ > (1ULL << VHOST_F_LOG_ALL) | \ > (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > @@ -477,17 +478,17 @@ set_features(struct vhost_device_ctx ctx, uint64_t *pu) > return -1; > > dev->features = *pu; > - if (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) { > - LOG_DEBUG(VHOST_CONFIG, > - "(%"PRIu64") Mergeable RX buffers enabled\n", > - dev->device_fh); > + if (dev->features & > + ((1 << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_F_VERSION_1))) { > vhost_hlen = sizeof(struct virtio_net_hdr_mrg_rxbuf); > } else { > - LOG_DEBUG(VHOST_CONFIG, > - "(%"PRIu64") Mergeable RX buffers disabled\n", > - dev->device_fh); > vhost_hlen = sizeof(struct virtio_net_hdr); > } > + LOG_DEBUG(VHOST_CONFIG, > + "(%"PRIu64") Mergeable RX buffers %s, virtio 1 %s\n", > + dev->device_fh, > + (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off", > + (dev->features & (1ULL << VIRTIO_F_VERSION_1)) ? "on" : "off"); > > for (i = 0; i < dev->virt_qp_nb; i++) { > uint16_t base_idx = i * VIRTIO_QNUM; > -- > 2.1.0