netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: yoshfuji Hideaki <yoshfuji@linux-ipv6.org>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC, PATCH] IPV6 : add 64 bits components in struct in6_addr to speedup ipv6_addr_equal() & ipv6_addr_any()
Date: Mon, 30 Apr 2007 12:27:07 -0400	[thread overview]
Message-ID: <463618DB.7020309@hp.com> (raw)
In-Reply-To: <20070430162851.ca3c7869.dada1@cosmosbay.com>

Eric Dumazet wrote:
> On 64bit arches, we can speedup some IPV6 addresses compares, using 64 bits fields in struct in6_addr.

> diff --git a/include/linux/in6.h b/include/linux/in6.h
> index 2a61c82..a4241a6 100644
> --- a/include/linux/in6.h
> +++ b/include/linux/in6.h
> @@ -34,10 +34,12 @@ struct in6_addr
>  		__u8		u6_addr8[16];
>  		__be16		u6_addr16[8];
>  		__be32		u6_addr32[4];
> +		__be64		u6_addr64[2];
>  	} in6_u;
>  #define s6_addr			in6_u.u6_addr8
>  #define s6_addr16		in6_u.u6_addr16
>  #define s6_addr32		in6_u.u6_addr32
> +#define s6_addr64		in6_u.u6_addr64
>  };

I also had this idea back in 2004:

 >> I will eventually do a 64-bit comparison to see if putting an
 >> #ifdef CONFIG_64BIT is worth it.
 >
 > No, because we cannot assume 64bit alignment.
 >
 > --yoshfuji

The problem is that drivers don't necessarily align the address on the 
correct boundary, so on some 64-bit arches this could be fatal.  There's 
ways around it since I did it in a previous life, but you'd need to copy 
the addresses and hide them in the skb in the rare case, neither of 
which is a great thing to do.

Unless Yoshifuji has a better solution...

-Brian

  parent reply	other threads:[~2007-04-30 16:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 14:28 [RFC, PATCH] IPV6 : add 64 bits components in struct in6_addr to speedup ipv6_addr_equal() & ipv6_addr_any() Eric Dumazet
2007-04-30 16:09 ` YOSHIFUJI Hideaki / 吉藤英明
2007-04-30 16:27 ` Brian Haley [this message]
2007-04-30 18:59   ` David Miller
2007-04-30 19:08     ` Eric Dumazet
2007-04-30 19:22       ` David Miller
2007-04-30 19:10 ` David Miller
2007-04-30 21:34   ` Andi Kleen
2007-04-30 20:37     ` David Miller

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=463618DB.7020309@hp.com \
    --to=brian.haley@hp.com \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).