From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 71AE91B128 for ; Fri, 12 Apr 2019 15:09:58 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190412130956euoutp01e699669c85f24ca1e890fa0a2407fdb1~UvBtVXWme0874708747euoutp01a for ; Fri, 12 Apr 2019 13:09:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190412130956euoutp01e699669c85f24ca1e890fa0a2407fdb1~UvBtVXWme0874708747euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1555074596; bh=ZVZimRffPA9EazrP4Igj9d3lP2Wk7kDXi6DEuzcb1mE=; h=From:To:Cc:Subject:Date:References:From; b=ZjFITHKj5n1FqEcXNL8WP3B3H7EPMJp8cLdK6K8sfucm8urbsNukcH2iG4YeahxDr XT/Iwf8RQfMkclLJ++pfCDslhztq4ulFJIxJ54EXm1C7WKrYTRFdaGOtr/PjBtVqD1 TMoIGfFr9F1Z4PROgJmpkRF35YZULDxCnfSFydh4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190412130956eucas1p2cde252e3436cf0ebb78f9ca02307782f~UvBs0b6Lj1252312523eucas1p2t; Fri, 12 Apr 2019 13:09:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 13.93.04377.42E80BC5; Fri, 12 Apr 2019 14:09:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8~UvBr8sxAm0724907249eucas1p1F; Fri, 12 Apr 2019 13:09:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190412130955eusmtrp29ceac4841d6836d9b6f5b9eb4b53ecf1~UvBrunSPG2779727797eusmtrp2f; Fri, 12 Apr 2019 13:09:55 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-db-5cb08e24b3e0 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 80.FA.04146.32E80BC5; Fri, 12 Apr 2019 14:09:55 +0100 (BST) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190412130954eusmtip296eccc695400f01e2bbd2f323770d044~UvBrM1ZD42414424144eusmtip2G; Fri, 12 Apr 2019 13:09:54 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Maxime Coquelin Cc: Tiwei Bie , Jens Freimann , David Marchand , Ilya Maximets , stable@dpdk.org Date: Fri, 12 Apr 2019 16:09:49 +0300 Message-Id: <20190412130949.14299-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSW0hTcRj3v3O2HUfL05T80EwYJhS1mfQwumiCDyNQBKWrUqc8TdNN2Znm JWil2dqDkxAsCZVEFGd5YXlZUnOkC6uZUmGRZqmVzoyalHND23Ymvf2ufL+Hj8BEDjyCyFVp aLWKyhfzBHjviGtsX0x1V2bc936urK9Nz5Mt/+7jyN7cdPFl9o4WXDZyaxCXres8fNkj7Qbn KF++1tTClTcPLnDkP5+85cmrTe0oDT8tOJxN5+cW02ppwjlBjvu5jVs4IygZNqRqkYfQo2AC yAPgdnzm6ZGAEJFtCPonbuAsWUFwz2ThsMSJ4J1Wz9+sOAeG+KzRiuDp6sdAahVB851a5Evx yL0wanzmx2FkAtQOujBfCCN7EDSYjbjPCCWTYa6j2Y9xchfU1bIFIXkIPvx6jLPn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NTUgtQimD4m Dk6pBkam9/+sdtcf0PZ6w3VCJy7oxuZzHqetZc9EeJefnv33jY2I8IGN5e8q/3I4vwncIc1i YLE6TNhKuOZ0RZrlsgseAn8+2Nk36TJezdUSbNl3S8K+9GLeMak/K3/MbTFfZtBWbpDxQcw7 eWVr6/vZecw77355K1bfvPfDRT0X0cpPWbuZznKkuymxFGckGmoxFxUnAgBYLt/1VAIAAA== X-CMS-MailID: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 References: Subject: [dpdk-dev] [PATCH] vhost: fix silent queue enabling with legacy guests 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: Fri, 12 Apr 2019 13:09:58 -0000 vhost should notify the application in case of all vring state changes. In general, application should not care about negotiation of VHOST_USER_F_PROTOCOL_FEATURES. Protocol details like this should be hidden by the vhost library. With this patch applications like OVS will be able to assume that all vrings disabled by default and only process 'vring_state_changed' events. Fixes: 321203a54ba7 ("vhost: enable rings at the right time") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets --- lib/librte_vhost/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 23beed97d..c9e29ece8 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1231,8 +1231,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg, * the ring starts already enabled. Otherwise, it is enabled via * the SET_VRING_ENABLE message. */ - if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) + if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) { vq->enabled = 1; + if (dev->notify_ops->vring_state_changed) + dev->notify_ops->vring_state_changed( + dev->vid, file.index, 1); + } if (vq->kickfd >= 0) close(vq->kickfd); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B2A8CA0096 for ; Fri, 12 Apr 2019 15:10:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD2CC1B130; Fri, 12 Apr 2019 15:09:59 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 71AE91B128 for ; Fri, 12 Apr 2019 15:09:58 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190412130956euoutp01e699669c85f24ca1e890fa0a2407fdb1~UvBtVXWme0874708747euoutp01a for ; Fri, 12 Apr 2019 13:09:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190412130956euoutp01e699669c85f24ca1e890fa0a2407fdb1~UvBtVXWme0874708747euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1555074596; bh=ZVZimRffPA9EazrP4Igj9d3lP2Wk7kDXi6DEuzcb1mE=; h=From:To:Cc:Subject:Date:References:From; b=ZjFITHKj5n1FqEcXNL8WP3B3H7EPMJp8cLdK6K8sfucm8urbsNukcH2iG4YeahxDr XT/Iwf8RQfMkclLJ++pfCDslhztq4ulFJIxJ54EXm1C7WKrYTRFdaGOtr/PjBtVqD1 TMoIGfFr9F1Z4PROgJmpkRF35YZULDxCnfSFydh4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190412130956eucas1p2cde252e3436cf0ebb78f9ca02307782f~UvBs0b6Lj1252312523eucas1p2t; Fri, 12 Apr 2019 13:09:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 13.93.04377.42E80BC5; Fri, 12 Apr 2019 14:09:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8~UvBr8sxAm0724907249eucas1p1F; Fri, 12 Apr 2019 13:09:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190412130955eusmtrp29ceac4841d6836d9b6f5b9eb4b53ecf1~UvBrunSPG2779727797eusmtrp2f; Fri, 12 Apr 2019 13:09:55 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-db-5cb08e24b3e0 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 80.FA.04146.32E80BC5; Fri, 12 Apr 2019 14:09:55 +0100 (BST) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190412130954eusmtip296eccc695400f01e2bbd2f323770d044~UvBrM1ZD42414424144eusmtip2G; Fri, 12 Apr 2019 13:09:54 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Maxime Coquelin Cc: Tiwei Bie , Jens Freimann , David Marchand , Ilya Maximets , stable@dpdk.org Date: Fri, 12 Apr 2019 16:09:49 +0300 Message-Id: <20190412130949.14299-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSW0hTcRj3v3O2HUfL05T80EwYJhS1mfQwumiCDyNQBKWrUqc8TdNN2Znm JWil2dqDkxAsCZVEFGd5YXlZU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OSQEDCR+LzzIHsXIxeHkMBSRokr37+wQSSkJH78usAKYQtL/LnWxQZR 9I1R4suGKYwgCTYBHYlTq4+A2SICDhK397xiASliFtjGKNGw+CNYt7CAi8STNYtZQGwWAVWJ 6VMgGngFrCVufdzNArFBXmL1hgPMExh5FjAyrGIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAgM vm3Hfm7ewXhpY/AhRgEORiUe3gCr9TFCrIllxZW5hxglOJiVRHhDWIBCvCmJlVWpRfnxRaU5 qcWHGE2Blk9klhJNzgdGRl5JvKGpobmFpaG5sbmxmYWSOO95g8ooIYH0xJLU7NTUgtQimD4m Dk6pBkam9/+sdtcf0PZ6w3VCJy7oxuZzHqetZc9EeJefnv33jY2I8IGN5e8q/3I4vwncIc1i YLE6TNhKuOZ0RZrlsgseAn8+2Nk36TJezdUSbNl3S8K+9GLeMak/K3/MbTFfZtBWbpDxQcw7 eWVr6/vZecw77355K1bfvPfDRT0X0cpPWbuZznKkuymxFGckGmoxFxUnAgBYLt/1VAIAAA== X-CMS-MailID: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 X-Msg-Generator: CA Content-Type: text/plain; charset="UTF-8" X-RootMTR: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190412130955eucas1p114cc8050bf475c1df7b50572da718fb8 References: Subject: [dpdk-dev] [PATCH] vhost: fix silent queue enabling with legacy guests 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190412130949.W-aadM27a1DbH-GxIdvEIAtd21GoBOkC9XUUpDbv62w@z> vhost should notify the application in case of all vring state changes. In general, application should not care about negotiation of VHOST_USER_F_PROTOCOL_FEATURES. Protocol details like this should be hidden by the vhost library. With this patch applications like OVS will be able to assume that all vrings disabled by default and only process 'vring_state_changed' events. Fixes: 321203a54ba7 ("vhost: enable rings at the right time") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets --- lib/librte_vhost/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 23beed97d..c9e29ece8 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1231,8 +1231,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg, * the ring starts already enabled. Otherwise, it is enabled via * the SET_VRING_ENABLE message. */ - if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) + if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) { vq->enabled = 1; + if (dev->notify_ops->vring_state_changed) + dev->notify_ops->vring_state_changed( + dev->vid, file.index, 1); + } if (vq->kickfd >= 0) close(vq->kickfd); -- 2.17.1