DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost-user: enable virtio 1.0
Date: Thu, 15 Oct 2015 16:18:59 +0300	[thread overview]
Message-ID: <20151015161150-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1444907319-26348-1-git-send-email-marcel@redhat.com>

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 <marcel@redhat.com>

Looks good to me

Acked-by: Michael S. Tsirkin <mst@redhat.com>

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

  reply	other threads:[~2015-10-15 13:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 11:08 Marcel Apfelbaum
2015-10-15 13:18 ` Michael S. Tsirkin [this message]
2015-10-16  2:24   ` Yuanhan Liu
2015-10-16  6:20     ` Michael S. Tsirkin
2015-10-16  7:43       ` Andriy Berestovskyy
2015-10-16  7:50         ` Yuanhan Liu
2015-10-16  7:56         ` Michael S. Tsirkin
2015-10-16 13:52   ` Bruce Richardson
2015-10-18  7:04     ` Michael S. Tsirkin
2015-10-30 17:48       ` Thomas Monjalon
2015-11-01  9:00         ` Marcel Apfelbaum
2015-11-01  9:53           ` Thomas Monjalon
2015-11-01 11:22             ` Marcel Apfelbaum
2015-11-09 19:55         ` Michael S. Tsirkin
2015-11-02 22:13   ` Thomas Monjalon
2015-11-03  3:45     ` Xu, Qian Q
2015-11-03  3:49       ` Xu, Qian Q
2015-11-03  8:03         ` Marcel Apfelbaum
2015-11-03  8:16           ` Xie, Huawei
2015-11-03  8:26             ` Thomas Monjalon
2015-11-03  8:30               ` Marcel Apfelbaum
2015-11-03  8:31             ` Marcel Apfelbaum
2015-10-16  6:39 ` Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151015161150-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=dev@dpdk.org \
    --cc=marcel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).