From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbbGOMzS (ORCPT ); Wed, 15 Jul 2015 08:55:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39446 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbbGOMzR (ORCPT ); Wed, 15 Jul 2015 08:55:17 -0400 Subject: Re: [virtio-dev] [PATCH] virtio_net: don't require ANY_LAYOUT with VERSION_1 To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org References: <1436963135-16592-1-git-send-email-mst@redhat.com> Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Jason Wang , virtio-dev@lists.oasis-open.org From: Paolo Bonzini Message-ID: <55A6582F.5070500@redhat.com> Date: Wed, 15 Jul 2015 14:55:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <1436963135-16592-1-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/07/2015 14:26, Michael S. Tsirkin wrote: > ANY_LAYOUT is a compatibility feature. It's implied > for VERSION_1 devices, and non-transitional devices > might not offer it. Change code to behave accordingly. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 63c7810..7fbca37 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1828,7 +1828,8 @@ static int virtnet_probe(struct virtio_device *vdev) > else > vi->hdr_len = sizeof(struct virtio_net_hdr); > > - if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT)) > + if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) || > + virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) > vi->any_header_sg = true; > > if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) > Reviewed-by: Paolo Bonzini