All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
@ 2012-09-05 11:14 Thomas Graf
  2012-09-05 17:06 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Graf @ 2012-09-05 11:14 UTC (permalink / raw)
  To: davem; +Cc: netdev

Several out of the tree modules use the exported symbol arp_tbl
to read the ARP table. These modules now seek to support IPv6
but can't because nd_tbl is not exported.

Having access to the protocol specific neigh_table structure is
required in order to use the functions neigh_lookup() or
neigh_create() which are already exported to modules.

It does not make sense to export these functions if we don't
export the table itself as well.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 net/ipv6/ndisc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index ff36194..0a0eb3f 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -143,6 +143,8 @@ struct neigh_table nd_tbl = {
 	.gc_thresh3 =	1024,
 };
 
+EXPORT_SYMBOL(nd_tbl);
+
 static inline int ndisc_opt_addr_space(struct net_device *dev)
 {
 	return NDISC_OPT_SPACE(dev->addr_len + ndisc_addr_option_pad(dev->type));
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
  2012-09-05 11:14 [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6 Thomas Graf
@ 2012-09-05 17:06 ` David Miller
  2012-09-06  8:51   ` Thomas Graf
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-09-05 17:06 UTC (permalink / raw)
  To: tgraf; +Cc: netdev

From: Thomas Graf <tgraf@suug.ch>
Date: Wed,  5 Sep 2012 13:14:08 +0200

> It does not make sense to export these functions if we don't
> export the table itself as well.

Yes it does make perfect sense.  It's exported for the sake of the
_implementation_ of a neighbour table in a kernel module.

I do not want to add more users with direct access to the neighbour
tables, because it is therefore impossible to go and add the inline
refcount'less lookups et al. to those external users.

So if one of our goals is to move towards a situation where all neigh
accesses are refcount'less, having those external users makes that
nearly impossible.

Instead, I'd rather see patches that mark arp_tbl as being exported
only for internal usage inside of the tree, so that we can reach that
goal.

I'm not applying this, sorry.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
  2012-09-05 17:06 ` David Miller
@ 2012-09-06  8:51   ` Thomas Graf
  2012-09-06 17:47     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Graf @ 2012-09-06  8:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Wed, Sep 05, 2012 at 01:06:36PM -0400, David Miller wrote:
> So if one of our goals is to move towards a situation where all neigh
> accesses are refcount'less, having those external users makes that
> nearly impossible.
> 
> Instead, I'd rather see patches that mark arp_tbl as being exported
> only for internal usage inside of the tree, so that we can reach that
> goal.
> 
> I'm not applying this, sorry.

Fair enough

Does that mean you dismiss neighbour lookups by external users in
general in order to get rid of the refcnt?

Assuming that lookups would still be ok, would an ipv6 version of
__ipv4_neigh_lookup() be an acceptable API for external users?
(Yes there is __ipv6_neigh_lookup() already but unlike the ipv4 version
it takes the table as first argument)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
  2012-09-06  8:51   ` Thomas Graf
@ 2012-09-06 17:47     ` David Miller
  2012-09-06 21:06       ` Thomas Graf
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-09-06 17:47 UTC (permalink / raw)
  To: tgraf; +Cc: netdev

From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 6 Sep 2012 04:51:02 -0400

> On Wed, Sep 05, 2012 at 01:06:36PM -0400, David Miller wrote:
>> So if one of our goals is to move towards a situation where all neigh
>> accesses are refcount'less, having those external users makes that
>> nearly impossible.
>> 
>> Instead, I'd rather see patches that mark arp_tbl as being exported
>> only for internal usage inside of the tree, so that we can reach that
>> goal.
>> 
>> I'm not applying this, sorry.
> 
> Fair enough
> 
> Does that mean you dismiss neighbour lookups by external users in
> general in order to get rid of the refcnt?
> 
> Assuming that lookups would still be ok, would an ipv6 version of
> __ipv4_neigh_lookup() be an acceptable API for external users?
> (Yes there is __ipv6_neigh_lookup() already but unlike the ipv4 version
> it takes the table as first argument)

Right now we're in a transition period where ipv4 is mostly refcount'less
and ipv6 is not.

This is part of the reason I don't want to expose these things, the
calling convention and locking requirements are going to be fluid for
any interface you might propose.

arp_tbl was exported only for in-tree users, and I therefore say that
we should only export nd_tbl for in-tree users as well, since that's
the only way we can audit and update all the referencing callers as
the semantics radically change.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6
  2012-09-06 17:47     ` David Miller
@ 2012-09-06 21:06       ` Thomas Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Graf @ 2012-09-06 21:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Thu, Sep 06, 2012 at 01:47:38PM -0400, David Miller wrote:
> Right now we're in a transition period where ipv4 is mostly refcount'less
> and ipv6 is not.
> 
> This is part of the reason I don't want to expose these things, the
> calling convention and locking requirements are going to be fluid for
> any interface you might propose.
> 
> arp_tbl was exported only for in-tree users, and I therefore say that
> we should only export nd_tbl for in-tree users as well, since that's
> the only way we can audit and update all the referencing callers as
> the semantics radically change.

Thanks for the explanations David. I'll pass this on to the involved
projects. We'll probably try to pick this up again as soon as the new
locking conventions have been put in place and are considered stable.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-06 21:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 11:14 [PATCH net-next] ipv6: Export nd_tbl to allow modules to support IPv6 Thomas Graf
2012-09-05 17:06 ` David Miller
2012-09-06  8:51   ` Thomas Graf
2012-09-06 17:47     ` David Miller
2012-09-06 21:06       ` Thomas Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.