-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ethtool: work-around ETHTOOL_GRSSH/ETHTOOL_SRSSH ABI breakage
ethtool since version 6.9 introduced support for getting/setting RSS input transformation supported in Linux since version 6.8. The now changed kernel ioctl ABI, however, cannot be detected from userland, and ethtool since version 6.9 simply assumes that a previously reserved field is now used to set the input transformation. Unfortunately the default value RXH_XFRM_NO_CHANGE (0xff) used by ethtool userland creates an incompatibility with older kernels which cannot be resolved easily without introducing even more ABI breakage. Work-around the issue and fix support for --set-rxfh and --set-rxfh-indir ethtool userland tool commands by making the support for input_xfrm conditional on compile time, and keep it disabled for Linux 6.6. Fixes: 8c2dcd1 ("ethtool: update to 6.10") Signed-off-by: Daniel Golle <[email protected]> Tested-by: Stijn Segers <[email protected]> (cherry picked from commit 3a7467f)
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...etwork/utils/ethtool/patches/0001-ethtool-make-building-for-RSS-input-xfrm-optional.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
From c88eb6f4e9b2d8f71f3391db2bf0ec82ecccae81 Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <[email protected]> | ||
Date: Wed, 12 Feb 2025 04:12:42 +0000 | ||
Subject: [PATCH] ethtool: make building for RSS input xfrm optional | ||
|
||
Unfortunately there is no way to detect at runtime if the kernel the | ||
support for RSS input transformation, and the default value | ||
RXH_XFRM_NO_CHANGE (0xff) used by newer ethtool results in breakage | ||
with older kernels. | ||
As a stop-gap solution simply don't compile with support for input | ||
xfrm by default. | ||
|
||
Signed-off-by: Daniel Golle <[email protected]> | ||
--- | ||
configure.ac | 10 ++++++++++ | ||
ethtool.c | 10 ++++++++++ | ||
2 files changed, 20 insertions(+) | ||
|
||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -45,6 +45,16 @@ if test x$enable_pretty_dump = xyes; the | ||
fi | ||
AM_CONDITIONAL([ETHTOOL_ENABLE_PRETTY_DUMP], [test x$enable_pretty_dump = xyes]) | ||
|
||
+AC_ARG_ENABLE(rss-input-xfrm, | ||
+ [ --enable-rss-input-xfrm build with support for RSS input transformation (disabled by default)], | ||
+ , | ||
+ enable_rss_input_xfrm=no) | ||
+if test x$enable_rss_input_xfrm = xyes; then | ||
+ AC_DEFINE(ETHTOOL_ENABLE_RSS_INPUT_XFRM, 1, | ||
+ [Define this to enable building with support for RSS input transformation.]) | ||
+fi | ||
+AM_CONDITIONAL([ETHTOOL_ENABLE_RSS_INPUT_XFRM], [test x$enable_rss_input_xfrm = xyes]) | ||
+ | ||
AC_ARG_WITH([bash-completion-dir], | ||
AS_HELP_STRING([--with-bash-completion-dir[=PATH]], | ||
[Install the bash-completion script in this directory. @<:@default=yes@:>@]), | ||
--- a/ethtool.c | ||
+++ b/ethtool.c | ||
@@ -4109,9 +4109,11 @@ static int do_grxfh(struct cmd_context * | ||
(const char *)hfuncs->data + i * ETH_GSTRING_LEN, | ||
(rss->hfunc & (1 << i)) ? "on" : "off"); | ||
|
||
+#ifdef ETHTOOL_ENABLE_RSS_INPUT_XFRM | ||
printf("RSS input transformation:\n"); | ||
printf(" symmetric-xor: %s\n", | ||
(rss->input_xfrm & RXH_XFRM_SYM_XOR) ? "on" : "off"); | ||
+#endif | ||
|
||
out: | ||
free(hfuncs); | ||
@@ -4431,7 +4433,15 @@ static int do_srxfh(struct cmd_context * | ||
rss->cmd = ETHTOOL_SRSSH; | ||
rss->rss_context = rss_context; | ||
rss->hfunc = req_hfunc; | ||
+#ifdef ETHTOOL_ENABLE_RSS_INPUT_XFRM | ||
rss->input_xfrm = req_input_xfrm; | ||
+#else | ||
+ if (req_input_xfrm != 0xff) { | ||
+ perror("Compiled for kernel without support for input transformation"); | ||
+ err = 1; | ||
+ goto free; | ||
+ } | ||
+#endif | ||
if (delete) { | ||
rss->indir_size = rss->key_size = 0; | ||
} else { |