Skip to contentSkip to conversation

ethtool: rss: fix rss key initialization warning

PATCH In review Daniel Zahka 2 participants 2 messages Sep 12, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool: rss: fix rss key initialization warning

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.

---
 net/ethtool/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ethtool/ioctl.c +1 -1
index 65cfe76dafbe..8c4979b8f4f3 100644
@@ -1504,7 +1504,7 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
 			ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev,
 						       extack);
 			/* Make sure driver populates defaults */
-			WARN_ON_ONCE(!ret && !rxfh_dev.key &&
+			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) {
Signature · 1 line
2.43.5
maintainer
#1 lore raw

net/ethtool/ioctl.c static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, · line 1507

Quoted 2 lines · On Thu, 12 Sep 2024 16:05:30 -0700 Daniel Zahka wrote:
net/ethtool/ioctl.c +1 -1
-			WARN_ON_ONCE(!ret && !rxfh_dev.key &&
+			WARN_ON_ONCE(!ret && !rxfh_dev.key && ops->rxfh_per_ctx_key &&

wrap at 80 chars, please, make sure you read:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
before sending v2

Signature · 1 line
pw-bot: cr