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]
Date:   Mon, 3 Jun 2019 13:02:43 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Richard Cochran <richardcochran@...il.com>,
        John Stultz <john.stultz@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephen Boyd <sboyd@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next 02/10] net: dsa: Add teardown callback for drivers

On Mon, 3 Jun 2019 at 04:07, Andrew Lunn <andrew@...n.ch> wrote:
>
> On Mon, Jun 03, 2019 at 12:39:18AM +0300, Vladimir Oltean wrote:
> > This is helpful for e.g. draining per-driver (not per-port) tagger
> > queues.
> >
> > Signed-off-by: Vladimir Oltean <olteanv@...il.com>
> > ---
> > Changes in v2:
> >
> > Patch is new.
> >
> >  include/net/dsa.h | 1 +
> >  net/dsa/dsa2.c    | 3 +++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/include/net/dsa.h b/include/net/dsa.h
> > index a7f36219904f..4033e0677be4 100644
> > --- a/include/net/dsa.h
> > +++ b/include/net/dsa.h
> > @@ -361,6 +361,7 @@ struct dsa_switch_ops {
> >                                                 int port);
> >
> >       int     (*setup)(struct dsa_switch *ds);
> > +     void    (*teardown)(struct dsa_switch *ds);
> >       u32     (*get_phy_flags)(struct dsa_switch *ds, int port);
> >
> >       /*
> > diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
> > index b70befe8a3c8..5bd3e9a4c709 100644
> > --- a/net/dsa/dsa2.c
> > +++ b/net/dsa/dsa2.c
> > @@ -407,6 +407,9 @@ static int dsa_switch_setup(struct dsa_switch *ds)
> >
> >  static void dsa_switch_teardown(struct dsa_switch *ds)
> >  {
> > +     if (ds->ops->teardown)
> > +             ds->ops->teardown(ds);
> > +
> >       if (ds->slave_mii_bus && ds->ops->phy_read)
> >               mdiobus_unregister(ds->slave_mii_bus);
> >
>
> Hi Vladimir
>
> If we want to keep with symmetric with dsa_switch_setup(), this
> teardown should be added after dsa_switch_unregister_notifier() and
> before devlink_unregister().
>
>        Andrew

True.

-Vladimir

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ