OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_get_be16])
OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_find_nested])
+ OVS_GREP_IFELSE([$KSRC26/include/linux/if_link.h], [rtnl_link_stats64])
+
OVS_CHECK_LOG2_H
if cmp -s datapath/linux-2.6/kcompat.h.new \
-# Copyright (c) 2008, 2009, 2010 Nicira Networks
+# Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
OVS_CHECK_NETLINK
OVS_CHECK_OPENSSL
OVS_CHECK_LOGDIR
+OVS_CHECK_RTNL_LINK_STATS64
OVS_CHECK_PYTHON
OVS_CHECK_PYUIC4
OVS_CHECK_OVSDBMONITOR
#include <linux/version.h>
+#ifdef HAVE_RTNL_LINK_STATS64
+#include_next <linux/if_link.h>
+#else /* !HAVE_RTNL_LINK_STATS64 */
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
#include_next <linux/if_link.h>
#else
* turn only really needs __u64. */
#include <linux/types.h>
#include <linux/netlink.h>
-#endif
+#endif /* kernel < 2.6.19 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
/* The main device statistics structure */
struct rtnl_link_stats64 {
__u64 rx_packets; /* total packets received */
__u64 rx_compressed;
__u64 tx_compressed;
};
-#endif /* linux kernel < 2.6.35 */
+#endif /* !HAVE_RTNL_LINK_STATS64 */
#endif
# -*- autoconf -*-
-# Copyright (c) 2008, 2009, 2010 Nicira Networks.
+# Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
[ndebug=false])
AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])])
+dnl Checks for struct rtnl_link_stats64.
+dnl
+dnl (OVS checks for this structure in both kernel and userspace headers. This
+dnl is not redundant, because the kernel and userspace builds have completely
+dnl different include paths. It is possible for the kernel to have this
+dnl structure but not userspace, and vice versa.)
+AC_DEFUN([OVS_CHECK_RTNL_LINK_STATS64],
+ [AC_REQUIRE([OVS_CHECK_NETLINK])
+ if test $HAVE_NETLINK = yes; then
+ AC_CHECK_MEMBER(
+ [struct rtnl_link_stats64.tx_packets],
+ [AC_DEFINE([HAVE_RTNL_LINK_STATS64], [1],
+ [Define to 1 if <linux/if_link.h> defines
+ struct rtnl_link_stats64.])],
+ [], [#include <sys/socket.h> /* Provides sa_family_t. */
+#include <linux/if_link.h>
+])
+ fi])
+
dnl Checks for Netlink support.
AC_DEFUN([OVS_CHECK_NETLINK],
[AC_CHECK_HEADER([linux/netlink.h],