]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ethtool: rss: fix rss key initialization warning
authorDaniel Zahka <daniel.zahka@gmail.com>
Thu, 3 Oct 2024 16:23:10 +0000 (09:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Oct 2024 19:34:13 +0000 (12:34 -0700)
This warning is emitted when a driver does not default populate an rss
key when one is not provided from userspace. Some devices do not
support individual rss keys per context. For these devices, it is ok
to leave the key zeroed out in ethtool_rxfh_context. Do not warn on
zeroed key when ethtool_ops.rxfh_per_ctx_key == 0.

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20241003162310.1310576-1-daniel.zahka@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/ioctl.c

index 65cfe76dafbe2eb36b6d1ad91f8a65c3de597c4a..04b34dc6b36969d489cec5905602f39d178824a9 100644 (file)
@@ -1505,6 +1505,7 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
                                                       extack);
                        /* Make sure driver populates defaults */
                        WARN_ON_ONCE(!ret && !rxfh_dev.key &&
+                                    ops->rxfh_per_ctx_key &&
                                     !memchr_inv(ethtool_rxfh_context_key(ctx),
                                                 0, ctx->key_size));
                } else if (rxfh_dev.rss_delete) {