Advertisement
Guest User

mlnx-en-dkms-4.9-4.1.7.0.gab010e5_on_Linux-kernel-5.10

a guest
Jul 9th, 2022
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.17 KB | None | 0 0
  1. Note: After applying the patch, execute the compat/autogen.sh first before doing dkms build.
  2. The change in config makes it compatible to the build flow used in recent kernel version.
  3. The change in the source is to fit the kernel API change introduced in recent kernel version.
  4.  
  5. diff --git a/compat/config/build-linux.m4 b/compat/config/build-linux.m4
  6. index 8639a38..a6b3926 100644
  7. --- a/compat/config/build-linux.m4
  8. +++ b/compat/config/build-linux.m4
  9. @@ -33,42 +33,9 @@ LB_LINUX_CONFIG_VALUE([XEN_INTERFACE_VERSION],[XEN_INCLUDES="$XEN_INCLUDES -D__X
  10. AC_DEFUN([LB_LINUX_VERSION],[
  11. KMODEXT=".ko"
  12. AC_SUBST(KMODEXT)
  13. +]
  14. +)
  15.  
  16. -makerule="$PWD/build"
  17. -AC_CACHE_CHECK([for external module build target], lb_cv_module_target,
  18. -[
  19. - lb_cv_module_target=""
  20. - MODULE_TARGET="SUBDIRS"
  21. - rm -f build/conftest.i
  22. - LB_LINUX_TRY_MAKE([], [],
  23. - [$makerule MLNX_KERNEL_TEST=conftest.i],
  24. - [test -s build/conftest.i],
  25. - [lb_cv_module_target="SUBDIRS"],[
  26. - MODULE_TARGET="M"
  27. - makerule="$PWD/build/"
  28. - LB_LINUX_TRY_MAKE([], [],
  29. - [$makerule MLNX_KERNEL_TEST=conftest.i],
  30. - [test -s build/conftest.i],
  31. - [lb_cv_module_target="M54"], [
  32. - MODULE_TARGET="M"
  33. - makerule="_module_$PWD/build"
  34. - LB_LINUX_TRY_MAKE([], [],
  35. - [$makerule MLNX_KERNEL_TEST=conftest.i],
  36. - [test -s build/conftest.i],
  37. - [lb_cv_module_target="M"], [
  38. - AC_MSG_ERROR([kernel module make failed; check config.log for details])
  39. - ])])])
  40. -])
  41. -AS_IF([test -z "$lb_cv_module_target"],
  42. - [AC_MSG_ERROR([unknown external module build target])],
  43. -[test "x$lb_cv_module_target" = "xM54"],
  44. - [makerule="$PWD/build"
  45. - lb_cv_module_target="M"],
  46. -[test "x$lb_cv_module_target" = "xM"],
  47. - [makerule="_module_$PWD/build"])
  48. -MODULE_TARGET=$lb_cv_module_target
  49. -AC_SUBST(MODULE_TARGET)
  50. -])
  51.  
  52. #
  53. # LB_LINUX_RELEASE
  54. @@ -76,31 +43,8 @@ AC_SUBST(MODULE_TARGET)
  55. # get the release version of linux
  56. #
  57. AC_DEFUN([LB_LINUX_RELEASE],
  58. -[LINUXRELEASE=
  59. -rm -f build/conftest.i
  60. -AC_MSG_CHECKING([for Linux release])
  61. -if test -s $LINUX_OBJ/include/$AUTOCONF_HDIR/utsrelease.h ; then
  62. - LINUXRELEASEHEADER=$AUTOCONF_HDIR/utsrelease.h
  63. -else
  64. - LINUXRELEASEHEADER=linux/version.h
  65. -fi
  66. -LB_LINUX_TRY_MAKE([
  67. - #include <$LINUXRELEASEHEADER>
  68. -],[
  69. - char *LINUXRELEASE;
  70. - LINUXRELEASE=UTS_RELEASE;
  71. -],[
  72. - $makerule MLNX_KERNEL_TEST=conftest.i
  73. -],[
  74. - test -s build/conftest.i
  75. -],[
  76. - # LINUXRELEASE="UTS_RELEASE"
  77. - eval $(grep "LINUXRELEASE=" build/conftest.i)
  78. -],[
  79. - AC_MSG_RESULT([unknown])
  80. - AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.])
  81. -])
  82. -rm -f build/conftest.i
  83. +[
  84. +LINUXRELEASE=$(LB_LINUX_MAKE_OUTPUT([kernelrelease]))
  85. if test x$LINUXRELEASE = x ; then
  86. AC_MSG_RESULT([unknown])
  87. AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
  88. @@ -380,6 +324,19 @@ $2
  89. return 0;
  90. }])
  91.  
  92. +
  93. +#
  94. +# LB_LINUX_MAKE_OUTPUT
  95. +#
  96. +# Runs a make target ($1, potentially with extra flags)
  97. +# output goes to standard output.
  98. +#
  99. +AC_DEFUN([LB_LINUX_MAKE_OUTPUT],
  100. +[
  101. +MAKE=${MAKE:-make}
  102. +$MAKE -s M=$PWD -C $LINUX_OBJ $1
  103. +])
  104. +
  105. #
  106. # LB_LINUX_COMPILE_IFELSE
  107. #
  108. @@ -389,7 +346,7 @@ AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
  109. [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
  110. MAKE=${MAKE:-make}
  111. rm -f build/conftest.o build/conftest.mod.c build/conftest.ko build/output.log
  112. -AS_IF([AC_TRY_COMMAND(cp conftest.c build && env $CROSS_VARS $MAKE -d [$2] ${LD:+"LD=$CROSS_COMPILE$LD"} CC="$CROSS_COMPILE$CC" -f $PWD/build/Makefile MLNX_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_MLNX_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/$SRCARCH/include -I$LINUX/arch/$SRCARCH/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration -Wno-unused-variable -Wno-uninitialized $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$PWD/build >/dev/null 2>build/output.log; [[[ $? -ne 0 ]]] && cat build/output.log 1>&2 && false || config/warning_filter.sh build/output.log) >/dev/null && AC_TRY_COMMAND([$3])],
  113. +AS_IF([AC_TRY_COMMAND(cp conftest.c build && env $CROSS_VARS $MAKE -d [$2] ${LD:+"LD=$CROSS_COMPILE$LD"} CC="$CROSS_COMPILE$CC" -f $PWD/build/Makefile MLNX_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_MLNX_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/$SRCARCH/include -I$LINUX/arch/$SRCARCH/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration -Wno-unused-variable -Wno-uninitialized $EXTRA_KCFLAGS" $CROSS_VARS M=$PWD/build >/dev/null 2>build/output.log; [[[ $? -ne 0 ]]] && cat build/output.log 1>&2 && false || config/warning_filter.sh build/output.log) >/dev/null && AC_TRY_COMMAND([$3])],
  114. [$4],
  115. [_AC_MSG_LOG_CONFTEST
  116. m4_ifvaln([$5],[$5])dnl])
  117. @@ -578,7 +535,7 @@ LB_LINUX_TRY_MAKE([
  118. int myretval=ENOSYS ;
  119. return myretval;
  120. ],[
  121. - $makerule MLNX_KERNEL_TEST=conftest.i
  122. + MLNX_KERNEL_TEST=conftest.i
  123. ],[dnl
  124. grep request_module build/conftest.i |dnl
  125. grep -v `grep "int myretval=" build/conftest.i |dnl
  126. diff --git a/compat/config/parallel-build.m4 b/compat/config/parallel-build.m4
  127. index 91cfe6e..629b3b8 100644
  128. --- a/compat/config/parallel-build.m4
  129. +++ b/compat/config/parallel-build.m4
  130. @@ -101,7 +101,7 @@ MAKE=${MAKE:-make}
  131. tmpbuild=$(/bin/mktemp -d $PWD/build/build_XXXXX)
  132. /bin/cp build/Makefile $tmpbuild/
  133. m4_ifvaln([$1], [MLNX_AC_LANG_CONFTEST([$1])])dnl
  134. -AS_IF([AC_TRY_COMMAND(env $CROSS_VARS $MAKE -d [$2] ${LD:+"LD=$CROSS_COMPILE$LD"} CC="$CROSS_COMPILE$CC" -f $tmpbuild/Makefile MLNX_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_MLNX_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/$SRCARCH/include -I$LINUX/arch/$SRCARCH/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration -Wno-unused-variable -Wno-uninitialized $EXTRA_KCFLAGS" $CROSS_VARS $MODULE_TARGET=$tmpbuild >/dev/null 2>$tmpbuild/output.log; [[[ $? -ne 0 ]]] && cat $tmpbuild/output.log 1>&2 && false || config/warning_filter.sh $tmpbuild/output.log) >/dev/null && AC_TRY_COMMAND([$3])],
  135. +AS_IF([AC_TRY_COMMAND(env $CROSS_VARS $MAKE -d [$2] ${LD:+"LD=$CROSS_COMPILE$LD"} CC="$CROSS_COMPILE$CC" -f $tmpbuild/Makefile MLNX_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="-include $AUTOCONF_HDIR/autoconf.h $XEN_INCLUDES $EXTRA_MLNX_INCLUDE -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -Iinclude -I$LINUX/arch/$SRCARCH/include/uapi -Iarch/$SRCARCH/include/generated/uapi -I$LINUX/include -I$LINUX/include/uapi -Iinclude/generated/uapi -I$LINUX/arch/$SRCARCH/include -Iarch/$SRCARCH/include/generated -I$LINUX/arch/$SRCARCH/include -I$LINUX/arch/$SRCARCH/include/generated -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 $CONFIG_INCLUDE_FLAG" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration -Wno-unused-variable -Wno-uninitialized $EXTRA_KCFLAGS" $CROSS_VARS M=$tmpbuild >/dev/null 2>$tmpbuild/output.log; [[[ $? -ne 0 ]]] && cat $tmpbuild/output.log 1>&2 && false || config/warning_filter.sh $tmpbuild/output.log) >/dev/null && AC_TRY_COMMAND([$3])],
  136. [$4],
  137. [_MLNX_AC_MSG_LOG_CONFTEST
  138. m4_ifvaln([$5],[$5])dnl])
  139. diff --git a/drivers/net/ethernet/mellanox/mlx4/crdump.c b/drivers/net/ethernet/mellanox/mlx4/crdump.c
  140. index f1a48ea..0d5ba27 100644
  141. --- a/drivers/net/ethernet/mellanox/mlx4/crdump.c
  142. +++ b/drivers/net/ethernet/mellanox/mlx4/crdump.c
  143. @@ -388,12 +388,11 @@ static int crdump_proc_open(struct inode *inode, struct file *file)
  144. return 0;
  145. }
  146.  
  147. -static const struct file_operations crdump_proc_fops = {
  148. - .owner = THIS_MODULE,
  149. - .open = crdump_proc_open,
  150. - .read = seq_read,
  151. - .llseek = seq_lseek,
  152. - .release = seq_release,
  153. +static const struct proc_ops crdump_proc_fops = {
  154. + .proc_open = crdump_proc_open,
  155. + .proc_read = seq_read,
  156. + .proc_lseek = seq_lseek,
  157. + .proc_release = seq_release,
  158. };
  159.  
  160. int mlx4_crdump_init(struct mlx4_dev *dev)
  161. diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
  162. index 23e74a1..6bbcc99 100644
  163. --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
  164. +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
  165. @@ -3207,6 +3207,11 @@ static int mlx4_en_set_phys_id(struct net_device *dev,
  166. #endif
  167.  
  168. const struct ethtool_ops mlx4_en_ethtool_ops = {
  169. + .supported_coalesce_params = ETHTOOL_COALESCE_TX_USECS | ETHTOOL_COALESCE_TX_MAX_FRAMES | ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ |
  170. + ETHTOOL_COALESCE_RX_USECS | ETHTOOL_COALESCE_RX_MAX_FRAMES | ETHTOOL_COALESCE_PKT_RATE_LOW |
  171. + ETHTOOL_COALESCE_RX_USECS_LOW | ETHTOOL_COALESCE_PKT_RATE_HIGH | ETHTOOL_COALESCE_RX_USECS_HIGH |
  172. + ETHTOOL_COALESCE_RATE_SAMPLE_INTERVAL | ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
  173. +
  174. .get_drvinfo = mlx4_en_get_drvinfo,
  175. #ifdef HAVE_ETHTOOL_xLINKSETTINGS
  176. .get_link_ksettings = mlx4_en_get_link_ksettings,
  177. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/crdump.c b/drivers/net/ethernet/mellanox/mlx5/core/crdump.c
  178. index 8640b25..7f14fbf 100644
  179. --- a/drivers/net/ethernet/mellanox/mlx5/core/crdump.c
  180. +++ b/drivers/net/ethernet/mellanox/mlx5/core/crdump.c
  181. @@ -173,12 +173,11 @@ static int mlx5_crdump_open(struct inode *inode, struct file *file)
  182. return 0;
  183. }
  184.  
  185. -static const struct file_operations mlx5_crdump_fops = {
  186. - .owner = THIS_MODULE,
  187. - .open = mlx5_crdump_open,
  188. - .read = seq_read,
  189. - .llseek = seq_lseek,
  190. - .release = seq_release
  191. +static const struct proc_ops mlx5_crdump_fops = {
  192. + .proc_open = mlx5_crdump_open,
  193. + .proc_read = seq_read,
  194. + .proc_lseek = seq_lseek,
  195. + .proc_release = seq_release
  196. };
  197.  
  198. int mlx5_cr_protected_capture(struct mlx5_core_dev *dev)
  199. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
  200. index 35edd30..d9e50dd 100644
  201. --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
  202. +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
  203. @@ -554,8 +554,8 @@ static int req_pages_handler(struct notifier_block *nb,
  204.  
  205. int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot)
  206. {
  207. - u16 uninitialized_var(func_id);
  208. - s32 uninitialized_var(npages);
  209. + u16 func_id = 0;
  210. + s32 npages = 0;
  211. int err;
  212.  
  213. err = mlx5_cmd_query_pages(dev, &func_id, &npages, boot);
  214. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
  215. index c8124c8..88446f5 100644
  216. --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
  217. +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
  218. @@ -937,11 +937,10 @@ static int dr_dump_proc_release(struct inode *inode, struct file *file)
  219. return 0;
  220. }
  221.  
  222. -static const struct file_operations mlx5_crdump_fops = {
  223. - .owner = THIS_MODULE,
  224. - .read = dr_dump_proc_read,
  225. - .open = dr_dump_proc_open,
  226. - .release = dr_dump_proc_release
  227. +static const struct proc_ops mlx5_crdump_fops = {
  228. + .proc_read = dr_dump_proc_read,
  229. + .proc_open = dr_dump_proc_open,
  230. + .proc_release = dr_dump_proc_release
  231. };
  232.  
  233. int mlx5dr_dbg_init_dump(struct mlx5dr_domain *dmn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement