Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp803873pxb; Wed, 29 Sep 2021 09:59:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoS9zi24KK1jOnHec0+izOghUTbsFjw/WQw3y9NkTUVxxyqiGuFFU3hLpQZbx1juZh3aqi X-Received: by 2002:a17:90b:38cf:: with SMTP id nn15mr7669048pjb.81.1632934796369; Wed, 29 Sep 2021 09:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632934796; cv=none; d=google.com; s=arc-20160816; b=DzgBDQ4DPTcZ21MvU9FYz+9rbA+ip7EeRy9YcHEw5MsMYeQdBA4z1wyGmcPVe9PgV1 pIrX0gSIdB2O/gWG2VSthg7WOf/bUe/7WAL042ilSEMXB35bzLLTMq4PIZdF7qdlOcxF sAPYjUw5CnJxNNTgQaHRm5np4pd342iMZMojtiwD/Bu76kbjRNKqy7/2bmMGCKDi3pot F8v55yfw8ifxnPi5FvUidywC7+bGg6KPNNPSx9UDhV9CAEDomcFKe4n/5QI4UoLtIlyR f4U3x8yTREXp01Xxhak5r7UzLe4fHx+LceRUPlaVUAJcTHwO5uhl/UqjFBfMWwXzcuw2 +BPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R1NVE0Tv2BG6yz1xgw93Rc6n8mAwCRZNqwWuaFmA8EY=; b=bbnjFV5+I5mBoayZixUTpdNVZlROrE8wfMDUYqidVwV+D17O9YI0ziVXf0tedga/NS xvWC1O6JFnxxjugD8sXVC5UqUaY7W6No7Y9+a4inmuNSqkSLrkOi3G1W5TDdMtQJVnWD mC4lwM5LTtKJafk8Eqgh62sr0xpMn3f20lB3WrDBtUIlzwHEdRzRk+IgwWzV4ipkWbdJ m8IHsjOpn03Y34BW+4IbW/4s7XmB00ucnei2iUmGR1Zb/38PlVnVlmcW7410FuOmGuSZ zVqzM+9JbK4bwwHZwKI5sfSYz+LmhGI421fwAiXIlscUeoI7ei9CuBRO0Q6rLzPfu9ob VlhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aP/Szhec"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si460960plt.388.2021.09.29.09.59.43; Wed, 29 Sep 2021 09:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aP/Szhec"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345159AbhI2P03 (ORCPT + 99 others); Wed, 29 Sep 2021 11:26:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:36244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344945AbhI2P03 (ORCPT ); Wed, 29 Sep 2021 11:26:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 604FF61440; Wed, 29 Sep 2021 15:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632929088; bh=xBRRX1rYjiTzPEoPMHw1rL24TvrnK+689UnwZagbnsQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aP/SzhecYqJ59hW7NpP/05VpI6etnlUtWV51qr4Sjrsj7iIglusLMXx2XNaO0fT0M RyFp76HRYmy1cib0bH0hsp/eVZnogcmCelT/ZwaymqsJegIyZJRgdg5tNKJsghh0RX h735xxlR9XptIYNPpeHPeVEIWeiC9Q4ek0t3XMoih4QzIJ1mz04rG59BZZLxMrAzht MHpF9eFzGaB22t5a325IB+YbBszRNGWukMKfRmsCWK+zMzKR3DD/rQmxK4ETBnoB+G hvBLRT6RtSXZYMSVRvFbB12XrLiTkxZUMC0ZQ7vldriFuDLP8cPBDmDxWn6bw8TPTP TWgYqiOk6HtYQ== Date: Wed, 29 Sep 2021 18:24:44 +0300 From: Leon Romanovsky To: Jakub Kicinski 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: References: <20210929065549.43b13203@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210929072631.437ffad9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210929073551.16dd2267@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210929073551.16dd2267@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 07:35:51AM -0700, Jakub Kicinski wrote: > 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? Ugh, yes > > What if you have multiple NICs or whatever. I missed it and always tested with one device L(. I'll add copy-all-ops code. Thanks