Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645935 > unrolled thread

[PATCH net-next 02/20] net: dsa: change scope of notifier call chain

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2017-05-19 23:10 +0200
Last post2017-05-22 21:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next 02/20] net: dsa: change scope of notifier call chain Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-19 23:10 +0200
    Re: [PATCH net-next 02/20] net: dsa: change scope of notifier call  chain Florian Fainelli <f.fainelli@gmail.com> - 2017-05-22 21:30 +0200

#1645935 — [PATCH net-next 02/20] net: dsa: change scope of notifier call chain

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2017-05-19 23:10 +0200
Subject[PATCH net-next 02/20] net: dsa: change scope of notifier call chain
Message-ID<tIXjQ-7UF-23@gated-at.bofh.it>
Change the scope of the fabric notification helper from the DSA slave to
the DSA port, since this is a DSA layer specific notion, that can be
used by non-slave ports (CPU and DSA).

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/slave.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 403d1dfe7f50..371f6d267917 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -27,10 +27,9 @@
 
 static bool dsa_slave_dev_check(struct net_device *dev);
 
-static int dsa_slave_notify(struct net_device *dev, unsigned long e, void *v)
+static int dsa_port_notify(struct dsa_port *dp, unsigned long e, void *v)
 {
-	struct dsa_slave_priv *p = netdev_priv(dev);
-	struct raw_notifier_head *nh = &p->dp->ds->dst->nh;
+	struct raw_notifier_head *nh = &dp->ds->dst->nh;
 	int err;
 
 	err = raw_notifier_call_chain(nh, e, v);
@@ -589,7 +588,7 @@ static int dsa_slave_bridge_port_join(struct net_device *dev,
 	 */
 	p->dp->bridge_dev = br;
 
-	err = dsa_slave_notify(dev, DSA_NOTIFIER_BRIDGE_JOIN, &info);
+	err = dsa_port_notify(p->dp, DSA_NOTIFIER_BRIDGE_JOIN, &info);
 
 	/* The bridging is rolled back on error */
 	if (err)
@@ -614,7 +613,7 @@ static void dsa_slave_bridge_port_leave(struct net_device *dev,
 	 */
 	p->dp->bridge_dev = NULL;
 
-	err = dsa_slave_notify(dev, DSA_NOTIFIER_BRIDGE_LEAVE, &info);
+	err = dsa_port_notify(p->dp, DSA_NOTIFIER_BRIDGE_LEAVE, &info);
 	if (err)
 		netdev_err(dev, "failed to notify DSA_NOTIFIER_BRIDGE_LEAVE\n");
 
-- 
2.13.0

[toc] | [next] | [standalone]


#1647297 — Re: [PATCH net-next 02/20] net: dsa: change scope of notifier call chain

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-05-22 21:30 +0200
SubjectRe: [PATCH net-next 02/20] net: dsa: change scope of notifier call chain
Message-ID<tK1bJ-1hH-23@gated-at.bofh.it>
In reply to#1645935
On 05/19/2017 02:00 PM, Vivien Didelot wrote:
> Change the scope of the fabric notification helper from the DSA slave to
> the DSA port, since this is a DSA layer specific notion, that can be
> used by non-slave ports (CPU and DSA).
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web