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: <20200904093451.GC10654@plvision.eu>
Date:   Fri, 4 Sep 2020 12:34:51 +0300
From:   Vadym Kochan <vadym.kochan@...ision.eu>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Pirko <jiri@...lanox.com>,
        Ido Schimmel <idosch@...lanox.com>,
        Andrew Lunn <andrew@...n.ch>,
        Oleksandr Mazur <oleksandr.mazur@...ision.eu>,
        Serhiy Boiko <serhiy.boiko@...ision.eu>,
        Serhiy Pshyk <serhiy.pshyk@...ision.eu>,
        Volodymyr Mytnyk <volodymyr.mytnyk@...ision.eu>,
        Taras Chornyi <taras.chornyi@...ision.eu>,
        Andrii Savka <andrii.savka@...ision.eu>,
        Network Development <netdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Mickey Rachamim <mickeyr@...vell.com>
Subject: Re: [PATCH net v6 5/6] net: marvell: prestera: Add Switchdev driver
 implementation

On Thu, Sep 03, 2020 at 07:18:59PM +0200, Willem de Bruijn wrote:
> On Wed, Sep 2, 2020 at 5:07 PM Vadym Kochan <vadym.kochan@...ision.eu> wrote:
> >
> > The following features are supported:
> >
> >     - VLAN-aware bridge offloading
> >     - VLAN-unaware bridge offloading
> >     - FDB offloading (learning, ageing)
> >     - Switchport configuration
> >
> > Currently there are some limitations like:
> >
> >     - Only 1 VLAN-aware bridge instance supported
> >     - FDB ageing timeout parameter is set globally per device
> >
> > Co-developed-by: Serhiy Boiko <serhiy.boiko@...ision.eu>
> > Signed-off-by: Serhiy Boiko <serhiy.boiko@...ision.eu>
> > Co-developed-by: Serhiy Pshyk <serhiy.pshyk@...ision.eu>
> > Signed-off-by: Serhiy Pshyk <serhiy.pshyk@...ision.eu>
> > Co-developed-by: Taras Chornyi <taras.chornyi@...ision.eu>
> > Signed-off-by: Taras Chornyi <taras.chornyi@...ision.eu>
> > Signed-off-by: Vadym Kochan <vadym.kochan@...ision.eu>
> 
> 
> > +int prestera_switchdev_init(struct prestera_switch *sw)
> > +{
> > +       struct prestera_switchdev *swdev;
> > +       int err;
> > +
> > +       swdev = kzalloc(sizeof(*swdev), GFP_KERNEL);
> > +       if (!swdev)
> > +               return -ENOMEM;
> > +
> > +       sw->swdev = swdev;
> > +       swdev->sw = sw;
> > +
> > +       INIT_LIST_HEAD(&swdev->bridge_list);
> > +
> > +       swdev_wq = alloc_ordered_workqueue("%s_ordered", 0, "prestera_br");
> > +       if (!swdev_wq) {
> > +               err = -ENOMEM;
> > +               goto err_alloc_wq;
> > +       }
> > +
> > +       err = prestera_switchdev_handler_init(swdev);
> > +       if (err)
> > +               goto err_swdev_init;
> > +
> > +       err = prestera_fdb_init(sw);
> > +       if (err)
> > +               goto err_fdb_init;
> > +
> > +       return 0;
> > +
> > +err_fdb_init:
> > +err_swdev_init:
> > +err_alloc_wq:
> > +       kfree(swdev);
> > +
> > +       return err;
> > +}
> > +
> > +void prestera_switchdev_fini(struct prestera_switch *sw)
> > +{
> > +       struct prestera_switchdev *swdev = sw->swdev;
> > +
> > +       prestera_fdb_fini(sw);
> > +       prestera_switchdev_handler_fini(swdev);
> > +       destroy_workqueue(swdev_wq);
> 
> this cleanup is also needed on the error path of prestera_switchdev_init
> 

Thanks! I will fix it.

> > +       kfree(swdev);
> > +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ