From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH] vhost: fix checking of device features Date: Thu, 29 Jun 2017 06:13:28 +0000 Message-ID: References: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "i.maximets@samsung.com" , "heetae82.ahn@samsung.com" , "stable@dpdk.org" To: Ivan Dyukov , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" , "dev@dpdk.org" Return-path: In-Reply-To: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----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 >=20 > To compare enabled features in current device we must use bit > mask instead of bit position. >=20 > CC: stable@dpdk.org > Fixes: c843af3aa13e ("vhost: access header only") >=20 > Signed-off-by: Ivan Dyukov > --- > lib/librte_vhost/virtio_net.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > 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_E= CN and VIRTIO_NET_F_HOST_UFO in vhost-user. We might consider to remove tho= se two lines? Thanks, Jianfeng > return true; >=20 > return false; > -- > 2.7.4