From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 63A692BE1; Wed, 28 Jun 2017 14:40:52 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OS900FWWCK2LQ20@mailout2.w1.samsung.com>; Wed, 28 Jun 2017 13:40:50 +0100 (BST) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170628124050eucas1p10bdb63b012c4b840e83d20a32f1a9dbe~MSY38V-8f0889508895eucas1p1N; Wed, 28 Jun 2017 12:40:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 93.81.04729.1D3A3595; Wed, 28 Jun 2017 13:40:49 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170628124049eucas1p1688178d88249ae416d653abfc19d0478~MSY3Dt-ue1096110961eucas1p16; Wed, 28 Jun 2017 12:40:49 +0000 (GMT) X-AuditID: cbfec7f4-f79806d000001279-25-5953a3d1411f Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8C.6B.20206.0D3A3595; Wed, 28 Jun 2017 13:40:48 +0100 (BST) Received: from idyukov.rnd.samsung.ru ([106.109.129.29]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OS900DV2CJTEH10@eusync1.samsung.com>; Wed, 28 Jun 2017 13:40:48 +0100 (BST) From: Ivan Dyukov 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 Date: Wed, 28 Jun 2017 15:40:31 +0300 Message-id: <1498653631-15307-1-git-send-email-i.dyukov@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRmVeSWpSXmKPExsWy7djPc7oXFwdHGtx/pmnx7tN2Jotpn2+z W8y61MRucaX9J7vFsc49LBb/Ov6wW7Qs2cnkwO7xa8FSVo8b/26xebzfd5XNo2/LKsYAligu m5TUnMyy1CJ9uwSujPPvfzAVfGGv+P97DWMD4wG2LkZODgkBE4kpL9exQNhiEhfurQeKc3EI CSxllHjZeIEdwvnMKDHx5hugKg6wjs5pNRDxZYwSB1pnMUM4DUwSV/fMYQcZxSagIXG6Yx4T iC0i4CTx5+NxsBXMAtkSX3Z/YgSxhQXMJSbcWQZWzyKgKvF+12WwOK+Ai8SZ2YehzpOTuHmu E2yBhMAZNonDaxYxQlwhK7HpADNEjYvEh893mSBsYYlXx7ewQ9gyEpcnd7NA9DYzSuyYPYEN wulhlJhxfwNUlb3EqZtXmSCu45OYtG06M8QCXomONiEI00PiWKcRRLWjxOIr18HuFBKIlbg2 6y7rBEbpBYwMqxhFUkuLc9NTi030ihNzi0vz0vWS83M3MQLj8/S/4192MC4+ZnWIUYCDUYmH d4VIcKQQa2JZcWXuIUYJDmYlEd7WhUAh3pTEyqrUovz4otKc1OJDjNIcLErivFynrkUICaQn lqRmp6YWpBbBZJk4OKUaGDsCMj91Lfp9NFvu/pq7Lg8+/dXw+eMz8cvChHAzveXJlm+KFxjK KNnPq7xU+aSXe9vdawe66xcX374ss0ZzZWS04PGYFKkv0747zjgWmF9m07/zUMNenkU7un5+ D6rbo1fjbHIgiXeBst3+h8UvBYq7sp7ZtVX1/nfUW1oTrfix+qe6UH8SqxJLcUaioRZzUXEi AFEHTTDLAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t/xy7oXFgdHGiy+b2Xx7tN2Jotpn2+z W8y61MRucaX9J7vFsc49LBb/Ov6wW7Qs2cnkwO7xa8FSVo8b/26xebzfd5XNo2/LKsYAlig3 m4zUxJTUIoXUvOT8lMy8dFul0BA3XQslhbzE3FRbpQhd35AgJYWyxJxSIM/IAA04OAe4Byvp 2yW4ZZx//4Op4At7xf/faxgbGA+wdTFycEgImEh0TqvpYuQEMsUkLtxbzwZiCwksYZQ4fjYF wm5ikrh8PhPEZhPQkDjdMY8JxBYRcJL48/E4C4jNLJAtMf36GWYQW1jAXGLCnWXsIDaLgKrE +12XGUFsXgEXiTOzD7NB7JKTuHmuk3kCI/cCRoZVjCKppcW56bnFRnrFibnFpXnpesn5uZsY geG47djPLTsYu94FH2IU4GBU4uFdIRIcKcSaWFZcmXuIUYKDWUmEt3UhUIg3JbGyKrUoP76o NCe1+BCjKdDyicxSosn5wFjJK4k3NDE0tzQ0MrawMDcyUhLnnfrhSriQQHpiSWp2ampBahFM HxMHp1QD43INpX/dP3UPWzovjOjftCFS4MnxdAE/t+RlG7lOdMz4teyYvbeXkJ7Im5/W35is j3CeP73hJe+yI98uVeYl/3sgz3l94TpHM1H5t+YNkefNwy/MixaPKT2x+wnXtV8PlPP856Qn MWmcWuT4axHXQ+6iJTvUPrlH/+MP6FhZalNRfMbpqidTjBJLcUaioRZzUXEiACi2od1dAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170628124049eucas1p1688178d88249ae416d653abfc19d0478 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?SXZhbiBEeXVrb3YbU1JSLVZpcnR1YWxpemF0aW9uIExhYhs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG0V4cGVydCBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?SXZhbiBEeXVrb3YbU1JSLVZpcnR1YWxpemF0aW9uIExhYhtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG0V4cGVydCBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170628124049eucas1p1688178d88249ae416d653abfc19d0478 X-RootMTR: 20170628124049eucas1p1688178d88249ae416d653abfc19d0478 References: Subject: [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: Wed, 28 Jun 2017 12:40:52 -0000 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))) return true; return false; -- 2.7.4