Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660AbdCPUG2 (ORCPT ); Thu, 16 Mar 2017 16:06:28 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]:32956 "EHLO mail-qk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbdCPUG1 (ORCPT ); Thu, 16 Mar 2017 16:06:27 -0400 MIME-Version: 1.0 In-Reply-To: References: From: "Joshua R. Poulson" Date: Thu, 16 Mar 2017 13:06:05 -0700 Message-ID: Subject: Re: [PATCH] HV: properly delay KVP packets when negotiation is in progress To: Long Li Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1835 Lines: 43 This should be submitted to stable, we're seeing KVP fail to start in some tests of 4.10. On Thu, Mar 16, 2017 at 12:51 PM, Long Li wrote: > The host may send multiple KVP packets before the negotiation with daemon > is finished. We need to keep those packets in ring buffer until the daemon > is negotiated and connected. > > This patch is based on the work of Nick Meier > > Signed-off-by: Long Li > --- > drivers/hv/hv_kvp.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c > index de26371..b9f928d 100644 > --- a/drivers/hv/hv_kvp.c > +++ b/drivers/hv/hv_kvp.c > @@ -628,16 +628,17 @@ void hv_kvp_onchannelcallback(void *context) > NEGO_IN_PROGRESS, > NEGO_FINISHED} host_negotiatied = NEGO_NOT_STARTED; > > - if (host_negotiatied == NEGO_NOT_STARTED && > - kvp_transaction.state < HVUTIL_READY) { > + if (kvp_transaction.state < HVUTIL_READY) { > /* > * If userspace daemon is not connected and host is asking > * us to negotiate we need to delay to not lose messages. > * This is important for Failover IP setting. > */ > - host_negotiatied = NEGO_IN_PROGRESS; > - schedule_delayed_work(&kvp_host_handshake_work, > + if (host_negotiatied == NEGO_NOT_STARTED) { > + host_negotiatied = NEGO_IN_PROGRESS; > + schedule_delayed_work(&kvp_host_handshake_work, > HV_UTIL_NEGO_TIMEOUT * HZ); > + } > return; > } > if (kvp_transaction.state > HVUTIL_READY) > -- > 2.7.4