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 5AE371B3F5 for ; Thu, 29 Nov 2018 08:59:06 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181129075904euoutp01e31587fb83315a73b39db6bb2586a924~riWCIEqdf0679006790euoutp01V for ; Thu, 29 Nov 2018 07:59:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181129075904euoutp01e31587fb83315a73b39db6bb2586a924~riWCIEqdf0679006790euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543478345; bh=n7Tz40HVZJZY48FEJ4yzlcVXMqLDFscQN33Cv3fZUnA=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=fTUV0ixNKaAlLg2+acELbBFoEnQLcRC52sHUwH11xAS80M7oiL8UyV7bNt/P+mll9 KYUwTbtatBSOG5sGg4tWLx9hMRcKZJwBV8Z2Aric2QQMm122T7v1z0UP3qWIl/fQ+C G8wtkYJxlTVCLYu2IakUgUNaMex70SS6q6J9cFK0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181129075904eucas1p28f3aa2e6861d08b9fb7990535f7c9f2c~riWBovQ-L0030400304eucas1p2F; Thu, 29 Nov 2018 07:59:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 69.21.04294.84C9FFB5; Thu, 29 Nov 2018 07:59:04 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181129075903eucas1p2678fd5a6d546a06688546f29b60f0cf1~riWAq3IES2906429064eucas1p2J; Thu, 29 Nov 2018 07:59:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181129075903eusmtrp220570166dfcf9d352c61a634b18ee200~riWAb-b052175121751eusmtrp2x; Thu, 29 Nov 2018 07:59:03 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-c4-5bff9c482d4d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A6.8E.04284.74C9FFB5; Thu, 29 Nov 2018 07:59:03 +0000 (GMT) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181129075902eusmtip1da3df7d5932cb28ee9720c61f6e4b015~riWAHADyk2621826218eusmtip1j; Thu, 29 Nov 2018 07:59:02 +0000 (GMT) To: Luca Boccassi , stable@dpdk.org Cc: maxime.coquelin@redhat.com From: Ilya Maximets Message-ID: <9586ef75-ae3f-36d7-2a82-eff7dfc19fa0@samsung.com> Date: Thu, 29 Nov 2018 10:58:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181128162054.8182-1-bluca@debian.org> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGKsWRmVeSWpSXmKPExsWy7djPc7oec/5HG8z8yWMxp2kdu8WV9p/s Fsc697BY/Ov4w+7A4vGrbS6zx68FS1k93u+7yubRt2UVYwBLFJdNSmpOZllqkb5dAlfGhavT GQvO8Vb8WtfC3MDYy93FyMkhIWAisfvZJuYuRi4OIYEVjBLvv/9lg3C+MEpcvraIEcL5zCix dP11FpiWnZO2QbUsZ5S4O/U/M0hCSOAjo8TZKV4gtrBAqMT1LcsYQWwRAVOJh9P+gTUzC8hJ 7F++H6yeTUBH4tTqI2A1vAJ2EnNmXwOrYRFQlbi24hMbiC0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hbnpucWG+oVJ+YWl+al6yXn525iBEbUtmM/N+9g vLQx+BCjAAejEg/vgRX/ooVYE8uKK3MPMUpwMCuJ8G7y/B8txJuSWFmVWpQfX1Sak1p8iNEU 6LmJzFKiyfnAaM8riTc0NTS3sDQ0NzY3NrNQEuc9b1AZJSSQnliSmp2aWpBaBNPHxMEp1cDY pXbFvytB2nDtz6L5sxTPXpP06VizeZOB4OGPZ0//cNhuMbmQ3VtXyyO+p+rwxX0BM8o+nGuR jXwgUrxS7qm56iGls3f3HXPld9HY/ypmw02/f2dYTVYmHXeWWKSmcPbW7gLz34JKWiEC/wuX euetj2dbktv842JzhZpL2H73IrU3U4paqmqUWIozEg21mIuKEwFQgeuPvgIAAA== X-CMS-MailID: 20181129075903eucas1p2678fd5a6d546a06688546f29b60f0cf1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181128162145epcas4p37815583a5bc1574c266eb8afb73d92c6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181128162145epcas4p37815583a5bc1574c266eb8afb73d92c6 References: <20181128162054.8182-1-bluca@debian.org> Subject: Re: [dpdk-stable] [PATCH 16.11] vhost-user: fix false negative in handling user messages X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 07:59:06 -0000 On 28.11.2018 19:20, Luca Boccassi wrote: > vhost_user_msg_handler checks an accumulated return code before > returning, and prints an error and returns -1 if it's non-zero. > But some of the possible user messages cannot fail and thus do not > set the variable, which might retain a previously set and unrelated > value, causing unnecessary failures and error messages. > > Reset the return code before use. > > Fixes: 0ce9e73d1e8d ("vhost-user: drop connection on message handling failures") > > Signed-off-by: Luca Boccassi > --- > Found this issue when testing with the Vyatta stuff, "ret" is set at > the beginning of the function and never reset when the message is for example > VHOST_USER_GET_FEATURES so there's a flurry of errors. Hmm. Yes, current implementation in 16.11 branch doesn't work at all. I think that it's a kind of an issue in the original patch 0d7853a4d. But it uncovered only after backporting. On master we had additional call 'ret = vhost_user_check_and_alloc_queue_pair()' before the main handling switch and this function could only return 0 or -1. So, the 'ret' was always zero if we reached the handling switch. LGTM, Acked-by: Ilya Maximets > > lib/librte_vhost/vhost_user.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 00872c868..618d413fe 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1087,6 +1087,7 @@ vhost_user_msg_handler(int vid, int fd) > > } > > + ret = 0; > switch (msg.request) { > case VHOST_USER_GET_FEATURES: > msg.payload.u64 = vhost_user_get_features(); >