lkml.org 
[lkml]   [2015]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4 4/7] Drivers: hv: vmbus: add APIs to register callbacks to process hvsock connection
From
From: Dexuan Cui <decui@microsoft.com>
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 <decui@microsoft.com>

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.


\
 
 \ /
  Last update: 2015-07-30 07:21    [W:0.154 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site