lkml.org 
[lkml]   [2018]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver
    > +static int port_netdevice_event(struct notifier_block *unused,
    > + unsigned long event, void *ptr)
    > +{
    > + struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
    > + struct netdev_notifier_changeupper_info *info = ptr;
    > + struct net_device *upper_dev;
    > + int err = 0;
    > +
    > + if (netdev->netdev_ops != &ethsw_port_ops)
    > + return NOTIFY_DONE;
    > +
    > + /* Handle just upper dev link/unlink for the moment */
    > + if (event == NETDEV_CHANGEUPPER) {
    > + upper_dev = info->upper_dev;
    > + if (netif_is_bridge_master(upper_dev)) {
    > + if (info->linking)
    > + err = port_bridge_join(netdev);
    > + else
    > + err = port_bridge_leave(netdev);
    > + }
    > + }
    > +
    > + return notifier_from_errno(err);
    > +}

    I could be missing something here, but don't you need to pass to
    port_bridge_join() which bridge the port is joining. There can be
    multiple bridges, so you need to ensure the port joins the correct
    bridge.

    Andrew

    \
     
     \ /
      Last update: 2018-03-12 15:37    [W:2.410 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site