Thread (35 messages) flat view 35 messages, 6 authors, 2023-12-07

Re: [PATCH v4 net-next 2/7] net: ethtool: attach an XArray of custom RSS contexts to a netdevice

From: Edward Cree <ecree.xilinx@gmail.com>
Date: 2023-10-05 18:32:42

On 05/10/2023 00:00, Jakub Kicinski wrote:
On Wed, 27 Sep 2023 19:13:33 +0100 edward.cree@amd.com wrote:
quoted
+	struct ethtool_rxfh_context *ctx;
+	unsigned long context;
+
+	if (dev->ethtool_ops->set_rxfh_context)
Can there be contexts if there's no callback to create them?
I don't believe so.  But maybe making that load-bearing isn't great...
Perhaps you need this for later patches but would be good to
mention "why" in the commit message.
Well, the loop below tries to call ->set_rxfh_context, which wouldn't
 go too well if there's no callback.  But I guess the code makes more
 sense to read if this just guards the actual call and not the kfree.

-ed
quoted
+		xa_for_each(&dev->ethtool->rss_ctx, context, ctx) {
+			u32 *indir = ethtool_rxfh_context_indir(ctx);
+			u8 *key = ethtool_rxfh_context_key(ctx);
+			u32 concast = context;
+
+			xa_erase(&dev->ethtool->rss_ctx, context);
+			dev->ethtool_ops->set_rxfh_context(dev, indir, key,
+							   ctx->hfunc, &concast,
+							   true);
+			kfree(ctx);
+		}
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help