All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gatzka <stephan.gatzka@gmail.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net, yoshfuji@linux-ipv6.org,
	netdev@vger.kernel.org
Subject: Re: IPv6 over firewire
Date: Sat, 12 Jan 2013 11:54:47 +0100	[thread overview]
Message-ID: <50F140F7.60503@gmail.com> (raw)
In-Reply-To: <20130112102452.13babc65@stein>

> But if a new callback is needed, it doesn't have to burden the kernel much:
>
>    - In the linux-kernel OOP model, there are mandatory methods as well
>      as optional methods.  A new method for RFC 3146 Neighbor Discovery
>      should of course be an optional one.
>
>    - There is a downside to optional methods:  The core code which may
>      have to use the method first needs to do a NULL check of the
>      method's function pointer or needs to check a correlated
>      capabilities flag or something like that.  Such additional checks
>      are undesirable in hot paths, but I suppose IPv6 Neighbor Discovery
>      is not a particularly hot path.

Yes, that should be true.

>
>    - There is another downside:  Each new driver method increases the
>      memory footprint of instances of respective function pointer tables
>      by 4 or 8 bytes.

I can't imagine that this is a show stopper. How many instances of 
struct netdev do we have o a typical system? I guess not the much.

>
> Both downsides can be countered somewhat by enclosing the respective
> code into #ifdef CONFIG_RFC3146_NDISC...#endif and have something like
>      select RFC3146_NDISC if IPV6 = y || (IPV6 = m && FIREWIRE_NET = m)
> in the "config FIREWIRE_NET" section.
>
> But the new callback (if one is really needed) doesn't have to be a driver
> method.  It could also look about like this:
>
>      include/net/ndisc.h:
>      -extern struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
>      -		struct ndisc_options *ndopts);
>      +extern struct ndisc_options *__ndisc_parse_options(u8 *opt,
>      +		int opt_len, struct ndisc_options *ndopts,
>      +		whatever_type *callback);
>      +
>      +static inline struct ndisc_options *ndisc_parse_options(u8 *opt,
>      +		int opt_len, struct ndisc_options *ndopts)
>      +{
>      +	return __ndisc_parse_options(opt, len, ndopts, NULL);
>      +}
>
>      net/ipv6/ndisc.c:
>      -struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
>      -		struct ndisc_options *ndopts)
>      +struct ndisc_options *__ndisc_parse_options(u8 *opt, int opt_len,
>      +		struct ndisc_options *ndopts, whatever_type *callback)
>       {
>
> Or the (optional!) callback could be a new member of struct ndisc_options.

Hm, right now I have no opinion on that. Where does
whatever_type *callback comes from? Is it an exported method of the 
firewire net driver or the new function pointer in struct netdevice?

> However, does net/ipv6/ndisc.c really need to be aware of the RFC 3146
> Neighbor Discovery related packet header layouts?  Isn't it possible to
> rewrite these headers in-place in drivers/firewire/net.c?


Yes, it it possible, but yoshfuji strongly voted against rewriting ndisc 
packets in firewire net driver to maintain extensibility to protocols. 
Especially IPSEC can just not work if I rewrite the packets in the driver.

Regards,

Stephan


-- 
Welchen Unterschied gibt es zwischen einem toten Hund auf der
Straße und einer überfahrenen Bratsche auf der Straße? Vor dem
toten Hund gibt es Bremsspuren.

  reply	other threads:[~2013-01-12 10:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <50EF1AEB.1080704@gmail.com>
     [not found] ` <50EFE095.2040505@linux-ipv6.org>
     [not found]   ` <50F10C53.4000803@gmail.com>
2013-01-12  8:27     ` IPv6 over firewire Stefan Richter
     [not found] ` <20130110210912.09c62d38@stein>
     [not found]   ` <50F10E94.9090302@gmail.com>
2013-01-12  9:24     ` Stefan Richter
2013-01-12 10:54       ` Stephan Gatzka [this message]
2013-01-12 13:57         ` Stefan Richter
2013-01-12 14:37         ` Stefan Richter
2013-01-12 14:42           ` Stephan Gatzka
2012-12-21 17:03 IPv6 over Firewire Stephan Gatzka
2012-12-21 17:53 ` YOSHIFUJI Hideaki
2012-12-21 18:39   ` Stephan Gatzka
2012-12-21 19:49     ` YOSHIFUJI Hideaki
2012-12-21 23:12       ` Stefan Richter
2012-12-22  6:03         ` Stephan Gatzka
2012-12-22  6:10       ` Stephan Gatzka
2012-12-22  9:15         ` Stefan Richter
2012-12-22 18:33           ` Stephan Gatzka
2012-12-23  8:23         ` YOSHIFUJI Hideaki
2012-12-23 11:13           ` Stephan Gatzka
2012-12-23 12:09             ` YOSHIFUJI Hideaki
2012-12-23 13:25               ` Stephan Gatzka
2012-12-23 17:09                 ` YOSHIFUJI Hideaki
2012-12-23 18:25                   ` Stephan Gatzka
2012-12-23 19:38                     ` YOSHIFUJI Hideaki
2012-12-23 23:52                     ` Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F140F7.60503@gmail.com \
    --to=stephan.gatzka@gmail.com \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.