From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA51EC7619A for ; Thu, 13 Apr 2023 01:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjDMBja (ORCPT ); Wed, 12 Apr 2023 21:39:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjDMBj2 (ORCPT ); Wed, 12 Apr 2023 21:39:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C92AE61BE for ; Wed, 12 Apr 2023 18:39:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 47EBC6342D for ; Thu, 13 Apr 2023 01:39:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50085C4339B; Thu, 13 Apr 2023 01:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681349963; bh=uhTPrUQ/64c1z0MKOw6bmunCWr+YdpTDdMlxCi9BMvg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IlUxQkVERPeBTU81I6CZWTqTwP695hVxCBrqw6sozVmFaCu1DpqcoLm65Gfncnfm3 tItHg/r6WWUlSQUdcZMDStRw/0+XvWyQIE/YuK8NjQ6rqIqyVZRQHQVVSVDs1G2kE/ NfEfvDjF1JLyo5REmO88Z3QD0KnL4c8PaoGWCwtgjmOVFbqSF+qMp7vX9WK4yyeIqN jylXEFpJy/gJ/lqhX3goScbVaXBDYRNCo57Hth3WEXSKQMwU0gvbz3LVZ4MIf2OW3+ nXPhiF2OQ62KuWi1GVRzNAFWc0CWZxSd+D08N982RdVF97eQsFrJVwd44uV3WoEtVN 68nax6fOFP7YQ== Date: Wed, 12 Apr 2023 18:39:22 -0700 From: Jakub Kicinski To: Cc: , , , , Edward Cree , , , Subject: Re: [RFC PATCH v2 net-next 2/7] net: ethtool: attach an IDR of custom RSS contexts to a netdevice Message-ID: <20230412183922.530b471c@kernel.org> In-Reply-To: <16030cc69a6726cda461290a3d6bed9c48db7562.1681236653.git.ecree.xilinx@gmail.com> References: <16030cc69a6726cda461290a3d6bed9c48db7562.1681236653.git.ecree.xilinx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 11 Apr 2023 19:26:10 +0100 edward.cree@amd.com wrote: > +static void netdev_rss_contexts_free(struct net_device *dev) > +{ > + struct ethtool_rxfh_context *ctx; > + u32 context; > + > + if (!dev->ethtool_ops->set_rxfh_context) > + return; > + idr_for_each_entry(&dev->ethtool->rss_ctx, ctx, context) { > + u32 *indir = ethtool_rxfh_context_indir(ctx); > + u8 *key = ethtool_rxfh_context_key(ctx); > + > + idr_remove(&dev->ethtool->rss_ctx, context); > + dev->ethtool_ops->set_rxfh_context(dev, indir, key, ctx->hfunc, > + &context, true); > + kfree(ctx); > + } > +} nit: maybe move the ethtool related code out to a new net/ethtool/netdev.c ? We can probably put forward declarations in net/core/dev.h or a new header among sources?