[ovs-dev] [PATCH 1/4 v2] Add extentions to the standard datapath interface
nithin at vmware.com
Tue Aug 19 16:03:09 UTC 2014
> Is there any objection if we directly include OvsDpInterfaceExt.h in
> userspace (with the right #ifdefs, of course)? I don't understand why we
> would want to auto-generate a file just to include the kernel header file.
> This is what the auto-generated file is supposed to look like -
> * Header file to include platform-specific extensions to the standard
> * datapath interface defined in odp-netlink.h.
> #ifdef _WIN32
> #include "OvsDpInterfaceExt.h"
Ben might provide more clarification, but here's my perspective.
Some preceding examples where we try not to have #ifdef _WIN32 for header file inclusions are files that include dirent.h, netdb.h, poll.h or strings.h. These are defined as no-op files in include/windows.
It seems the idea is to keep the common code 'clean' of platform specific #ifdef's as much as possible. These tricks add no cost, but keep the code clean.
Regarding auto-generation (though we don't do it today), the preceding example is openvswitch.h based on which odp-netlink.h is generated. Some reasons that I can think of to auto-generate a userspace file from OvsDpInterfaceExt.h are if we use Windows specific data types Eg. ULONG in the OvsDpInterfaceExt.h. The auto generation script would replace ULONG with the userspace equivalent so that the common code does not have to use ULONG.
More information about the dev