On Fri, Jun 13, 2014 at 3:28 PM, Ben Pfaff <b...@nicira.com> wrote: > Until now, the OVS source tree has had a whole maze of header files that > make "#include <linux/openvswitch.h>" work OK regardless of platform, but > this confuses everyone new to the tree, at first glance, and is difficult > to understand at second glance too. > > This commit moves the core of the Netlink definitions that were in > include/linux/openvswitch.h into a new header > include/odp-netlink-internal.h, and then adds two wrappers: > > * datapath/linux/compat/include/linux/openvswitch.h: This wrapper > allows the Linux datapath code to continue using "#include > <linux/openvswitch.h>". > > * lib/odp-netlink.h: Userspace code uses this wrapper. > > This change allows all of the include/linux/* files to be deleted. > > Signed-off-by: Ben Pfaff <b...@nicira.com>
I'm somewhat worried that diverging our copy of linux/openvswitch.h will make things harder to maintain, especially since we've tried to reduce differences between upstream and the out-of-tree module as much as possible. I was imagining that we would model this as if we were compiling purely against the upstream kernel and openvswitch.h was an exported header (since it is, we just happen to have a compatibility backport). In that case, we wouldn't be able to change the original header and presumably Linux-specific code would translate to something OVS-internal. I remember talking about this before and we were worried about the cost of doing the translation. Looking at this a little more it seems like there are two steps - wrapping the Linux header file in an OS-independent name and adjusting the types to be OVS native. I suppose that we could do only the former and continue to use macros to do the latter. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev