On Tue, Aug 27, 2013 at 11:08:08AM -0700, Alex Wang wrote: > This is pretty cool !
Thanks. > Do you know how i can try compile for RISC? You need a RISC platform. There are many, but none of them is really popular in a desktop setting. I do have an old SPARC machine (SunBlade 100), that belongs to Justin, in my office. (I use it to hold up my monitor, so sometimes I say that it is my "platform" for OVS development.) You could borrow it if you want. It is quite slow. > One possible issue below: > > > > /* The IPv6 flow label is in the lower 20 bits of the first 32-bit word. > > */ > > diff --git a/lib/unaligned.h b/lib/unaligned.h > > index 2654a27..154eb13 100644 > > --- a/lib/unaligned.h > > +++ b/lib/unaligned.h > > @@ -175,6 +175,21 @@ put_unaligned_u64(uint64_t *p, uint64_t x) > > } > > > > /* Returns the value in 'x'. */ > > +static inline uint32_t > > +get_16aligned_u32(const ovs_16aligned_u32 *x) > > +{ > > + return ((uint32_t) x->hi << 16) | x->lo; > > +} > > + > > +/* Stores 'value' in 'x'. */ > > +static inline void > > +put_16aligned_u32(ovs_16aligned_u32 *x, uint32_t value) > > +{ > > + x->hi = value >> 16; > > + x->lo = value; > > +} > > + > > +/* Returns the value in 'x'. */ > > static inline uint64_t > > get_32aligned_u64(const ovs_32aligned_u64 *x) > > { > > @@ -191,6 +206,30 @@ put_32aligned_u64(ovs_32aligned_u64 *x, uint64_t > > value) > > Why don't we differentiate big/small endian here for "put_16aligned_u32()"? Because we instead order the fields differently for big-endian and little-endian: typedef struct { #ifdef WORDS_BIGENDIAN uint16_t hi, lo; #else uint16_t lo, hi; #endif } ovs_16aligned_u32; > And why do we differentiate big/small endian here for > "put_16aligned_be32()"? Isn't be32 already big endian? Yes, be32 is already big endian, but an ovs_be32 has different values as seen on big-endian and little-endian machines (otherwise ntohl() would not be necessary). Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev