Subject: Re: why is it not allowed to add a new socket protocol family as an external module?

From: Chris Friesen <[email-masked]>
Date: Thu, 21 Feb 2013 11:58:04 -0600

On 02/21/2013 10:43 AM, Eric Dumazet wrote:
> On Thu, 2013-02-21 at 09:47 -0600, Chris Friesen wrote:

>> The three lock_class_key structs (corresponding to
>> af_family_keys/af_family_slock_keys/af_callback_keys) can be
>> auto-allocated by the network core at dynamic registration time.
>
> Nope, this was the point I specifically raised but you missed it
>
> Take a look at kernel/lockdep.c, lines 2981-2988
>
> All the other stuff you mention seems pretty obvious.

Ah, sorry.  I'm not familiar with the guts of lockdep, so I was not 
aware that the keys needed to be static.

Given that the lockdep code considers module addresses to be okay, it 
should work to make the keys static in the KLM implementing the new 
protocol and pass the addresses in at registration time.

Chris