From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 999EB219F6 for ; Wed, 4 Oct 2023 23:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CzeoVMFO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12414C433C8; Wed, 4 Oct 2023 23:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696460410; bh=+Juc3gxhxIDmmvNuiHtVzjfy/yxZLQSF6j30i7q/Akc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CzeoVMFO/ZaJ6nI7zGm7BjjahqDVRw5avIv+0QWlUmrL0V1610tkRCzAIyWWQMsSM xb5/L7HEIYBrawbVZMxB3okyobZ4ci5LP7hiBOFX3RGiJhkfU6O+I1F+ItqrqUbarp JmM2I7sCt7GV4GfrxT53mpu8+jAfNxpjDThbIZHfPcHcorlGUh4ei4Ts+kNR4QlJLG K68UGyPIh2/0hE8ELgCXOLUQycdR1Dogou2DKEtWUJhDdclZtxDwPnYOXKg7b6TI7H 7X5n0hAC7CSVWfIYvAkGZkArA27Naa9XdmMj74O86OmGnnL6xriz4vNlEEU+MWkXX8 o/aMBnMwe3gww== Date: Wed, 4 Oct 2023 16:00:07 -0700 From: Jakub Kicinski To: Cc: , , , , Edward Cree , , , , , , , , , , , , , Subject: Re: [PATCH v4 net-next 2/7] net: ethtool: attach an XArray of custom RSS contexts to a netdevice Message-ID: <20231004160007.095b55fc@kernel.org> In-Reply-To: <4a41069859105d8c669fe26171248aad7f88d1e9.1695838185.git.ecree.xilinx@gmail.com> References: <4a41069859105d8c669fe26171248aad7f88d1e9.1695838185.git.ecree.xilinx@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 27 Sep 2023 19:13:33 +0100 edward.cree@amd.com wrote: > + 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? Perhaps you need this for later patches but would be good to mention "why" in the commit message. > + 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); > + }