[ovs-dev] [PATCH v2] odp-netlink.h: Autogenerate a version of odp-netlink for windows kernel.

Ben Pfaff blp at nicira.com
Tue Aug 12 00:16:51 UTC 2014


OK.

I folded in the following changes.  They enable building the header on
all platforms (which is useful to allow developers on every platform
to test it) and drop unnecessary extra $(srcdir).  Also I removed a
redundant copy of the first line from the commit message.

I also removed the change to lib/netlink-protocol.h because I don't
understand it (does this mean that you're including netlink-protocol.h
from a kernel module? I don't recommend that) and it seems logically
separate in any case.

Thanks,

Ben.

diff --git a/datapath-windows/include/automake.mk b/datapath-windows/include/automake.mk
index bcd9d23..ac945cb 100644
--- a/datapath-windows/include/automake.mk
+++ b/datapath-windows/include/automake.mk
@@ -1,13 +1,10 @@
-if WIN32
 BUILT_SOURCES += $(srcdir)/datapath-windows/include/OvsDpInterface.h
 
 $(srcdir)/datapath-windows/include/OvsDpInterface.h: \
-         $(srcdir)/datapath/linux/compat/include/linux/openvswitch.h \
-         $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h
-
+         datapath/linux/compat/include/linux/openvswitch.h \
+         build-aux/extract-odp-netlink-windows-dp-h
 	sed -f $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h < $< > $@
 
 EXTRA_DIST += $(srcdir)/build-aux/extract-odp-netlink-windows-dp-h
 
 CLEANFILES += $(srcdir)/datapath-windows/include/OvsDpInterface.h
-endif


On Mon, Aug 11, 2014 at 11:01:47PM +0000, Ankur Sharma wrote:
> Hi Ben,
> 
> Thanks a lot for your reply.
> 
> The reason we did not generate header file in build directory is because as of now the windows datapath build is not coupled with user-space build.
> The userspace build system is 'make' and command line based, and the kernel is being compiled from Visual Studio. So, kernel code hardcodes the include directory in precomp.h.
> 
> One way to get around this issue is to pass a reference to the userspace build directory while building the kernel. But, this is not straight forward and would require messy hacks (given that we can build userspace and windows driver on different machines as well.).
> 
> That is the reason we decided to generate the file in src directory, which can be included in kernel easily.
> 
> Thanks.
> 
> Regards,
> Ankur
> 
> ________________________________________
> From: Ben Pfaff <blp at nicira.com>
> Sent: Monday, August 11, 2014 1:49 PM
> To: Ankur Sharma
> Cc: dev at openvswitch.org
> Subject: Re: [ovs-dev] [PATCH v2] odp-netlink.h: Autogenerate a version of odp-netlink for windows kernel.
> 
> On Mon, Aug 11, 2014 at 11:43:22AM -0700, Ankur Sharma wrote:
> > odp-netlink.h: Autogenerate a version of odp-netlink for windows kernel.
> >
> > Autogenerated odp-netlink.h will not compile with windows kernel, as
> > it refers to some userspace files like openvswitch/types.h and
> > packets.h which hyperv extension does not access. Due to this the
> > windows datapath compilation is broken on tip of tree. This patch
> > intends to fix that.
> >
> > In this patch we add a new sed script "extract-odp-netlink-windows-dp-h"
> > to create OvsDpInterface.h. It works on similar lines as
> > extract-odp-netlink-h, but avoids including the header files
> > which are not available for driver.
> >
> > Also, added saurabh's fix to not to include some header files
> > in lib/netlink-protocol.h not needed by windows driver.
> >
> > After this fix, a userspace build will be needed before windows
> > kernel datapath can be built.
> >
> > Tested that hyperv extension could be built after building
> > the userspace. Verified vxlan tunnel based ping across
> > hypervisors. Verified that odp-netlink-windows-dp.h is not
> > built for linux platform. Ran 'make distcheck' to verify that
> > nothing is broken on linux.
> >
> > Signed-off-by: Ankur Sharma <ankursharma at vmware.com>
> > Co-authored-by: Saurabh Shah <ssaurabh at vmware.com>
> > Tested-by: Ankur Sharma <ankursharma at vmware.com>
> > Reported-by: Alin Serdean <aserdean at cloudbasesolutions.com>
> > Reported-by: Nithin Raju <nithin at vmware.com>
> > Reported-at: https://urldefense.proofpoint.com/v1/url?u=https://github.com/openvswitch/ovs-issues/issues/21&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=f6EhnZ0ORGZNt5QbYmRaOxfWfx%2Bqd3KEiPf3%2FYaollU%3D%0A&m=sio8%2FDB5pO%2BD5uhQe1fsjAID07mcdP%2FjUmTQFc7ob94%3D%0A&s=a093970fd00b0d4b60e474cf4c20144dcc7d98a5743928f4e3044e142b740de4
> 
> Why does this generate the header in the source directory?  It should
> generate it in the build directory.



More information about the dev mailing list