summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2024-06-27 16:33:49 +0100
committerJakub Kicinski <kuba@kernel.org>2024-06-28 18:53:21 -0700
commit847a8ab186767be6ee95643f9739fa9d0f839589 (patch)
treed4bc2f7ff295aa6e933b960609f61a5c2dc8e1b5 /net/core
parenteac9122f0c41b832065e01977c34946ec8e76c24 (diff)
net: ethtool: let the core choose RSS context IDs
Add a new API to create/modify/remove RSS contexts, that passes in the newly-chosen context ID (not as a pointer) rather than leaving the driver to choose it on create. Also pass in the ctx, allowing drivers to easily use its private data area to store their hardware-specific state. Keep the existing .set_rxfh API for now as a fallback, but deprecate it for custom contexts (rss_context != 0). Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/45f1fe61df2163c091ec394c9f52000c8b16cc3b.1719502240.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index bce810f8ae53..8481dc4f2196 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11254,7 +11254,11 @@ static void netdev_rss_contexts_free(struct net_device *dev)
rxfh.rss_delete = true;
xa_erase(&dev->ethtool->rss_ctx, context);
- dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL);
+ if (dev->ethtool_ops->create_rxfh_context)
+ dev->ethtool_ops->remove_rxfh_context(dev, ctx,
+ context);
+ else
+ dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL);
kfree(ctx);
}
xa_destroy(&dev->ethtool->rss_ctx);