linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Vitaly Kuznetsov <vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "K. Y. Srinivasan" <kys-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
	devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org,
	Haiyang Zhang <haiyangz-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dexuan Cui <decui-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel communication to using char device
Date: Tue, 3 Mar 2015 20:47:07 +0100	[thread overview]
Message-ID: <20150303194707.GG25123@potion.brq.redhat.com> (raw)
In-Reply-To: <87pp8qif00.fsf-hpI3/L/TUU23oHxwIazZmlaTQe2KTcn/@public.gmane.org>

2015-03-03 10:53+0100, Vitaly Kuznetsov:
> Radim Krčmář <rkrcmar-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> writes:
> > 2015-02-27 17:14+0100, Vitaly Kuznetsov:
> >> Re-implement the communication using misc char device. Use ioctl to do
> >> kernel/userspace version negotiation (doesn't make much sense at this moment
> >> as we're breaking backwards compatibility but can be used in future).
> >
> > The ioctl is used too creatively for my liking: as an out-of-band
> > communication that is required after the main channel has been opened.
> > It would be simpler to inject the version into first x bytes of the
> > stream, making a read() after open() mandatory.
> 
> We need to perform a handshake - kernel part sends its version and
> receives daemon's version.

(We could also design a backward-compatible protocol, which should be
 possible for an application this simple, but keeping options is wise.)

>                            We can definitelly pack everything in the
> data stream but why do we need to avoid ioctls?

I think it is better if the kernel sends its version (set of features)
first, so it would be just a simple two-way handshake.

Kernel-initiated communication is not possible over ioctl and it doesn't
give extra options for handshake either.

>                                                 It seems to me the
> handshake we're performing here belongs to a 'control' stream, not
> 'data' stream.

Handshake makes sense after we open the device and before any 'data' can
appear on it, so multiplexing the same carrier also prevents a lot of
stupid cases, like ioctls from different applications.
Not to mention that asynchronicity itself has a fairly bad record.

(I don't really understand the difference between 'control' and 'data'.)

  parent reply	other threads:[~2015-03-03 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 16:14 [PATCH RFC 0/3] Drivers: hv: utils: re-implement the kernel/userspace communication layer Vitaly Kuznetsov
2015-02-27 16:14 ` [PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel communication to using char device Vitaly Kuznetsov
     [not found]   ` <1425053665-635-2-git-send-email-vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-02-27 20:27     ` Radim Krčmář
2015-03-03  9:53       ` Vitaly Kuznetsov
     [not found]         ` <87pp8qif00.fsf-hpI3/L/TUU23oHxwIazZmlaTQe2KTcn/@public.gmane.org>
2015-03-03 19:47           ` Radim Krčmář [this message]
2015-02-27 16:14 ` [PATCH RFC 2/3] Drivers: hv: vss: " Vitaly Kuznetsov
2015-02-27 16:14 ` [PATCH RFC 3/3] Drivers: hv: fcopy: make it consistent with vss/kvp Vitaly Kuznetsov
     [not found] ` <1425053665-635-1-git-send-email-vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-02-27 21:07   ` [PATCH RFC 0/3] Drivers: hv: utils: re-implement the kernel/userspace communication layer Radim Krčmář
     [not found]     ` <20150227210744.GA11904-KfRq7+sF/6zkZJWtSm8s3NvLeJWuRmrY@public.gmane.org>
2015-03-02 13:33       ` Vitaly Kuznetsov
2015-03-02  2:11 ` KY Srinivasan
2015-03-02 13:37   ` Vitaly Kuznetsov

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=20150303194707.GG25123@potion.brq.redhat.com \
    --to=rkrcmar-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=decui-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=haiyangz-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=kys-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).