mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Razvan Stefanescu <razvan.stefanescu@nxp.com>
Cc: devel@driverdev.osuosl.org, arnd@arndb.de,
	gregkh@linuxfoundation.org, ioana.ciornei@nxp.com,
	alexandru.marginean@nxp.com, agraf@suse.de,
	linux-kernel@vger.kernel.org, stuyoder@gmail.com,
	netdev@vger.kernel.org, laurentiu.tudor@nxp.com
Subject: Re: [PATCH v4 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver
Date: Mon, 12 Mar 2018 15:36:54 +0100	[thread overview]
Message-ID: <20180312143654.GB21068@lunn.ch> (raw)
In-Reply-To: <20180312084955.12686-3-razvan.stefanescu@nxp.com>

> +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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-03-12 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  8:49 [PATCH v4 0/6] staging: Introduce " Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 1/6] staging: fsl-dpaa2/ethsw: Add APIs for DPSW object Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 2/6] staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver Razvan Stefanescu
2018-03-12 14:29   ` Andrew Lunn
2018-03-12 14:36   ` Andrew Lunn [this message]
2018-03-13  5:51     ` Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 3/6] staging: fsl-dpaa2/ethsw: Add ethtool support Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 4/6] staging: fsl-dpaa2/ethsw: Add maintainer for Ethernet Switch driver Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 5/6] staging: fsl-dpaa2/ethsw: Add README Razvan Stefanescu
2018-03-12  8:49 ` [PATCH v4 6/6] staging: fsl-dpaa2/ethsw: Add TODO Razvan Stefanescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312143654.GB21068@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=agraf@suse.de \
    --cc=alexandru.marginean@nxp.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razvan.stefanescu@nxp.com \
    --cc=stuyoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®