From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756072AbbCCJxe (ORCPT ); Tue, 3 Mar 2015 04:53:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755874AbbCCJxa (ORCPT ); Tue, 3 Mar 2015 04:53:30 -0500 From: Vitaly Kuznetsov To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: "K. Y. Srinivasan" , devel@linuxdriverproject.org, Haiyang Zhang , linux-kernel@vger.kernel.org, Dexuan Cui , Greg Kroah-Hartman , linux-api@vger.kernel.org Subject: Re: [PATCH RFC 1/3] Drivers: hv: kvp: convert userspace/kernel communication to using char device References: <1425053665-635-1-git-send-email-vkuznets@redhat.com> <1425053665-635-2-git-send-email-vkuznets@redhat.com> <20150227202715.GF2034@potion.brq.redhat.com> Date: Tue, 03 Mar 2015 10:53:19 +0100 In-Reply-To: <20150227202715.GF2034@potion.brq.redhat.com> ("Radim \=\?utf-8\?B\?S3LEjW3DocWZIidz\?\= message of "Fri, 27 Feb 2015 21:27:15 +0100") Message-ID: <87pp8qif00.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Radim Krčmář 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 main question is whether we want to abolish backward compatibility; > kernel rules are usually against breakages and it's hard to prove that > the bundled daemon is a sole user and gets updated at the same time. > (Note: I'd gladly break anything.) > > 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 can definitelly pack everything in the data stream but why do we need to avoid ioctls? It seems to me the handshake we're performing here belongs to a 'control' stream, not 'data' stream. > > (I've only done a high level overview so far.) Thanks! -- Vitaly