[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YVR4qDxiQw95jaWK@unreal>
Date: Wed, 29 Sep 2021 17:31:04 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>, Ariel Elior <aelior@...vell.com>,
Bin Luo <luobin9@...wei.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Coiby Xu <coiby.xu@...il.com>,
Derek Chickles <dchickles@...vell.com>, drivers@...sando.io,
Eric Dumazet <eric.dumazet@...il.com>,
Felix Manlunas <fmanlunas@...vell.com>,
Florian Fainelli <f.fainelli@...il.com>,
Geetha sowjanya <gakula@...vell.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
GR-everest-linux-l2@...vell.com, GR-Linux-NIC-Dev@...vell.com,
hariprasad <hkelam@...vell.com>,
Ido Schimmel <idosch@...dia.com>,
intel-wired-lan@...ts.osuosl.org,
Ioana Ciornei <ioana.ciornei@....com>,
Jerin Jacob <jerinj@...vell.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Jiri Pirko <jiri@...dia.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Linu Cherian <lcherian@...vell.com>,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-staging@...ts.linux.dev,
Manish Chopra <manishc@...vell.com>,
Michael Chan <michael.chan@...adcom.com>,
Moshe Shemesh <moshe@...dia.com>, netdev@...r.kernel.org,
oss-drivers@...igine.com,
Richard Cochran <richardcochran@...il.com>,
Saeed Mahameed <saeedm@...dia.com>,
Salil Mehta <salil.mehta@...wei.com>,
Satanand Burla <sburla@...vell.com>,
Shannon Nelson <snelson@...sando.io>,
Shay Drory <shayd@...dia.com>,
Simon Horman <simon.horman@...igine.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
Sunil Goutham <sgoutham@...vell.com>,
Taras Chornyi <tchornyi@...vell.com>,
Tariq Toukan <tariqt@...dia.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
UNGLinuxDriver@...rochip.com, Vadym Kochan <vkochan@...vell.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Yisen Zhuang <yisen.zhuang@...wei.com>
Subject: Re: [PATCH net-next v1 4/5] net/mlx5: Register separate reload
devlink ops for multiport device
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:
> > > > @@ -808,6 +812,9 @@ int mlx5_devlink_register(struct devlink *devlink)
> > > > if (err)
> > > > goto traps_reg_err;
> > > >
> > > > + if (!mlx5_core_is_mp_slave(dev))
> > > > + devlink_set_ops(devlink, &mlx5_devlink_reload);
> > >
> > > Does this work? Where do you make a copy of the ops? 🤔 You can't modify
> > > the driver-global ops, to state the obvious.
> >
> > 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
Thanks
Powered by blists - more mailing lists