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 1283A2BE1; Thu, 29 Jun 2017 09:27:32 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E8DEC058EB3; Thu, 29 Jun 2017 07:27:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2E8DEC058EB3 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=maxime.coquelin@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2E8DEC058EB3 Received: from [10.36.112.58] (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A736812EE; Thu, 29 Jun 2017 07:27:30 +0000 (UTC) To: "Tan, Jianfeng" , Ivan Dyukov , "yliu@fridaylinux.org" , "dev@dpdk.org" Cc: "i.maximets@samsung.com" , "heetae82.ahn@samsung.com" , "stable@dpdk.org" References: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> From: Maxime Coquelin Message-ID: <83633496-abe1-a1b0-7ea8-03d9542f0e49@redhat.com> Date: Thu, 29 Jun 2017 09:27:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 29 Jun 2017 07:27:32 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] vhost: fix checking of device features 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: Thu, 29 Jun 2017 07:27:33 -0000 On 06/29/2017 08:13 AM, Tan, Jianfeng wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ivan Dyukov >> Sent: Wednesday, June 28, 2017 8:41 PM >> To: yliu@fridaylinux.org; maxime.coquelin@redhat.com; dev@dpdk.org >> Cc: i.maximets@samsung.com; heetae82.ahn@samsung.com; Ivan Dyukov; >> stable@dpdk.org >> Subject: [dpdk-dev] [PATCH] vhost: fix checking of device features >> >> To compare enabled features in current device we must use bit >> mask instead of bit position. >> >> CC: stable@dpdk.org >> Fixes: c843af3aa13e ("vhost: access header only") >> >> Signed-off-by: Ivan Dyukov >> --- >> lib/librte_vhost/virtio_net.c | 8 +++++--- >> 1 file changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c >> index ebfda1c..4fae4c1 100644 >> --- a/lib/librte_vhost/virtio_net.c >> +++ b/lib/librte_vhost/virtio_net.c >> @@ -601,9 +601,11 @@ static inline bool >> virtio_net_with_host_offload(struct virtio_net *dev) >> { >> if (dev->features & >> - (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_ECN | >> - VIRTIO_NET_F_HOST_TSO4 | >> VIRTIO_NET_F_HOST_TSO6 | >> - VIRTIO_NET_F_HOST_UFO)) >> + ((1ULL << VIRTIO_NET_F_CSUM) | >> + (1ULL << VIRTIO_NET_F_HOST_ECN) | >> + (1ULL << VIRTIO_NET_F_HOST_TSO4) | >> + (1ULL << VIRTIO_NET_F_HOST_TSO6) | >> + (1ULL << VIRTIO_NET_F_HOST_UFO))) > > Another problem in this piece of code, we don't support VIRTIO_NET_F_HOST_ECN and VIRTIO_NET_F_HOST_UFO in vhost-user. We might consider to remove those two lines? It is not really a problem as the feature is never negotiated as not supported, it would just be a clean-up. I think we should stick with this version as it targets also -stable. Another patch could be sent on top to remove these unsupported feature bits. Thanks, Maxime > Thanks, > Jianfeng > > >> return true; >> >> return false; >> -- >> 2.7.4 >