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 695451B3FD for ; Thu, 29 Nov 2018 09:49:15 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3BF0804F5; Thu, 29 Nov 2018 08:49:14 +0000 (UTC) Received: from [10.36.112.61] (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 356301055007; Thu, 29 Nov 2018 08:49:12 +0000 (UTC) To: Luca Boccassi , stable@dpdk.org Cc: i.maximets@samsung.com References: <20181128162054.8182-1-bluca@debian.org> From: Maxime Coquelin Message-ID: <9d9eddef-a1e0-1898-0597-9464e8414db0@redhat.com> Date: Thu, 29 Nov 2018 09:49:10 +0100 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Nov 2018 08:49:14 +0000 (UTC) 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 08:49:15 -0000 On 11/28/18 5:20 PM, 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. > > 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(); > Reviewed-by: Maxime Coquelin Thanks! Maxime