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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B87F3C433F5 for ; Wed, 29 Sep 2021 14:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E90C610CC for ; Wed, 29 Sep 2021 14:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344476AbhI2Ohf (ORCPT ); Wed, 29 Sep 2021 10:37:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:60834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344420AbhI2Ohe (ORCPT ); Wed, 29 Sep 2021 10:37:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FB27613CE; Wed, 29 Sep 2021 14:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632926153; bh=c2z5RikRkWc79lNu5V12ksP4gbK0MSOCGyzavGzUgOU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CB+pgkC8GS0awLozfiCqGuWzrfQ4/5Ly6BzLnykAmBTxGsFusXpzzR20GjxhGi7sx X0mEfe/YNQpUwtPq4/WeSaWZIJr1mtxs5C8HSHbMmtH6D6rL5R+24DLfFCZxR9+kiV 5kL/80cyjQeN1U+2tNrgb12+CkD9O2ZKaMtEw90mN6eXroR3Aj99dQwPqhO7KjHKKm m8jOeYzlX63uBTd1Gh1M7SYpbqrdBt1FTMOZmBPlP1qFR38NOqg/xOIiJ9jOFHOvSt JV6WkTMUJFlHPg8pz0c2Ih12wfe0VHYO/sNp/q70yp/ySorb0gGC8cPU869lXmoDu6 OFRv+Ndrj3Z/Q== Date: Wed, 29 Sep 2021 07:35:51 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: "David S . Miller" , Alexandre Belloni , Andrew Lunn , Ariel Elior , Bin Luo , Claudiu Manoil , Coiby Xu , Derek Chickles , drivers@pensando.io, Eric Dumazet , Felix Manlunas , Florian Fainelli , Geetha sowjanya , Greg Kroah-Hartman , GR-everest-linux-l2@marvell.com, GR-Linux-NIC-Dev@marvell.com, hariprasad , Ido Schimmel , intel-wired-lan@lists.osuosl.org, Ioana Ciornei , Jerin Jacob , Jesse Brandeburg , Jiri Pirko , Jonathan Lemon , Linu Cherian , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-rdma@vger.kernel.org, linux-staging@lists.linux.dev, Manish Chopra , Michael Chan , Moshe Shemesh , netdev@vger.kernel.org, oss-drivers@corigine.com, Richard Cochran , Saeed Mahameed , Salil Mehta , Satanand Burla , Shannon Nelson , Shay Drory , Simon Horman , Subbaraya Sundeep , Sunil Goutham , Taras Chornyi , Tariq Toukan , Tony Nguyen , UNGLinuxDriver@microchip.com, Vadym Kochan , Vivien Didelot , Vladimir Oltean , Yisen Zhuang Subject: Re: [PATCH net-next v1 4/5] net/mlx5: Register separate reload devlink ops for multiport device Message-ID: <20210929073551.16dd2267@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210929065549.43b13203@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210929072631.437ffad9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Wed, 29 Sep 2021 17:31:04 +0300 Leon Romanovsky wrote: > On Wed, Sep 29, 2021 at 07:26:31AM -0700, Jakub Kicinski wrote: > > On Wed, 29 Sep 2021 17:16:28 +0300 Leon Romanovsky wrote: > > > devlink_ops pointer is not constant at this stage, so why can't I copy > > > reload_* pointers to the "main" devlink ops? > > > > > > I wanted to avoid to copy all pointers. > > > > Hm. I must be missing a key piece here. IIUC you want to have different > > ops based on some device property. But there is only one > > > > static struct devlink_ops mlx5_devlink_ops; > > > > so how can two devlink instances in the system use that and have > > different ops without a copy? > > No, I have two: > * Base ops - mlx5_devlink_ops > * Extra reload commands - mlx5_devlink_reload Still those are global for the driver, no? What if you have multiple NICs or whatever.