public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Long Li <longli@microsoft.com>
Cc: KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] HV: properly delay KVP packets when negotiation is in progress
Date: Fri, 17 Mar 2017 17:15:51 +0100	[thread overview]
Message-ID: <87inn7c214.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BN3PR03MB222794D9E4F731620BF7E8FBCE260@BN3PR03MB2227.namprd03.prod.outlook.com> (Long Li's message of "Thu, 16 Mar 2017 19:51:26 +0000")

Long Li <longli@microsoft.com> writes:

> 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.

The patch looks OK but previously we always presumed that this can't
happen for util drivers and host will never send a new request before we
answer to the previous one. If this is not true we may have more issues
which need fixing as all three drivers we have are written in a
'transaction' fashion.

So my question would be: can the host send multiple (KVP) packets
_after_ the negotiation with daemon is finished?


>
> This patch is based on the work of Nick Meier <Nick.Meier@microsoft.com>
>
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>  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)

-- 
  Vitaly

  parent reply	other threads:[~2017-03-17 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 19:51 [PATCH] HV: properly delay KVP packets when negotiation is in progress Long Li
2017-03-16 20:06 ` Joshua R. Poulson
2017-03-17 16:15 ` Vitaly Kuznetsov [this message]
2017-03-20  2:49   ` Long Li
2017-03-20 22:44     ` Long Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87inn7c214.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox