0001-ethtool-make-building-for-RSS-input-xfrm-optional.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From c88eb6f4e9b2d8f71f3391db2bf0ec82ecccae81 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Wed, 12 Feb 2025 04:12:42 +0000
  4. Subject: [PATCH] ethtool: make building for RSS input xfrm optional
  5. Unfortunately there is no way to detect at runtime if the kernel the
  6. support for RSS input transformation, and the default value
  7. RXH_XFRM_NO_CHANGE (0xff) used by newer ethtool results in breakage
  8. with older kernels.
  9. As a stop-gap solution simply don't compile with support for input
  10. xfrm by default.
  11. Signed-off-by: Daniel Golle <[email protected]>
  12. ---
  13. configure.ac | 10 ++++++++++
  14. ethtool.c | 10 ++++++++++
  15. 2 files changed, 20 insertions(+)
  16. --- a/configure.ac
  17. +++ b/configure.ac
  18. @@ -45,6 +45,16 @@ if test x$enable_pretty_dump = xyes; the
  19. fi
  20. AM_CONDITIONAL([ETHTOOL_ENABLE_PRETTY_DUMP], [test x$enable_pretty_dump = xyes])
  21. +AC_ARG_ENABLE(rss-input-xfrm,
  22. + [ --enable-rss-input-xfrm build with support for RSS input transformation (disabled by default)],
  23. + ,
  24. + enable_rss_input_xfrm=no)
  25. +if test x$enable_rss_input_xfrm = xyes; then
  26. + AC_DEFINE(ETHTOOL_ENABLE_RSS_INPUT_XFRM, 1,
  27. + [Define this to enable building with support for RSS input transformation.])
  28. +fi
  29. +AM_CONDITIONAL([ETHTOOL_ENABLE_RSS_INPUT_XFRM], [test x$enable_rss_input_xfrm = xyes])
  30. +
  31. AC_ARG_WITH([bash-completion-dir],
  32. AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
  33. [Install the bash-completion script in this directory. @<:@default=yes@:>@]),
  34. --- a/ethtool.c
  35. +++ b/ethtool.c
  36. @@ -4109,9 +4109,11 @@ static int do_grxfh(struct cmd_context *
  37. (const char *)hfuncs->data + i * ETH_GSTRING_LEN,
  38. (rss->hfunc & (1 << i)) ? "on" : "off");
  39. +#ifdef ETHTOOL_ENABLE_RSS_INPUT_XFRM
  40. printf("RSS input transformation:\n");
  41. printf(" symmetric-xor: %s\n",
  42. (rss->input_xfrm & RXH_XFRM_SYM_XOR) ? "on" : "off");
  43. +#endif
  44. out:
  45. free(hfuncs);
  46. @@ -4431,7 +4433,15 @@ static int do_srxfh(struct cmd_context *
  47. rss->cmd = ETHTOOL_SRSSH;
  48. rss->rss_context = rss_context;
  49. rss->hfunc = req_hfunc;
  50. +#ifdef ETHTOOL_ENABLE_RSS_INPUT_XFRM
  51. rss->input_xfrm = req_input_xfrm;
  52. +#else
  53. + if (req_input_xfrm != 0xff) {
  54. + perror("Compiled for kernel without support for input transformation");
  55. + err = 1;
  56. + goto free;
  57. + }
  58. +#endif
  59. if (delete) {
  60. rss->indir_size = rss->key_size = 0;
  61. } else {