netdev
[Top] [All Lists]

Re: [PATCH] af_pppox: create module infrastructure for protocol modules

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: [PATCH] af_pppox: create module infrastructure for protocol modules
From: Max Krasnyansky <maxk@xxxxxxxxxxxx>
Date: 30 Apr 2003 11:11:37 -0700
Cc: acme@xxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20030429.192931.104061911.davem@xxxxxxxxxx>
Organization:
References: <20030428.222728.48508327.davem@xxxxxxxxxx> <20030429065419.GN25361@xxxxxxxxxxxxxxxx> <5.1.0.14.2.20030429123317.10d71178@xxxxxxxxxxxxxxxxxxxxx> <20030429.192931.104061911.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Tue, 2003-04-29 at 19:29, David S. Miller wrote:
>    From: Max Krasnyansky <maxk@xxxxxxxxxxxx>
>    Date: Tue, 29 Apr 2003 13:05:08 -0700
> 
>    - Why do we have to bump module refcount for 'struct sock' with
>      _default_ callbacks ?
> 
> Nothing says that just because a sock uses default callbacks, it can't
> be referenced in other ways by the implementation module, for example
> it can sit in the protocol hash tables and that by itself requires
> a module reference.
That's a good point. However this is protocol's local business.
Netcore does not use those hashes directly. Netcore only uses things
like sk->state, sk->lock, etc and callbacks. So the callback is the only
reference, from netcore's point of view, into the protocol module.
Most protocols that I've looked at unlink sk from its hashes in
proto_sock_release(struct socket *sock) so it's enough to make sure that
struct socket is accounted for.  
And like I said before if protocol wants for some reason to be around
until sk is destroyed it will simply do sk_set_owner() right after
alloc_sk().

Max


<Prev in Thread] Current Thread [Next in Thread>