[ovs-dev] [PATCH] datapath: Tolerate backporting of rtnl_link_stats64 (as done on RHEL 6).

Jesse Gross jesse at nicira.com
Fri Feb 4 01:42:59 UTC 2011


On Thu, Feb 3, 2011 at 4:04 PM, Ben Pfaff <blp at nicira.com> wrote:
> Red Hat Enterprise Linux 6 has a 2.6.32 kernel but it backports the
> rtnl_link_stats64 structure that was introduced in 2.6.35, so we need to
> check whether it was defined instead of just guessing based on the kernel
> version number.
>
> Build-tested only, on 2.6.32-71.14.1.el6 (RHEL 6),
> linux-2.6.18-128.1.6.el5.xs5.5.0.496.101 (XenServer 5.5.0),
> 2.6.18-128.1.6.el5.xs5.5.0.505.1024xen (XenServer 5.5.0 update 1),
> and upstream 2.6.18, 2.6.26, 2.6.29, 2.6.33, 2.6.34, 2.6.36, all for i386,
> plus 2.6.36 for x86-64.
>
> My machine's userspace headers have <linux/if_link.h> but not
> rtnl_link_stats64.  I didn't test with other userspace headers.

The problem that I ran into (and with this as well) is that the
userspace header check never finds rtnl_link_stats64 even if it
exists.  So on my machine, which has 2.6.35 userspace and kernel, I
get:

In file included from ./include/openvswitch/datapath-protocol.h:70,
                 from ./lib/flow.h:27,
                 from ofproto/fail-open.h:22,
                 from ofproto/fail-open.c:18:
./include/linux/if_link.h:23: error: redefinition of ‘struct rtnl_link_stats64’
In file included from ./include/openvswitch/datapath-protocol.h:70,
                 from ./lib/flow.h:27,
                 from ofproto/in-band.h:20,
                 from ofproto/in-band.c:18:
./include/linux/if_link.h:23: error: redefinition of ‘struct rtnl_link_stats64’
make[2]: *** [ofproto/fail-open.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ./include/openvswitch/datapath-protocol.h:70,
                 from ./lib/flow.h:27,
                 from ofproto/netflow.h:21,
                 from ofproto/netflow.c:18:
./include/linux/if_link.h:23: error: redefinition of ‘struct rtnl_link_stats64’
make[2]: *** [ofproto/in-band.o] Error 1
In file included from ./include/openvswitch/datapath-protocol.h:70,
                 from ./lib/dpif.h:25,
                 from ofproto/discovery.c:28:
./include/linux/if_link.h:23: error: redefinition of ‘struct rtnl_link_stats64’
make[2]: *** [ofproto/discovery.o] Error 1
make[2]: *** [ofproto/netflow.o] Error 1
make[2]: Leaving directory `/home/jesse/openvswitch'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jesse/openvswitch'
make: *** [all] Error 2




More information about the dev mailing list