From 3ea0fdd45c337833fd3b79b3c5b3ed47c2470a79 Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Sun, 13 Mar 2016 10:55:00 +0200 Subject: [PATCH] rdma.m4: Added test for en_ethtool_ops.get_rxfh_indir Signed-off-by: Vladimir Sokolovsky --- config/rdma.m4 | 70 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/config/rdma.m4 b/config/rdma.m4 index cc132fb..901d4ea 100644 --- a/config/rdma.m4 +++ b/config/rdma.m4 @@ -227,7 +227,7 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], #include ],[ const struct ethtool_ops en_ethtool_ops = { - .get_rxfh_indir_size = NULL, + .get_rxfh_key_size = NULL, .get_rxfh = NULL, .set_rxfh = NULL, }; @@ -241,61 +241,97 @@ AC_DEFUN([LINUX_CONFIG_COMPAT], AC_MSG_RESULT(no) ]) - - AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable]) + AC_MSG_CHECKING([if struct ethtool_ops has get_rxfh_indir_size]) LB_LINUX_TRY_COMPILE([ #include ],[ const struct ethtool_ops en_ethtool_ops = { - .get_tunable = NULL, - .set_tunable = NULL, + .get_rxfh_indir_size = NULL, }; return 0; ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GET_SET_TUNABLE, 1, - [get/set_tunable is defined]) + AC_DEFINE(HAVE_RXFH_INDIR_SIZE, 1, + [get_rxfh_indir_size is defined]) ],[ AC_MSG_RESULT(no) ]) - AC_MSG_CHECKING([if exist struct ethtool_ops_ext]) + AC_MSG_CHECKING([if struct ethtool_ops_ext has get_rxfh_indir_size]) LB_LINUX_TRY_COMPILE([ #include ],[ const struct ethtool_ops_ext en_ethtool_ops_ext = { - .size = sizeof(struct ethtool_ops_ext), + .get_rxfh_indir_size = NULL, }; return 0; ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1, - [struct ethtool_ops_ext is defined]) + AC_DEFINE(HAVE_RXFH_INDIR_SIZE_EXT, 1, + [get_rxfh_indir_size is defined in ethtool_ops_ext]) + ],[ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh_indir]) + LB_LINUX_TRY_COMPILE([ + #include + + int mlx4_en_get_rxfh_indir(struct net_device *d, u32 *r) + { + return 0; + } + ],[ + struct ethtool_ops en_ethtool_ops; + en_ethtool_ops.get_rxfh_indir = mlx4_en_get_rxfh_indir; + + return 0; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1, + [get/set_rxfh_indir is defined]) + ],[ + AC_MSG_RESULT(no) + ]) + + AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable]) + LB_LINUX_TRY_COMPILE([ + #include + ],[ + const struct ethtool_ops en_ethtool_ops = { + .get_tunable = NULL, + .set_tunable = NULL, + }; + + return 0; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GET_SET_TUNABLE, 1, + [get/set_tunable is defined]) ],[ AC_MSG_RESULT(no) ]) - AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh]) + AC_MSG_CHECKING([if exist struct ethtool_ops_ext]) LB_LINUX_TRY_COMPILE([ #include ],[ const struct ethtool_ops_ext en_ethtool_ops_ext = { - .get_rxfh_indir_size = NULL, - .get_rxfh = NULL, - .set_rxfh = NULL, + .size = sizeof(struct ethtool_ops_ext), }; return 0; ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GET_SET_RXFH_OPS_EXT, 1, - [get/set_rxfh is defined]) + AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1, + [struct ethtool_ops_ext is defined]) ],[ AC_MSG_RESULT(no) ]) + AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir]) LB_LINUX_TRY_COMPILE([ #include -- 2.41.0