lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929105537.758d5d85@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Wed, 29 Sep 2021 10:55:37 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Leon Romanovsky <leon@...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 0/5] Devlink reload and missed notifications
 fix

On Wed, 29 Sep 2021 18:31:51 +0300 Leon Romanovsky wrote:
> On Wed, Sep 29, 2021 at 07:39:40AM -0700, Jakub Kicinski wrote:
> > On Wed, 29 Sep 2021 17:13:28 +0300 Leon Romanovsky wrote:  
> > > We don't need to advertise counters for feature that is not supported.
> > > In multiport mlx5 devices, the reload functionality is not supported, so
> > > this change at least make that device to behave like all other netdev
> > > devices that don't support devlink reload.
> > > 
> > > The ops structure is set very early to make sure that internal devlink
> > > routines will be able access driver back during initialization (btw very
> > > questionable design choice)  
> > 
> > Indeed, is this fixable? Or now that devlink_register() was moved to 
> > the end of probe netdev can call ops before instance is registered?
> >   
> > > and at that stage the driver doesn't know
> > > yet which device type it is going to drive.
> > > 
> > > So the answer is:
> > > 1. Can't have two structures.  
> > 
> > I still don't understand why. To be clear - swapping full op structures
> > is probably acceptable if it's a pure upgrade (existing pointers match).
> > Poking new ops into a structure (in alphabetical order if I understand
> > your reply to Greg, not destructor-before-contructor) is what I deem
> > questionable.  
> 
> It is sorted simply for readability and not for any other technical
> reason.
> 
> Regarding new ops, this is how we are setting callbacks in RDMA based on
> actual device support. It works like a charm.
> 
> > > 2. Same behaviour across all netdev devices.  
> > 
> > Unclear what this is referring to.  
> 
> If your device doesn't support devlink reload, it won't print any
> reload counters at all. It is not the case for the multiport mlx5
> device. It doesn't support, but still present these counters.

There's myriad ways you can hide features.

Swapping ops is heavy handed and prone to data races, I don't like it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ