Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754456AbbG2W06 (ORCPT ); Wed, 29 Jul 2015 18:26:58 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:34566 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754197AbbG2W0x (ORCPT ); Wed, 29 Jul 2015 18:26:53 -0400 Date: Wed, 29 Jul 2015 15:26:51 -0700 (PDT) Message-Id: <20150729.152651.331017965932467028.davem@davemloft.net> To: decui@microsoft.com Cc: gregkh@linuxfoundation.org, stephen@networkplumber.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, kys@microsoft.com, pebolle@tiscali.nl, stefanha@redhat.com, vkuznets@redhat.com, dan.carpenter@oracle.com Subject: Re: [PATCH V4 4/7] Drivers: hv: vmbus: add APIs to register callbacks to process hvsock connection From: David Miller In-Reply-To: <1438086911-19384-1-git-send-email-decui@microsoft.com> References: <1438086911-19384-1-git-send-email-decui@microsoft.com> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 29 Jul 2015 15:26:52 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 28 From: Dexuan Cui Date: Tue, 28 Jul 2015 05:35:11 -0700 > With the 2 APIs supplied by the VMBus driver, the coming net/hvsock driver > can register 2 callbacks and can know when a new hvsock connection is > offered by the host, and when a hvsock connection is being closed by the > host. > > Signed-off-by: Dexuan Cui This is an extremely terrible interface. It's an opaque hook that allows on registry, and it's solve purpose is to allow a backdoor call into a foreign driver in another module. These are exactly the things we try to avoid. Why not create a real abstraction where clients register an object, that can be contained as a sub-member inside of their own driver private, that provides the callback registry mechanism. That way you can register multiple clients, do things like allow AF_PACKET capturing of vmbus traffic, etc. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/