[ovs-dev] [IPv6 IV: A New Hope 5/6] nicira-ext: Support matching IPv6 traffic.

Ben Pfaff blp at nicira.com
Tue Feb 1 22:37:34 UTC 2011


On Tue, Feb 01, 2011 at 02:25:24PM -0800, Justin Pettit wrote:
> On Feb 1, 2011, at 1:23 PM, Ben Pfaff wrote:
> 
> > On Tue, Feb 01, 2011 at 12:53:52AM -0800, Justin Pettit wrote:
> >> Provides ability to match over IPv6 traffic in the same manner as IPv4.
> >> Currently, the matching fields include:
> >> 
> >>    - IPv6 source and destination addresses (ipv6_src and ipv6_dst)
> >>    - Traffic Class (nw_tos)
> >>    - Next Header (nw_proto)
> >>    - ICMPv6 Type and Code (icmp_type and icmp_code)
> >>    - TCP and UDP Ports over IPv6 (tp_src and tp_dst)
> >> 
> >> When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to
> >> OVS must be used.
> >> 
> >> Signed-off-by: Justin Pettit <jpettit at nicira.com>
> > 
> > One omission I just noticed is that this does not update
> > hash_symmetric_l4() in multipath.c to spread IPv6 flows across the
> > links.
> 
> Isn't that single IPv6 flow on the Internet already self-balancing?  I
> kid, I kid.
> 
> I totally missed that, so thanks for pointing that out.  Below is a
> diff that I plan to fold into this patch, if it looks reasonable.  I
> took out the code that sets unused values to zero, since the entire
> field is now being memset to zero.

This addition looks good to me, thanks.

By the way, we keep running into code that wants to regard an IPv6
address as 32-bit units if possible, or 8-bit units if that's all the
system has.  Have you thought about defining some macros to help?

    #ifdef s6_addr32
    #define s6_bigaddr s6_addr32
    #define S6_NBIG 4
    typedef ovs_be32 s6_bigunit;
    #else
    #define s6_bigaddr s6_addr
    #define S6_NBIG 16
    typedef uint8_t s6_bigunit;
    #endif

ideally with better names.

Then you could do things like this:

        const s6_bigunit *a = &flow->ipv6_src.s6_bigaddr[0];
        const s6_bigunit *b = &flow->ipv6_dst.s6_bigaddr[0];
        s6_bigunit *ipv6_addr = &fields.ipv6_addr.big_addr[0];

        for (i=0; i<S6_NBIG; i++) {
            ipv6_addr[i] = a[i] ^ b[i];
        }

and get the benefits of 32-bit words where we can but avoid duplicating
code.




More information about the dev mailing list