netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next 0/2] switchdev: unify naming prefix
@ 2015-04-13 14:14 Jiri Pirko
  2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 14:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, sfeldma, roopa, f.fainelli, gospo

Turned out that "switchdev" sticks. So just unify all releated terms to
use this prefix.

Jiri Pirko (2):
  switchdev: s/netdev_switch_/switchdev_/
  switchdev: s/swdev_/switchdev_/

 drivers/net/bonding/bond_main.c      |   4 +-
 drivers/net/ethernet/rocker/rocker.c |  47 +++++-----
 drivers/net/team/team.c              |   4 +-
 include/linux/netdevice.h            |   2 +-
 include/net/switchdev.h              | 136 +++++++++++++--------------
 net/bridge/br.c                      |  18 ++--
 net/bridge/br_netlink.c              |   6 +-
 net/bridge/br_stp.c                  |   2 +-
 net/core/net-sysfs.c                 |   2 +-
 net/core/rtnetlink.c                 |   2 +-
 net/dsa/slave.c                      |   8 +-
 net/ipv4/fib_trie.c                  |  40 ++++----
 net/switchdev/switchdev.c            | 174 +++++++++++++++++------------------
 13 files changed, 220 insertions(+), 225 deletions(-)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 14:14 [patch net-next 0/2] switchdev: unify naming prefix Jiri Pirko
@ 2015-04-13 14:14 ` Jiri Pirko
  2015-04-13 14:48   ` Scott Feldman
  2015-04-13 19:25   ` Samudrala, Sridhar
  2015-04-13 14:14 ` [patch net-next 2/2] switchdev: s/swdev_/switchdev_/ Jiri Pirko
  2015-04-13 17:50 ` [patch net-next 0/2] switchdev: unify naming prefix Andy Gospodarek
  2 siblings, 2 replies; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 14:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, sfeldma, roopa, f.fainelli, gospo

Turned out that "switchdev" sticks. So just unify all releated terms to
use this prefix.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/bonding/bond_main.c      |   4 +-
 drivers/net/ethernet/rocker/rocker.c |  10 +--
 drivers/net/team/team.c              |   4 +-
 include/net/switchdev.h              | 106 +++++++++++++--------------
 net/bridge/br.c                      |  18 ++---
 net/bridge/br_netlink.c              |   6 +-
 net/bridge/br_stp.c                  |   2 +-
 net/core/net-sysfs.c                 |   2 +-
 net/core/rtnetlink.c                 |   2 +-
 net/ipv4/fib_trie.c                  |  40 +++++------
 net/switchdev/switchdev.c            | 134 +++++++++++++++++------------------
 11 files changed, 161 insertions(+), 167 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 78dde56..e96f029 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4037,8 +4037,8 @@ static const struct net_device_ops bond_netdev_ops = {
 	.ndo_add_slave		= bond_enslave,
 	.ndo_del_slave		= bond_release,
 	.ndo_fix_features	= bond_fix_features,
-	.ndo_bridge_setlink	= ndo_dflt_netdev_switch_port_bridge_setlink,
-	.ndo_bridge_dellink	= ndo_dflt_netdev_switch_port_bridge_dellink,
+	.ndo_bridge_setlink	= ndo_dflt_switchdev_port_bridge_setlink,
+	.ndo_bridge_dellink	= ndo_dflt_switchdev_port_bridge_dellink,
 	.ndo_features_check	= passthru_features_check,
 };
 
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index a87b177..6d31aeb 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -3377,17 +3377,17 @@ static void rocker_port_fdb_learn_work(struct work_struct *work)
 		container_of(work, struct rocker_fdb_learn_work, work);
 	bool removing = (lw->flags & ROCKER_OP_FLAG_REMOVE);
 	bool learned = (lw->flags & ROCKER_OP_FLAG_LEARNED);
-	struct netdev_switch_notifier_fdb_info info;
+	struct switchdev_notifier_fdb_info info;
 
 	info.addr = lw->addr;
 	info.vid = lw->vid;
 
 	if (learned && removing)
-		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_DEL,
-					     lw->dev, &info.info);
+		call_switchdev_notifiers(NETDEV_SWITCH_FDB_DEL,
+					 lw->dev, &info.info);
 	else if (learned && !removing)
-		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_ADD,
-					     lw->dev, &info.info);
+		call_switchdev_notifiers(NETDEV_SWITCH_FDB_ADD,
+					 lw->dev, &info.info);
 
 	kfree(work);
 }
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 6928448..cfe8496 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1977,8 +1977,8 @@ static const struct net_device_ops team_netdev_ops = {
 	.ndo_del_slave		= team_del_slave,
 	.ndo_fix_features	= team_fix_features,
 	.ndo_change_carrier     = team_change_carrier,
-	.ndo_bridge_setlink     = ndo_dflt_netdev_switch_port_bridge_setlink,
-	.ndo_bridge_dellink     = ndo_dflt_netdev_switch_port_bridge_dellink,
+	.ndo_bridge_setlink     = ndo_dflt_switchdev_port_bridge_setlink,
+	.ndo_bridge_dellink     = ndo_dflt_switchdev_port_bridge_dellink,
 	.ndo_features_check	= passthru_features_check,
 };
 
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index d2e69ee..9b43228 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -43,124 +43,124 @@ struct swdev_ops {
 				      u8 tos, u8 type, u32 tb_id);
 };
 
-enum netdev_switch_notifier_type {
+enum switchdev_notifier_type {
 	NETDEV_SWITCH_FDB_ADD = 1,
 	NETDEV_SWITCH_FDB_DEL,
 };
 
-struct netdev_switch_notifier_info {
+struct switchdev_notifier_info {
 	struct net_device *dev;
 };
 
-struct netdev_switch_notifier_fdb_info {
-	struct netdev_switch_notifier_info info; /* must be first */
+struct switchdev_notifier_fdb_info {
+	struct switchdev_notifier_info info; /* must be first */
 	const unsigned char *addr;
 	u16 vid;
 };
 
 static inline struct net_device *
-netdev_switch_notifier_info_to_dev(const struct netdev_switch_notifier_info *info)
+switchdev_notifier_info_to_dev(const struct switchdev_notifier_info *info)
 {
 	return info->dev;
 }
 
 #ifdef CONFIG_NET_SWITCHDEV
 
-int netdev_switch_parent_id_get(struct net_device *dev,
-				struct netdev_phys_item_id *psid);
-int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
-int register_netdev_switch_notifier(struct notifier_block *nb);
-int unregister_netdev_switch_notifier(struct notifier_block *nb);
-int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
-				 struct netdev_switch_notifier_info *info);
-int netdev_switch_port_bridge_setlink(struct net_device *dev,
-				struct nlmsghdr *nlh, u16 flags);
-int netdev_switch_port_bridge_dellink(struct net_device *dev,
-				struct nlmsghdr *nlh, u16 flags);
-int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
-					       struct nlmsghdr *nlh, u16 flags);
-int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
-					       struct nlmsghdr *nlh, u16 flags);
-int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
-			       u8 tos, u8 type, u32 nlflags, u32 tb_id);
-int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
-			       u8 tos, u8 type, u32 tb_id);
-void netdev_switch_fib_ipv4_abort(struct fib_info *fi);
+int switchdev_parent_id_get(struct net_device *dev,
+			    struct netdev_phys_item_id *psid);
+int switchdev_port_stp_update(struct net_device *dev, u8 state);
+int register_switchdev_notifier(struct notifier_block *nb);
+int unregister_switchdev_notifier(struct notifier_block *nb);
+int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
+			     struct switchdev_notifier_info *info);
+int switchdev_port_bridge_setlink(struct net_device *dev,
+				  struct nlmsghdr *nlh, u16 flags);
+int switchdev_port_bridge_dellink(struct net_device *dev,
+				  struct nlmsghdr *nlh, u16 flags);
+int ndo_dflt_switchdev_port_bridge_dellink(struct net_device *dev,
+					   struct nlmsghdr *nlh, u16 flags);
+int ndo_dflt_switchdev_port_bridge_setlink(struct net_device *dev,
+					   struct nlmsghdr *nlh, u16 flags);
+int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
+			   u8 tos, u8 type, u32 nlflags, u32 tb_id);
+int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
+			   u8 tos, u8 type, u32 tb_id);
+void switchdev_fib_ipv4_abort(struct fib_info *fi);
 
 #else
 
-static inline int netdev_switch_parent_id_get(struct net_device *dev,
-					      struct netdev_phys_item_id *psid)
+static inline int switchdev_parent_id_get(struct net_device *dev,
+					  struct netdev_phys_item_id *psid)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline int netdev_switch_port_stp_update(struct net_device *dev,
-						u8 state)
+static inline int switchdev_port_stp_update(struct net_device *dev,
+					    u8 state)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline int register_netdev_switch_notifier(struct notifier_block *nb)
+static inline int register_switchdev_notifier(struct notifier_block *nb)
 {
 	return 0;
 }
 
-static inline int unregister_netdev_switch_notifier(struct notifier_block *nb)
+static inline int unregister_switchdev_notifier(struct notifier_block *nb)
 {
 	return 0;
 }
 
-static inline int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
-					       struct netdev_switch_notifier_info *info)
+static inline int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
+					   struct switchdev_notifier_info *info)
 {
 	return NOTIFY_DONE;
 }
 
-static inline int netdev_switch_port_bridge_setlink(struct net_device *dev,
-						    struct nlmsghdr *nlh,
-						    u16 flags)
+static inline int switchdev_port_bridge_setlink(struct net_device *dev,
+						struct nlmsghdr *nlh,
+						u16 flags)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline int netdev_switch_port_bridge_dellink(struct net_device *dev,
-						    struct nlmsghdr *nlh,
-						    u16 flags)
+static inline int switchdev_port_bridge_dellink(struct net_device *dev,
+						struct nlmsghdr *nlh,
+						u16 flags)
 {
 	return -EOPNOTSUPP;
 }
 
-static inline int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
-							struct nlmsghdr *nlh,
-							u16 flags)
+static inline int ndo_dflt_switchdev_port_bridge_dellink(struct net_device *dev,
+							 struct nlmsghdr *nlh,
+							 u16 flags)
 {
 	return 0;
 }
 
-static inline int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
-							struct nlmsghdr *nlh,
-							u16 flags)
+static inline int ndo_dflt_switchdev_port_bridge_setlink(struct net_device *dev,
+							 struct nlmsghdr *nlh,
+							 u16 flags)
 {
 	return 0;
 }
 
-static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
-					     struct fib_info *fi,
-					     u8 tos, u8 type,
-					     u32 nlflags, u32 tb_id)
+static inline int switchdev_fib_ipv4_add(u32 dst, int dst_len,
+					 struct fib_info *fi,
+					 u8 tos, u8 type,
+					 u32 nlflags, u32 tb_id)
 {
 	return 0;
 }
 
-static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
-					     struct fib_info *fi,
-					     u8 tos, u8 type, u32 tb_id)
+static inline int switchdev_fib_ipv4_del(u32 dst, int dst_len,
+					 struct fib_info *fi,
+					 u8 tos, u8 type, u32 tb_id)
 {
 	return 0;
 }
 
-static inline void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
+static inline void switchdev_fib_ipv4_abort(struct fib_info *fi)
 {
 }
 
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 02c24cf..8ef26d0 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -121,13 +121,13 @@ static struct notifier_block br_device_notifier = {
 	.notifier_call = br_device_event
 };
 
-static int br_netdev_switch_event(struct notifier_block *unused,
-				  unsigned long event, void *ptr)
+static int br_switchdev_event(struct notifier_block *unused,
+			      unsigned long event, void *ptr)
 {
-	struct net_device *dev = netdev_switch_notifier_info_to_dev(ptr);
+	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
 	struct net_bridge_port *p;
 	struct net_bridge *br;
-	struct netdev_switch_notifier_fdb_info *fdb_info;
+	struct switchdev_notifier_fdb_info *fdb_info;
 	int err = NOTIFY_DONE;
 
 	rtnl_lock();
@@ -159,8 +159,8 @@ out:
 	return err;
 }
 
-static struct notifier_block br_netdev_switch_notifier = {
-	.notifier_call = br_netdev_switch_event,
+static struct notifier_block br_switchdev_notifier = {
+	.notifier_call = br_switchdev_event,
 };
 
 static void __net_exit br_net_exit(struct net *net)
@@ -214,7 +214,7 @@ static int __init br_init(void)
 	if (err)
 		goto err_out3;
 
-	err = register_netdev_switch_notifier(&br_netdev_switch_notifier);
+	err = register_switchdev_notifier(&br_switchdev_notifier);
 	if (err)
 		goto err_out4;
 
@@ -235,7 +235,7 @@ static int __init br_init(void)
 	return 0;
 
 err_out5:
-	unregister_netdev_switch_notifier(&br_netdev_switch_notifier);
+	unregister_switchdev_notifier(&br_switchdev_notifier);
 err_out4:
 	unregister_netdevice_notifier(&br_device_notifier);
 err_out3:
@@ -253,7 +253,7 @@ static void __exit br_deinit(void)
 {
 	stp_proto_unregister(&br_stp_proto);
 	br_netlink_fini();
-	unregister_netdev_switch_notifier(&br_netdev_switch_notifier);
+	unregister_switchdev_notifier(&br_switchdev_notifier);
 	unregister_netdevice_notifier(&br_device_notifier);
 	brioctl_set(NULL);
 	unregister_pernet_subsys(&br_net_ops);
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 0e4ddb8..8f66366 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -631,8 +631,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
 	if (p && !(flags & BRIDGE_FLAGS_SELF)) {
 		/* set bridge attributes in hardware if supported
 		 */
-		ret_offload = netdev_switch_port_bridge_setlink(dev, nlh,
-								flags);
+		ret_offload = switchdev_port_bridge_setlink(dev, nlh, flags);
 		if (ret_offload && ret_offload != -EOPNOTSUPP)
 			br_warn(p->br, "error setting attrs on port %u(%s)\n",
 				(unsigned int)p->port_no, p->dev->name);
@@ -671,8 +670,7 @@ int br_dellink(struct net_device *dev, struct nlmsghdr *nlh, u16 flags)
 	if (p && !(flags & BRIDGE_FLAGS_SELF)) {
 		/* del bridge attributes in hardware
 		 */
-		ret_offload = netdev_switch_port_bridge_dellink(dev, nlh,
-								flags);
+		ret_offload = switchdev_port_bridge_dellink(dev, nlh, flags);
 		if (ret_offload && ret_offload != -EOPNOTSUPP)
 			br_warn(p->br, "error deleting attrs on port %u (%s)\n",
 				(unsigned int)p->port_no, p->dev->name);
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index fb3ebe6..28e3f4b 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -42,7 +42,7 @@ void br_set_state(struct net_bridge_port *p, unsigned int state)
 	int err;
 
 	p->state = state;
-	err = netdev_switch_port_stp_update(p->dev, state);
+	err = switchdev_port_stp_update(p->dev, state);
 	if (err && err != -EOPNOTSUPP)
 		br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
 				(unsigned int) p->port_no, p->dev->name);
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 4238d6d..be86a7c 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -460,7 +460,7 @@ static ssize_t phys_switch_id_show(struct device *dev,
 	if (dev_isalive(netdev)) {
 		struct netdev_phys_item_id ppid;
 
-		ret = netdev_switch_parent_id_get(netdev, &ppid);
+		ret = switchdev_parent_id_get(netdev, &ppid);
 		if (!ret)
 			ret = sprintf(buf, "%*phN\n", ppid.id_len, ppid.id);
 	}
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 358d52a..145bbe7 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1006,7 +1006,7 @@ static int rtnl_phys_switch_id_fill(struct sk_buff *skb, struct net_device *dev)
 	int err;
 	struct netdev_phys_item_id psid;
 
-	err = netdev_switch_parent_id_get(dev, &psid);
+	err = switchdev_parent_id_get(dev, &psid);
 	if (err) {
 		if (err == -EOPNOTSUPP)
 			return 0;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index e13fcc6..03444c6 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1165,13 +1165,13 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 			new_fa->fa_state = state & ~FA_S_ACCESSED;
 			new_fa->fa_slen = fa->fa_slen;
 
-			err = netdev_switch_fib_ipv4_add(key, plen, fi,
-							 new_fa->fa_tos,
-							 cfg->fc_type,
-							 cfg->fc_nlflags,
-							 tb->tb_id);
+			err = switchdev_fib_ipv4_add(key, plen, fi,
+						     new_fa->fa_tos,
+						     cfg->fc_type,
+						     cfg->fc_nlflags,
+						     tb->tb_id);
 			if (err) {
-				netdev_switch_fib_ipv4_abort(fi);
+				switchdev_fib_ipv4_abort(fi);
 				kmem_cache_free(fn_alias_kmem, new_fa);
 				goto out;
 			}
@@ -1215,12 +1215,10 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg)
 	new_fa->tb_id = tb->tb_id;
 
 	/* (Optionally) offload fib entry to switch hardware. */
-	err = netdev_switch_fib_ipv4_add(key, plen, fi, tos,
-					 cfg->fc_type,
-					 cfg->fc_nlflags,
-					 tb->tb_id);
+	err = switchdev_fib_ipv4_add(key, plen, fi, tos, cfg->fc_type,
+				     cfg->fc_nlflags, tb->tb_id);
 	if (err) {
-		netdev_switch_fib_ipv4_abort(fi);
+		switchdev_fib_ipv4_abort(fi);
 		goto out_free_new_fa;
 	}
 
@@ -1239,7 +1237,7 @@ succeeded:
 	return 0;
 
 out_sw_fib_del:
-	netdev_switch_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type, tb->tb_id);
+	switchdev_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type, tb->tb_id);
 out_free_new_fa:
 	kmem_cache_free(fn_alias_kmem, new_fa);
 out:
@@ -1517,8 +1515,8 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg)
 	if (!fa_to_delete)
 		return -ESRCH;
 
-	netdev_switch_fib_ipv4_del(key, plen, fa_to_delete->fa_info, tos,
-				   cfg->fc_type, tb->tb_id);
+	switchdev_fib_ipv4_del(key, plen, fa_to_delete->fa_info, tos,
+			       cfg->fc_type, tb->tb_id);
 
 	rtmsg_fib(RTM_DELROUTE, htonl(key), fa_to_delete, plen, tb->tb_id,
 		  &cfg->fc_nlinfo, 0);
@@ -1767,10 +1765,9 @@ void fib_table_flush_external(struct fib_table *tb)
 			if (!fi || !(fi->fib_flags & RTNH_F_EXTERNAL))
 				continue;
 
-			netdev_switch_fib_ipv4_del(n->key,
-						   KEYLENGTH - fa->fa_slen,
-						   fi, fa->fa_tos,
-						   fa->fa_type, tb->tb_id);
+			switchdev_fib_ipv4_del(n->key, KEYLENGTH - fa->fa_slen,
+					       fi, fa->fa_tos, fa->fa_type,
+					       tb->tb_id);
 		}
 
 		/* update leaf slen */
@@ -1835,10 +1832,9 @@ int fib_table_flush(struct fib_table *tb)
 				continue;
 			}
 
-			netdev_switch_fib_ipv4_del(n->key,
-						   KEYLENGTH - fa->fa_slen,
-						   fi, fa->fa_tos,
-						   fa->fa_type, tb->tb_id);
+			switchdev_fib_ipv4_del(n->key, KEYLENGTH - fa->fa_slen,
+					       fi, fa->fa_tos, fa->fa_type,
+					       tb->tb_id);
 			hlist_del_rcu(&fa->fa_list);
 			fib_release_info(fa->fa_info);
 			alias_free_mem_rcu(fa);
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 46568b8..52613ed 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -19,14 +19,14 @@
 #include <net/switchdev.h>
 
 /**
- *	netdev_switch_parent_id_get - Get ID of a switch
+ *	switchdev_parent_id_get - Get ID of a switch
  *	@dev: port device
  *	@psid: switch ID
  *
  *	Get ID of a switch this port is part of.
  */
-int netdev_switch_parent_id_get(struct net_device *dev,
-				struct netdev_phys_item_id *psid)
+int switchdev_parent_id_get(struct net_device *dev,
+			    struct netdev_phys_item_id *psid)
 {
 	const struct swdev_ops *ops = dev->swdev_ops;
 
@@ -34,17 +34,17 @@ int netdev_switch_parent_id_get(struct net_device *dev,
 		return -EOPNOTSUPP;
 	return ops->swdev_parent_id_get(dev, psid);
 }
-EXPORT_SYMBOL_GPL(netdev_switch_parent_id_get);
+EXPORT_SYMBOL_GPL(switchdev_parent_id_get);
 
 /**
- *	netdev_switch_port_stp_update - Notify switch device port of STP
+ *	switchdev_port_stp_update - Notify switch device port of STP
  *					state change
  *	@dev: port device
  *	@state: port STP state
  *
  *	Notify switch device port of bridge port STP state change.
  */
-int netdev_switch_port_stp_update(struct net_device *dev, u8 state)
+int switchdev_port_stp_update(struct net_device *dev, u8 state)
 {
 	const struct swdev_ops *ops = dev->swdev_ops;
 	struct net_device *lower_dev;
@@ -55,57 +55,57 @@ int netdev_switch_port_stp_update(struct net_device *dev, u8 state)
 		return ops->swdev_port_stp_update(dev, state);
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
-		err = netdev_switch_port_stp_update(lower_dev, state);
+		err = switchdev_port_stp_update(lower_dev, state);
 		if (err && err != -EOPNOTSUPP)
 			return err;
 	}
 
 	return err;
 }
-EXPORT_SYMBOL_GPL(netdev_switch_port_stp_update);
+EXPORT_SYMBOL_GPL(switchdev_port_stp_update);
 
-static DEFINE_MUTEX(netdev_switch_mutex);
-static RAW_NOTIFIER_HEAD(netdev_switch_notif_chain);
+static DEFINE_MUTEX(switchdev_mutex);
+static RAW_NOTIFIER_HEAD(switchdev_notif_chain);
 
 /**
- *	register_netdev_switch_notifier - Register notifier
+ *	register_switchdev_notifier - Register notifier
  *	@nb: notifier_block
  *
  *	Register switch device notifier. This should be used by code
  *	which needs to monitor events happening in particular device.
  *	Return values are same as for atomic_notifier_chain_register().
  */
-int register_netdev_switch_notifier(struct notifier_block *nb)
+int register_switchdev_notifier(struct notifier_block *nb)
 {
 	int err;
 
-	mutex_lock(&netdev_switch_mutex);
-	err = raw_notifier_chain_register(&netdev_switch_notif_chain, nb);
-	mutex_unlock(&netdev_switch_mutex);
+	mutex_lock(&switchdev_mutex);
+	err = raw_notifier_chain_register(&switchdev_notif_chain, nb);
+	mutex_unlock(&switchdev_mutex);
 	return err;
 }
-EXPORT_SYMBOL_GPL(register_netdev_switch_notifier);
+EXPORT_SYMBOL_GPL(register_switchdev_notifier);
 
 /**
- *	unregister_netdev_switch_notifier - Unregister notifier
+ *	unregister_switchdev_notifier - Unregister notifier
  *	@nb: notifier_block
  *
  *	Unregister switch device notifier.
  *	Return values are same as for atomic_notifier_chain_unregister().
  */
-int unregister_netdev_switch_notifier(struct notifier_block *nb)
+int unregister_switchdev_notifier(struct notifier_block *nb)
 {
 	int err;
 
-	mutex_lock(&netdev_switch_mutex);
-	err = raw_notifier_chain_unregister(&netdev_switch_notif_chain, nb);
-	mutex_unlock(&netdev_switch_mutex);
+	mutex_lock(&switchdev_mutex);
+	err = raw_notifier_chain_unregister(&switchdev_notif_chain, nb);
+	mutex_unlock(&switchdev_mutex);
 	return err;
 }
-EXPORT_SYMBOL_GPL(unregister_netdev_switch_notifier);
+EXPORT_SYMBOL_GPL(unregister_switchdev_notifier);
 
 /**
- *	call_netdev_switch_notifiers - Call notifiers
+ *	call_switchdev_notifiers - Call notifiers
  *	@val: value passed unmodified to notifier function
  *	@dev: port device
  *	@info: notifier information data
@@ -114,21 +114,21 @@ EXPORT_SYMBOL_GPL(unregister_netdev_switch_notifier);
  *	when it needs to propagate hardware event.
  *	Return values are same as for atomic_notifier_call_chain().
  */
-int call_netdev_switch_notifiers(unsigned long val, struct net_device *dev,
-				 struct netdev_switch_notifier_info *info)
+int call_switchdev_notifiers(unsigned long val, struct net_device *dev,
+			     struct switchdev_notifier_info *info)
 {
 	int err;
 
 	info->dev = dev;
-	mutex_lock(&netdev_switch_mutex);
-	err = raw_notifier_call_chain(&netdev_switch_notif_chain, val, info);
-	mutex_unlock(&netdev_switch_mutex);
+	mutex_lock(&switchdev_mutex);
+	err = raw_notifier_call_chain(&switchdev_notif_chain, val, info);
+	mutex_unlock(&switchdev_mutex);
 	return err;
 }
-EXPORT_SYMBOL_GPL(call_netdev_switch_notifiers);
+EXPORT_SYMBOL_GPL(call_switchdev_notifiers);
 
 /**
- *	netdev_switch_port_bridge_setlink - Notify switch device port of bridge
+ *	switchdev_port_bridge_setlink - Notify switch device port of bridge
  *	port attributes
  *
  *	@dev: port device
@@ -137,8 +137,8 @@ EXPORT_SYMBOL_GPL(call_netdev_switch_notifiers);
  *
  *	Notify switch device port of bridge port attributes
  */
-int netdev_switch_port_bridge_setlink(struct net_device *dev,
-				      struct nlmsghdr *nlh, u16 flags)
+int switchdev_port_bridge_setlink(struct net_device *dev,
+				  struct nlmsghdr *nlh, u16 flags)
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
 
@@ -150,10 +150,10 @@ int netdev_switch_port_bridge_setlink(struct net_device *dev,
 
 	return ops->ndo_bridge_setlink(dev, nlh, flags);
 }
-EXPORT_SYMBOL_GPL(netdev_switch_port_bridge_setlink);
+EXPORT_SYMBOL_GPL(switchdev_port_bridge_setlink);
 
 /**
- *	netdev_switch_port_bridge_dellink - Notify switch device port of bridge
+ *	switchdev_port_bridge_dellink - Notify switch device port of bridge
  *	port attribute delete
  *
  *	@dev: port device
@@ -162,8 +162,8 @@ EXPORT_SYMBOL_GPL(netdev_switch_port_bridge_setlink);
  *
  *	Notify switch device port of bridge port attribute delete
  */
-int netdev_switch_port_bridge_dellink(struct net_device *dev,
-				      struct nlmsghdr *nlh, u16 flags)
+int switchdev_port_bridge_dellink(struct net_device *dev,
+				  struct nlmsghdr *nlh, u16 flags)
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
 
@@ -175,11 +175,11 @@ int netdev_switch_port_bridge_dellink(struct net_device *dev,
 
 	return ops->ndo_bridge_dellink(dev, nlh, flags);
 }
-EXPORT_SYMBOL_GPL(netdev_switch_port_bridge_dellink);
+EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink);
 
 /**
- *	ndo_dflt_netdev_switch_port_bridge_setlink - default ndo bridge setlink
- *						     op for master devices
+ *	ndo_dflt_switchdev_port_bridge_setlink - default ndo bridge setlink
+ *						 op for master devices
  *
  *	@dev: port device
  *	@nlh: netlink msg with bridge port attributes
@@ -187,8 +187,8 @@ EXPORT_SYMBOL_GPL(netdev_switch_port_bridge_dellink);
  *
  *	Notify master device slaves of bridge port attributes
  */
-int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
-					       struct nlmsghdr *nlh, u16 flags)
+int ndo_dflt_switchdev_port_bridge_setlink(struct net_device *dev,
+					   struct nlmsghdr *nlh, u16 flags)
 {
 	struct net_device *lower_dev;
 	struct list_head *iter;
@@ -198,18 +198,18 @@ int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
 		return ret;
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
-		err = netdev_switch_port_bridge_setlink(lower_dev, nlh, flags);
+		err = switchdev_port_bridge_setlink(lower_dev, nlh, flags);
 		if (err && err != -EOPNOTSUPP)
 			ret = err;
 	}
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(ndo_dflt_netdev_switch_port_bridge_setlink);
+EXPORT_SYMBOL_GPL(ndo_dflt_switchdev_port_bridge_setlink);
 
 /**
- *	ndo_dflt_netdev_switch_port_bridge_dellink - default ndo bridge dellink
- *						     op for master devices
+ *	ndo_dflt_switchdev_port_bridge_dellink - default ndo bridge dellink
+ *						 op for master devices
  *
  *	@dev: port device
  *	@nlh: netlink msg with bridge port attributes
@@ -217,8 +217,8 @@ EXPORT_SYMBOL_GPL(ndo_dflt_netdev_switch_port_bridge_setlink);
  *
  *	Notify master device slaves of bridge port attribute deletes
  */
-int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
-					       struct nlmsghdr *nlh, u16 flags)
+int ndo_dflt_switchdev_port_bridge_dellink(struct net_device *dev,
+					   struct nlmsghdr *nlh, u16 flags)
 {
 	struct net_device *lower_dev;
 	struct list_head *iter;
@@ -228,16 +228,16 @@ int ndo_dflt_netdev_switch_port_bridge_dellink(struct net_device *dev,
 		return ret;
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
-		err = netdev_switch_port_bridge_dellink(lower_dev, nlh, flags);
+		err = switchdev_port_bridge_dellink(lower_dev, nlh, flags);
 		if (err && err != -EOPNOTSUPP)
 			ret = err;
 	}
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(ndo_dflt_netdev_switch_port_bridge_dellink);
+EXPORT_SYMBOL_GPL(ndo_dflt_switchdev_port_bridge_dellink);
 
-static struct net_device *netdev_switch_get_lowest_dev(struct net_device *dev)
+static struct net_device *switchdev_get_lowest_dev(struct net_device *dev)
 {
 	const struct swdev_ops *ops = dev->swdev_ops;
 	struct net_device *lower_dev;
@@ -253,7 +253,7 @@ static struct net_device *netdev_switch_get_lowest_dev(struct net_device *dev)
 		return dev;
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
-		port_dev = netdev_switch_get_lowest_dev(lower_dev);
+		port_dev = switchdev_get_lowest_dev(lower_dev);
 		if (port_dev)
 			return port_dev;
 	}
@@ -261,7 +261,7 @@ static struct net_device *netdev_switch_get_lowest_dev(struct net_device *dev)
 	return NULL;
 }
 
-static struct net_device *netdev_switch_get_dev_by_nhs(struct fib_info *fi)
+static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
 {
 	struct netdev_phys_item_id psid;
 	struct netdev_phys_item_id prev_psid;
@@ -276,11 +276,11 @@ static struct net_device *netdev_switch_get_dev_by_nhs(struct fib_info *fi)
 		if (!nh->nh_dev)
 			return NULL;
 
-		dev = netdev_switch_get_lowest_dev(nh->nh_dev);
+		dev = switchdev_get_lowest_dev(nh->nh_dev);
 		if (!dev)
 			return NULL;
 
-		if (netdev_switch_parent_id_get(dev, &psid))
+		if (switchdev_parent_id_get(dev, &psid))
 			return NULL;
 
 		if (nhsel > 0) {
@@ -297,7 +297,7 @@ static struct net_device *netdev_switch_get_dev_by_nhs(struct fib_info *fi)
 }
 
 /**
- *	netdev_switch_fib_ipv4_add - Add IPv4 route entry to switch
+ *	switchdev_fib_ipv4_add - Add IPv4 route entry to switch
  *
  *	@dst: route's IPv4 destination address
  *	@dst_len: destination address length (prefix length)
@@ -309,8 +309,8 @@ static struct net_device *netdev_switch_get_dev_by_nhs(struct fib_info *fi)
  *
  *	Add IPv4 route entry to switch device.
  */
-int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
-			       u8 tos, u8 type, u32 nlflags, u32 tb_id)
+int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
+			   u8 tos, u8 type, u32 nlflags, u32 tb_id)
 {
 	struct net_device *dev;
 	const struct swdev_ops *ops;
@@ -328,7 +328,7 @@ int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
 	if (fi->fib_net->ipv4.fib_offload_disabled)
 		return 0;
 
-	dev = netdev_switch_get_dev_by_nhs(fi);
+	dev = switchdev_get_dev_by_nhs(fi);
 	if (!dev)
 		return 0;
 	ops = dev->swdev_ops;
@@ -343,10 +343,10 @@ int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
 
 	return err;
 }
-EXPORT_SYMBOL_GPL(netdev_switch_fib_ipv4_add);
+EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_add);
 
 /**
- *	netdev_switch_fib_ipv4_del - Delete IPv4 route entry from switch
+ *	switchdev_fib_ipv4_del - Delete IPv4 route entry from switch
  *
  *	@dst: route's IPv4 destination address
  *	@dst_len: destination address length (prefix length)
@@ -357,8 +357,8 @@ EXPORT_SYMBOL_GPL(netdev_switch_fib_ipv4_add);
  *
  *	Delete IPv4 route entry from switch device.
  */
-int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
-			       u8 tos, u8 type, u32 tb_id)
+int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
+			   u8 tos, u8 type, u32 tb_id)
 {
 	struct net_device *dev;
 	const struct swdev_ops *ops;
@@ -367,7 +367,7 @@ int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
 	if (!(fi->fib_flags & RTNH_F_EXTERNAL))
 		return 0;
 
-	dev = netdev_switch_get_dev_by_nhs(fi);
+	dev = switchdev_get_dev_by_nhs(fi);
 	if (!dev)
 		return 0;
 	ops = dev->swdev_ops;
@@ -381,14 +381,14 @@ int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
 
 	return err;
 }
-EXPORT_SYMBOL_GPL(netdev_switch_fib_ipv4_del);
+EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_del);
 
 /**
- *	netdev_switch_fib_ipv4_abort - Abort an IPv4 FIB operation
+ *	switchdev_fib_ipv4_abort - Abort an IPv4 FIB operation
  *
  *	@fi: route FIB info structure
  */
-void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
+void switchdev_fib_ipv4_abort(struct fib_info *fi)
 {
 	/* There was a problem installing this route to the offload
 	 * device.  For now, until we come up with more refined
@@ -401,4 +401,4 @@ void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
 	fib_flush_external(fi->fib_net);
 	fi->fib_net->ipv4.fib_offload_disabled = true;
 }
-EXPORT_SYMBOL_GPL(netdev_switch_fib_ipv4_abort);
+EXPORT_SYMBOL_GPL(switchdev_fib_ipv4_abort);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [patch net-next 2/2] switchdev: s/swdev_/switchdev_/
  2015-04-13 14:14 [patch net-next 0/2] switchdev: unify naming prefix Jiri Pirko
  2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
@ 2015-04-13 14:14 ` Jiri Pirko
  2015-04-13 17:50 ` [patch net-next 0/2] switchdev: unify naming prefix Andy Gospodarek
  2 siblings, 0 replies; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 14:14 UTC (permalink / raw)
  To: netdev; +Cc: davem, sfeldma, roopa, f.fainelli, gospo

Turned out that "switchdev" sticks. So just unify all releated terms to
use this prefix.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/ethernet/rocker/rocker.c | 37 +++++++++++++++++----------------
 include/linux/netdevice.h            |  2 +-
 include/net/switchdev.h              | 30 +++++++++++++--------------
 net/dsa/slave.c                      |  8 ++++----
 net/switchdev/switchdev.c            | 40 ++++++++++++++++++------------------
 5 files changed, 59 insertions(+), 58 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 6d31aeb..23372dd 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4220,8 +4220,8 @@ static const struct net_device_ops rocker_port_netdev_ops = {
  * swdev interface
  ********************/
 
-static int rocker_port_swdev_parent_id_get(struct net_device *dev,
-					   struct netdev_phys_item_id *psid)
+static int rocker_port_switchdev_parent_id_get(struct net_device *dev,
+					       struct netdev_phys_item_id *psid)
 {
 	struct rocker_port *rocker_port = netdev_priv(dev);
 	struct rocker *rocker = rocker_port->rocker;
@@ -4231,18 +4231,19 @@ static int rocker_port_swdev_parent_id_get(struct net_device *dev,
 	return 0;
 }
 
-static int rocker_port_swdev_port_stp_update(struct net_device *dev, u8 state)
+static int rocker_port_switchdev_port_stp_update(struct net_device *dev,
+						 u8 state)
 {
 	struct rocker_port *rocker_port = netdev_priv(dev);
 
 	return rocker_port_stp_update(rocker_port, state);
 }
 
-static int rocker_port_swdev_fib_ipv4_add(struct net_device *dev,
-					  __be32 dst, int dst_len,
-					  struct fib_info *fi,
-					  u8 tos, u8 type,
-					  u32 nlflags, u32 tb_id)
+static int rocker_port_switchdev_fib_ipv4_add(struct net_device *dev,
+					      __be32 dst, int dst_len,
+					      struct fib_info *fi,
+					      u8 tos, u8 type,
+					      u32 nlflags, u32 tb_id)
 {
 	struct rocker_port *rocker_port = netdev_priv(dev);
 	int flags = 0;
@@ -4251,10 +4252,10 @@ static int rocker_port_swdev_fib_ipv4_add(struct net_device *dev,
 				    fi, tb_id, flags);
 }
 
-static int rocker_port_swdev_fib_ipv4_del(struct net_device *dev,
-					  __be32 dst, int dst_len,
-					  struct fib_info *fi,
-					  u8 tos, u8 type, u32 tb_id)
+static int rocker_port_switchdev_fib_ipv4_del(struct net_device *dev,
+					      __be32 dst, int dst_len,
+					      struct fib_info *fi,
+					      u8 tos, u8 type, u32 tb_id)
 {
 	struct rocker_port *rocker_port = netdev_priv(dev);
 	int flags = ROCKER_OP_FLAG_REMOVE;
@@ -4263,11 +4264,11 @@ static int rocker_port_swdev_fib_ipv4_del(struct net_device *dev,
 				    fi, tb_id, flags);
 }
 
-static const struct swdev_ops rocker_port_swdev_ops = {
-	.swdev_parent_id_get		= rocker_port_swdev_parent_id_get,
-	.swdev_port_stp_update		= rocker_port_swdev_port_stp_update,
-	.swdev_fib_ipv4_add		= rocker_port_swdev_fib_ipv4_add,
-	.swdev_fib_ipv4_del		= rocker_port_swdev_fib_ipv4_del,
+static const struct switchdev_ops rocker_port_switchdev_ops = {
+	.switchdev_parent_id_get	= rocker_port_switchdev_parent_id_get,
+	.switchdev_port_stp_update	= rocker_port_switchdev_port_stp_update,
+	.switchdev_fib_ipv4_add		= rocker_port_switchdev_fib_ipv4_add,
+	.switchdev_fib_ipv4_del		= rocker_port_switchdev_fib_ipv4_del,
 };
 
 /********************
@@ -4622,7 +4623,7 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
 	rocker_port_dev_addr_init(rocker, rocker_port);
 	dev->netdev_ops = &rocker_port_netdev_ops;
 	dev->ethtool_ops = &rocker_port_ethtool_ops;
-	dev->swdev_ops = &rocker_port_swdev_ops;
+	dev->switchdev_ops = &rocker_port_switchdev_ops;
 	netif_napi_add(dev, &rocker_port->napi_tx, rocker_port_poll_tx,
 		       NAPI_POLL_WEIGHT);
 	netif_napi_add(dev, &rocker_port->napi_rx, rocker_port_poll_rx,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 13acb3d..140fdc7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1564,7 +1564,7 @@ struct net_device {
 	const struct net_device_ops *netdev_ops;
 	const struct ethtool_ops *ethtool_ops;
 #ifdef CONFIG_NET_SWITCHDEV
-	const struct swdev_ops *swdev_ops;
+	const struct switchdev_ops *switchdev_ops;
 #endif
 
 	const struct header_ops *header_ops;
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 9b43228..1f6ee90 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -19,28 +19,28 @@ struct fib_info;
 /**
  * struct switchdev_ops - switchdev operations
  *
- * @swdev_parent_id_get: Called to get an ID of the switch chip this port
+ * @switchdev_parent_id_get: Called to get an ID of the switch chip this port
  *   is part of.  If driver implements this, it indicates that it
  *   represents a port of a switch chip.
  *
- * @swdev_port_stp_update: Called to notify switch device port of bridge
+ * @switchdev_port_stp_update: Called to notify switch device port of bridge
  *   port STP state change.
  *
- * @swdev_fib_ipv4_add: Called to add/modify IPv4 route to switch device.
+ * @switchdev_fib_ipv4_add: Called to add/modify IPv4 route to switch device.
  *
- * @swdev_fib_ipv4_del: Called to delete IPv4 route from switch device.
+ * @switchdev_fib_ipv4_del: Called to delete IPv4 route from switch device.
  */
-struct swdev_ops {
-	int	(*swdev_parent_id_get)(struct net_device *dev,
-				       struct netdev_phys_item_id *psid);
-	int	(*swdev_port_stp_update)(struct net_device *dev, u8 state);
-	int	(*swdev_fib_ipv4_add)(struct net_device *dev, __be32 dst,
-				      int dst_len, struct fib_info *fi,
-				      u8 tos, u8 type, u32 nlflags,
-				      u32 tb_id);
-	int	(*swdev_fib_ipv4_del)(struct net_device *dev, __be32 dst,
-				      int dst_len, struct fib_info *fi,
-				      u8 tos, u8 type, u32 tb_id);
+struct switchdev_ops {
+	int	(*switchdev_parent_id_get)(struct net_device *dev,
+					   struct netdev_phys_item_id *psid);
+	int	(*switchdev_port_stp_update)(struct net_device *dev, u8 state);
+	int	(*switchdev_fib_ipv4_add)(struct net_device *dev, __be32 dst,
+					  int dst_len, struct fib_info *fi,
+					  u8 tos, u8 type, u32 nlflags,
+					  u32 tb_id);
+	int	(*switchdev_fib_ipv4_del)(struct net_device *dev, __be32 dst,
+					  int dst_len, struct fib_info *fi,
+					  u8 tos, u8 type, u32 tb_id);
 };
 
 enum switchdev_notifier_type {
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 827cda56..aee5877 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -675,9 +675,9 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
 	.ndo_get_iflink		= dsa_slave_get_iflink,
 };
 
-static const struct swdev_ops dsa_slave_swdev_ops = {
-	.swdev_parent_id_get = dsa_slave_parent_id_get,
-	.swdev_port_stp_update = dsa_slave_stp_update,
+static const struct switchdev_ops dsa_slave_switchdev_ops = {
+	.switchdev_parent_id_get	= dsa_slave_parent_id_get,
+	.switchdev_port_stp_update	= dsa_slave_stp_update,
 };
 
 static void dsa_slave_adjust_link(struct net_device *dev)
@@ -859,7 +859,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
 	eth_hw_addr_inherit(slave_dev, master);
 	slave_dev->tx_queue_len = 0;
 	slave_dev->netdev_ops = &dsa_slave_netdev_ops;
-	slave_dev->swdev_ops = &dsa_slave_swdev_ops;
+	slave_dev->switchdev_ops = &dsa_slave_switchdev_ops;
 
 	SET_NETDEV_DEV(slave_dev, parent);
 	slave_dev->dev.of_node = ds->pd->port_dn[port];
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 52613ed..b7f44a2 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -28,11 +28,11 @@
 int switchdev_parent_id_get(struct net_device *dev,
 			    struct netdev_phys_item_id *psid)
 {
-	const struct swdev_ops *ops = dev->swdev_ops;
+	const struct switchdev_ops *ops = dev->switchdev_ops;
 
-	if (!ops || !ops->swdev_parent_id_get)
+	if (!ops || !ops->switchdev_parent_id_get)
 		return -EOPNOTSUPP;
-	return ops->swdev_parent_id_get(dev, psid);
+	return ops->switchdev_parent_id_get(dev, psid);
 }
 EXPORT_SYMBOL_GPL(switchdev_parent_id_get);
 
@@ -46,13 +46,13 @@ EXPORT_SYMBOL_GPL(switchdev_parent_id_get);
  */
 int switchdev_port_stp_update(struct net_device *dev, u8 state)
 {
-	const struct swdev_ops *ops = dev->swdev_ops;
+	const struct switchdev_ops *ops = dev->switchdev_ops;
 	struct net_device *lower_dev;
 	struct list_head *iter;
 	int err = -EOPNOTSUPP;
 
-	if (ops && ops->swdev_port_stp_update)
-		return ops->swdev_port_stp_update(dev, state);
+	if (ops && ops->switchdev_port_stp_update)
+		return ops->switchdev_port_stp_update(dev, state);
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
 		err = switchdev_port_stp_update(lower_dev, state);
@@ -239,17 +239,17 @@ EXPORT_SYMBOL_GPL(ndo_dflt_switchdev_port_bridge_dellink);
 
 static struct net_device *switchdev_get_lowest_dev(struct net_device *dev)
 {
-	const struct swdev_ops *ops = dev->swdev_ops;
+	const struct switchdev_ops *ops = dev->switchdev_ops;
 	struct net_device *lower_dev;
 	struct net_device *port_dev;
 	struct list_head *iter;
 
 	/* Recusively search down until we find a sw port dev.
-	 * (A sw port dev supports swdev_parent_id_get).
+	 * (A sw port dev supports switchdev_parent_id_get).
 	 */
 
 	if (dev->features & NETIF_F_HW_SWITCH_OFFLOAD &&
-	    ops && ops->swdev_parent_id_get)
+	    ops && ops->switchdev_parent_id_get)
 		return dev;
 
 	netdev_for_each_lower_dev(dev, lower_dev, iter) {
@@ -313,7 +313,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
 			   u8 tos, u8 type, u32 nlflags, u32 tb_id)
 {
 	struct net_device *dev;
-	const struct swdev_ops *ops;
+	const struct switchdev_ops *ops;
 	int err = 0;
 
 	/* Don't offload route if using custom ip rules or if
@@ -331,12 +331,12 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
 	dev = switchdev_get_dev_by_nhs(fi);
 	if (!dev)
 		return 0;
-	ops = dev->swdev_ops;
+	ops = dev->switchdev_ops;
 
-	if (ops->swdev_fib_ipv4_add) {
-		err = ops->swdev_fib_ipv4_add(dev, htonl(dst), dst_len,
-					      fi, tos, type, nlflags,
-					      tb_id);
+	if (ops->switchdev_fib_ipv4_add) {
+		err = ops->switchdev_fib_ipv4_add(dev, htonl(dst), dst_len,
+						  fi, tos, type, nlflags,
+						  tb_id);
 		if (!err)
 			fi->fib_flags |= RTNH_F_EXTERNAL;
 	}
@@ -361,7 +361,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
 			   u8 tos, u8 type, u32 tb_id)
 {
 	struct net_device *dev;
-	const struct swdev_ops *ops;
+	const struct switchdev_ops *ops;
 	int err = 0;
 
 	if (!(fi->fib_flags & RTNH_F_EXTERNAL))
@@ -370,11 +370,11 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
 	dev = switchdev_get_dev_by_nhs(fi);
 	if (!dev)
 		return 0;
-	ops = dev->swdev_ops;
+	ops = dev->switchdev_ops;
 
-	if (ops->swdev_fib_ipv4_del) {
-		err = ops->swdev_fib_ipv4_del(dev, htonl(dst), dst_len,
-					      fi, tos, type, tb_id);
+	if (ops->switchdev_fib_ipv4_del) {
+		err = ops->switchdev_fib_ipv4_del(dev, htonl(dst), dst_len,
+						  fi, tos, type, tb_id);
 		if (!err)
 			fi->fib_flags &= ~RTNH_F_EXTERNAL;
 	}
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
@ 2015-04-13 14:48   ` Scott Feldman
  2015-04-13 15:01     ` Jiri Pirko
  2015-04-13 19:25   ` Samudrala, Sridhar
  1 sibling, 1 reply; 13+ messages in thread
From: Scott Feldman @ 2015-04-13 14:48 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Netdev, David S. Miller, Roopa Prabhu, Florian Fainelli,
	Andy Gospodarek

On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> Turned out that "switchdev" sticks. So just unify all releated terms to
> use this prefix.
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

NACK.  I'm right in the middle of a large patchset which touches all
of these files in all of those places and a rename before mine will
create a git merge nightmare.  Please wait to post any rename patches
until after my set goes in.

-scott

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 14:48   ` Scott Feldman
@ 2015-04-13 15:01     ` Jiri Pirko
  2015-04-13 15:06       ` Scott Feldman
  0 siblings, 1 reply; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 15:01 UTC (permalink / raw)
  To: Scott Feldman
  Cc: Netdev, David S. Miller, Roopa Prabhu, Florian Fainelli,
	Andy Gospodarek

Mon, Apr 13, 2015 at 04:48:51PM CEST, sfeldma@gmail.com wrote:
>On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Turned out that "switchdev" sticks. So just unify all releated terms to
>> use this prefix.
>>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>
>NACK.  I'm right in the middle of a large patchset which touches all
>of these files in all of those places and a rename before mine will
>create a git merge nightmare.  Please wait to post any rename patches
>until after my set goes in.

Makes sense to me to rename first so you can add new functions with
"switchdev_" prefix on top of that.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 15:01     ` Jiri Pirko
@ 2015-04-13 15:06       ` Scott Feldman
  2015-04-13 15:19         ` Jiri Pirko
  0 siblings, 1 reply; 13+ messages in thread
From: Scott Feldman @ 2015-04-13 15:06 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Netdev, David S. Miller, Roopa Prabhu, Florian Fainelli,
	Andy Gospodarek

On Mon, Apr 13, 2015 at 8:01 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> Mon, Apr 13, 2015 at 04:48:51PM CEST, sfeldma@gmail.com wrote:
>>On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>> Turned out that "switchdev" sticks. So just unify all releated terms to
>>> use this prefix.
>>>
>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>
>>NACK.  I'm right in the middle of a large patchset which touches all
>>of these files in all of those places and a rename before mine will
>>create a git merge nightmare.  Please wait to post any rename patches
>>until after my set goes in.
>
> Makes sense to me to rename first so you can add new functions with
> "switchdev_" prefix on top of that.

I am renaming, to swdev_ and all new stuff gets swdev_ prefix.  You're
welcome to change the prefix after my patch set goes in but don't try
to slip it under as it totally messes up my patch stack.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 15:06       ` Scott Feldman
@ 2015-04-13 15:19         ` Jiri Pirko
  2015-04-13 17:24           ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 15:19 UTC (permalink / raw)
  To: Scott Feldman
  Cc: Netdev, David S. Miller, Roopa Prabhu, Florian Fainelli,
	Andy Gospodarek

Mon, Apr 13, 2015 at 05:06:04PM CEST, sfeldma@gmail.com wrote:
>On Mon, Apr 13, 2015 at 8:01 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Mon, Apr 13, 2015 at 04:48:51PM CEST, sfeldma@gmail.com wrote:
>>>On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>>> Turned out that "switchdev" sticks. So just unify all releated terms to
>>>> use this prefix.
>>>>
>>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>>
>>>NACK.  I'm right in the middle of a large patchset which touches all
>>>of these files in all of those places and a rename before mine will
>>>create a git merge nightmare.  Please wait to post any rename patches
>>>until after my set goes in.
>>
>> Makes sense to me to rename first so you can add new functions with
>> "switchdev_" prefix on top of that.
>
>I am renaming, to swdev_ and all new stuff gets swdev_ prefix.  You're
>welcome to change the prefix after my patch set goes in but don't try
>to slip it under as it totally messes up my patch stack.

Scott, at least please use "switchdev_" prefix for your new stuff so it
does not have to be renamed right after.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 15:19         ` Jiri Pirko
@ 2015-04-13 17:24           ` David Miller
  2015-04-13 19:19             ` Jiri Pirko
  0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2015-04-13 17:24 UTC (permalink / raw)
  To: jiri; +Cc: sfeldma, netdev, roopa, f.fainelli, gospo

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 13 Apr 2015 17:19:32 +0200

> Mon, Apr 13, 2015 at 05:06:04PM CEST, sfeldma@gmail.com wrote:
>>On Mon, Apr 13, 2015 at 8:01 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>> Mon, Apr 13, 2015 at 04:48:51PM CEST, sfeldma@gmail.com wrote:
>>>>On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>>>> Turned out that "switchdev" sticks. So just unify all releated terms to
>>>>> use this prefix.
>>>>>
>>>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>>>
>>>>NACK.  I'm right in the middle of a large patchset which touches all
>>>>of these files in all of those places and a rename before mine will
>>>>create a git merge nightmare.  Please wait to post any rename patches
>>>>until after my set goes in.
>>>
>>> Makes sense to me to rename first so you can add new functions with
>>> "switchdev_" prefix on top of that.
>>
>>I am renaming, to swdev_ and all new stuff gets swdev_ prefix.  You're
>>welcome to change the prefix after my patch set goes in but don't try
>>to slip it under as it totally messes up my patch stack.
> 
> Scott, at least please use "switchdev_" prefix for your new stuff so it
> does not have to be renamed right after.

Scott, I think Jiri's request is reasonable.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 0/2] switchdev: unify naming prefix
  2015-04-13 14:14 [patch net-next 0/2] switchdev: unify naming prefix Jiri Pirko
  2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
  2015-04-13 14:14 ` [patch net-next 2/2] switchdev: s/swdev_/switchdev_/ Jiri Pirko
@ 2015-04-13 17:50 ` Andy Gospodarek
  2 siblings, 0 replies; 13+ messages in thread
From: Andy Gospodarek @ 2015-04-13 17:50 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, sfeldma, roopa, f.fainelli

On Mon, Apr 13, 2015 at 04:14:33PM +0200, Jiri Pirko wrote:
> Turned out that "switchdev" sticks. So just unify all releated terms to
> use this prefix.
> 

Regardless of how the ordering of this patch falls out, I think this is
nice.  Good idea, Jiri.

> Jiri Pirko (2):
>   switchdev: s/netdev_switch_/switchdev_/
>   switchdev: s/swdev_/switchdev_/
> 
>  drivers/net/bonding/bond_main.c      |   4 +-
>  drivers/net/ethernet/rocker/rocker.c |  47 +++++-----
>  drivers/net/team/team.c              |   4 +-
>  include/linux/netdevice.h            |   2 +-
>  include/net/switchdev.h              | 136 +++++++++++++--------------
>  net/bridge/br.c                      |  18 ++--
>  net/bridge/br_netlink.c              |   6 +-
>  net/bridge/br_stp.c                  |   2 +-
>  net/core/net-sysfs.c                 |   2 +-
>  net/core/rtnetlink.c                 |   2 +-
>  net/dsa/slave.c                      |   8 +-
>  net/ipv4/fib_trie.c                  |  40 ++++----
>  net/switchdev/switchdev.c            | 174 +++++++++++++++++------------------
>  13 files changed, 220 insertions(+), 225 deletions(-)
> 
> -- 
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 17:24           ` David Miller
@ 2015-04-13 19:19             ` Jiri Pirko
  2015-04-13 20:18               ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 19:19 UTC (permalink / raw)
  To: David Miller; +Cc: sfeldma, netdev, roopa, f.fainelli, gospo

Mon, Apr 13, 2015 at 07:24:38PM CEST, davem@davemloft.net wrote:
>From: Jiri Pirko <jiri@resnulli.us>
>Date: Mon, 13 Apr 2015 17:19:32 +0200
>
>> Mon, Apr 13, 2015 at 05:06:04PM CEST, sfeldma@gmail.com wrote:
>>>On Mon, Apr 13, 2015 at 8:01 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>>> Mon, Apr 13, 2015 at 04:48:51PM CEST, sfeldma@gmail.com wrote:
>>>>>On Mon, Apr 13, 2015 at 7:14 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>>>>>> Turned out that "switchdev" sticks. So just unify all releated terms to
>>>>>> use this prefix.
>>>>>>
>>>>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>>>>
>>>>>NACK.  I'm right in the middle of a large patchset which touches all
>>>>>of these files in all of those places and a rename before mine will
>>>>>create a git merge nightmare.  Please wait to post any rename patches
>>>>>until after my set goes in.
>>>>
>>>> Makes sense to me to rename first so you can add new functions with
>>>> "switchdev_" prefix on top of that.
>>>
>>>I am renaming, to swdev_ and all new stuff gets swdev_ prefix.  You're
>>>welcome to change the prefix after my patch set goes in but don't try
>>>to slip it under as it totally messes up my patch stack.
>> 
>> Scott, at least please use "switchdev_" prefix for your new stuff so it
>> does not have to be renamed right after.
>
>Scott, I think Jiri's request is reasonable.

Dave, I think you can go ahead and apply this patchset. I'll help Scott
with rebasing this patchset on top of this.

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
  2015-04-13 14:48   ` Scott Feldman
@ 2015-04-13 19:25   ` Samudrala, Sridhar
  2015-04-13 20:00     ` Jiri Pirko
  1 sibling, 1 reply; 13+ messages in thread
From: Samudrala, Sridhar @ 2015-04-13 19:25 UTC (permalink / raw)
  To: Jiri Pirko, netdev; +Cc: davem, sfeldma, roopa, f.fainelli, gospo



On 4/13/2015 7:14 AM, Jiri Pirko wrote:
> Turned out that "switchdev" sticks. So just unify all releated terms to
> use this prefix.
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
>   drivers/net/bonding/bond_main.c      |   4 +-
>   drivers/net/ethernet/rocker/rocker.c |  10 +--
>   drivers/net/team/team.c              |   4 +-
>   include/net/switchdev.h              | 106 +++++++++++++--------------
>   net/bridge/br.c                      |  18 ++---
>   net/bridge/br_netlink.c              |   6 +-
>   net/bridge/br_stp.c                  |   2 +-
>   net/core/net-sysfs.c                 |   2 +-
>   net/core/rtnetlink.c                 |   2 +-
>   net/ipv4/fib_trie.c                  |  40 +++++------
>   net/switchdev/switchdev.c            | 134 +++++++++++++++++------------------
>   11 files changed, 161 insertions(+), 167 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 78dde56..e96f029 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4037,8 +4037,8 @@ static const struct net_device_ops bond_netdev_ops = {
>   	.ndo_add_slave		= bond_enslave,
>   	.ndo_del_slave		= bond_release,
>   	.ndo_fix_features	= bond_fix_features,
> -	.ndo_bridge_setlink	= ndo_dflt_netdev_switch_port_bridge_setlink,
> -	.ndo_bridge_dellink	= ndo_dflt_netdev_switch_port_bridge_dellink,
> +	.ndo_bridge_setlink	= ndo_dflt_switchdev_port_bridge_setlink,
> +	.ndo_bridge_dellink	= ndo_dflt_switchdev_port_bridge_dellink,
>   	.ndo_features_check	= passthru_features_check,
>   };
>   
> diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
> index a87b177..6d31aeb 100644
> --- a/drivers/net/ethernet/rocker/rocker.c
> +++ b/drivers/net/ethernet/rocker/rocker.c
> @@ -3377,17 +3377,17 @@ static void rocker_port_fdb_learn_work(struct work_struct *work)
>   		container_of(work, struct rocker_fdb_learn_work, work);
>   	bool removing = (lw->flags & ROCKER_OP_FLAG_REMOVE);
>   	bool learned = (lw->flags & ROCKER_OP_FLAG_LEARNED);
> -	struct netdev_switch_notifier_fdb_info info;
> +	struct switchdev_notifier_fdb_info info;
>   
>   	info.addr = lw->addr;
>   	info.vid = lw->vid;
>   
>   	if (learned && removing)
> -		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_DEL,
> -					     lw->dev, &info.info);
> +		call_switchdev_notifiers(NETDEV_SWITCH_FDB_DEL,
> +					 lw->dev, &info.info);
>   	else if (learned && !removing)
> -		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_ADD,
> -					     lw->dev, &info.info);
> +		call_switchdev_notifiers(NETDEV_SWITCH_FDB_ADD,
> +					 lw->dev, &info.info);
>   
>   	kfree(work);
>   }
> diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
> index 6928448..cfe8496 100644
> --- a/drivers/net/team/team.c
> +++ b/drivers/net/team/team.c
> @@ -1977,8 +1977,8 @@ static const struct net_device_ops team_netdev_ops = {
>   	.ndo_del_slave		= team_del_slave,
>   	.ndo_fix_features	= team_fix_features,
>   	.ndo_change_carrier     = team_change_carrier,
> -	.ndo_bridge_setlink     = ndo_dflt_netdev_switch_port_bridge_setlink,
> -	.ndo_bridge_dellink     = ndo_dflt_netdev_switch_port_bridge_dellink,
> +	.ndo_bridge_setlink     = ndo_dflt_switchdev_port_bridge_setlink,
> +	.ndo_bridge_dellink     = ndo_dflt_switchdev_port_bridge_dellink,
>   	.ndo_features_check	= passthru_features_check,
>   };
>   
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index d2e69ee..9b43228 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -43,124 +43,124 @@ struct swdev_ops {
>   				      u8 tos, u8 type, u32 tb_id);
>   };
>   
> -enum netdev_switch_notifier_type {
> +enum switchdev_notifier_type {
>   	NETDEV_SWITCH_FDB_ADD = 1,
>   	NETDEV_SWITCH_FDB_DEL,
Should these enums also be changed to SWITCHDEV_FDB_ prefix?

Thanks
Sridhar

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 19:25   ` Samudrala, Sridhar
@ 2015-04-13 20:00     ` Jiri Pirko
  0 siblings, 0 replies; 13+ messages in thread
From: Jiri Pirko @ 2015-04-13 20:00 UTC (permalink / raw)
  To: Samudrala, Sridhar; +Cc: netdev, davem, sfeldma, roopa, f.fainelli, gospo

Mon, Apr 13, 2015 at 09:25:12PM CEST, sridhar.samudrala@intel.com wrote:
>
>
>On 4/13/2015 7:14 AM, Jiri Pirko wrote:
>>Turned out that "switchdev" sticks. So just unify all releated terms to
>>use this prefix.
>>
>>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>---
>>  drivers/net/bonding/bond_main.c      |   4 +-
>>  drivers/net/ethernet/rocker/rocker.c |  10 +--
>>  drivers/net/team/team.c              |   4 +-
>>  include/net/switchdev.h              | 106 +++++++++++++--------------
>>  net/bridge/br.c                      |  18 ++---
>>  net/bridge/br_netlink.c              |   6 +-
>>  net/bridge/br_stp.c                  |   2 +-
>>  net/core/net-sysfs.c                 |   2 +-
>>  net/core/rtnetlink.c                 |   2 +-
>>  net/ipv4/fib_trie.c                  |  40 +++++------
>>  net/switchdev/switchdev.c            | 134 +++++++++++++++++------------------
>>  11 files changed, 161 insertions(+), 167 deletions(-)
>>
>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>>index 78dde56..e96f029 100644
>>--- a/drivers/net/bonding/bond_main.c
>>+++ b/drivers/net/bonding/bond_main.c
>>@@ -4037,8 +4037,8 @@ static const struct net_device_ops bond_netdev_ops = {
>>  	.ndo_add_slave		= bond_enslave,
>>  	.ndo_del_slave		= bond_release,
>>  	.ndo_fix_features	= bond_fix_features,
>>-	.ndo_bridge_setlink	= ndo_dflt_netdev_switch_port_bridge_setlink,
>>-	.ndo_bridge_dellink	= ndo_dflt_netdev_switch_port_bridge_dellink,
>>+	.ndo_bridge_setlink	= ndo_dflt_switchdev_port_bridge_setlink,
>>+	.ndo_bridge_dellink	= ndo_dflt_switchdev_port_bridge_dellink,
>>  	.ndo_features_check	= passthru_features_check,
>>  };
>>diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
>>index a87b177..6d31aeb 100644
>>--- a/drivers/net/ethernet/rocker/rocker.c
>>+++ b/drivers/net/ethernet/rocker/rocker.c
>>@@ -3377,17 +3377,17 @@ static void rocker_port_fdb_learn_work(struct work_struct *work)
>>  		container_of(work, struct rocker_fdb_learn_work, work);
>>  	bool removing = (lw->flags & ROCKER_OP_FLAG_REMOVE);
>>  	bool learned = (lw->flags & ROCKER_OP_FLAG_LEARNED);
>>-	struct netdev_switch_notifier_fdb_info info;
>>+	struct switchdev_notifier_fdb_info info;
>>  	info.addr = lw->addr;
>>  	info.vid = lw->vid;
>>  	if (learned && removing)
>>-		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_DEL,
>>-					     lw->dev, &info.info);
>>+		call_switchdev_notifiers(NETDEV_SWITCH_FDB_DEL,
>>+					 lw->dev, &info.info);
>>  	else if (learned && !removing)
>>-		call_netdev_switch_notifiers(NETDEV_SWITCH_FDB_ADD,
>>-					     lw->dev, &info.info);
>>+		call_switchdev_notifiers(NETDEV_SWITCH_FDB_ADD,
>>+					 lw->dev, &info.info);
>>  	kfree(work);
>>  }
>>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>>index 6928448..cfe8496 100644
>>--- a/drivers/net/team/team.c
>>+++ b/drivers/net/team/team.c
>>@@ -1977,8 +1977,8 @@ static const struct net_device_ops team_netdev_ops = {
>>  	.ndo_del_slave		= team_del_slave,
>>  	.ndo_fix_features	= team_fix_features,
>>  	.ndo_change_carrier     = team_change_carrier,
>>-	.ndo_bridge_setlink     = ndo_dflt_netdev_switch_port_bridge_setlink,
>>-	.ndo_bridge_dellink     = ndo_dflt_netdev_switch_port_bridge_dellink,
>>+	.ndo_bridge_setlink     = ndo_dflt_switchdev_port_bridge_setlink,
>>+	.ndo_bridge_dellink     = ndo_dflt_switchdev_port_bridge_dellink,
>>  	.ndo_features_check	= passthru_features_check,
>>  };
>>diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>>index d2e69ee..9b43228 100644
>>--- a/include/net/switchdev.h
>>+++ b/include/net/switchdev.h
>>@@ -43,124 +43,124 @@ struct swdev_ops {
>>  				      u8 tos, u8 type, u32 tb_id);
>>  };
>>-enum netdev_switch_notifier_type {
>>+enum switchdev_notifier_type {
>>  	NETDEV_SWITCH_FDB_ADD = 1,
>>  	NETDEV_SWITCH_FDB_DEL,
>Should these enums also be changed to SWITCHDEV_FDB_ prefix?

good catch. will send v2. thanks

>
>Thanks
>Sridhar
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/
  2015-04-13 19:19             ` Jiri Pirko
@ 2015-04-13 20:18               ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2015-04-13 20:18 UTC (permalink / raw)
  To: jiri; +Cc: sfeldma, netdev, roopa, f.fainelli, gospo

From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 13 Apr 2015 21:19:38 +0200

> Dave, I think you can go ahead and apply this patchset. I'll help Scott
> with rebasing this patchset on top of this.

Only if that's ok with Scott.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-04-13 20:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-13 14:14 [patch net-next 0/2] switchdev: unify naming prefix Jiri Pirko
2015-04-13 14:14 ` [patch net-next 1/2] switchdev: s/netdev_switch_/switchdev_/ Jiri Pirko
2015-04-13 14:48   ` Scott Feldman
2015-04-13 15:01     ` Jiri Pirko
2015-04-13 15:06       ` Scott Feldman
2015-04-13 15:19         ` Jiri Pirko
2015-04-13 17:24           ` David Miller
2015-04-13 19:19             ` Jiri Pirko
2015-04-13 20:18               ` David Miller
2015-04-13 19:25   ` Samudrala, Sridhar
2015-04-13 20:00     ` Jiri Pirko
2015-04-13 14:14 ` [patch net-next 2/2] switchdev: s/swdev_/switchdev_/ Jiri Pirko
2015-04-13 17:50 ` [patch net-next 0/2] switchdev: unify naming prefix Andy Gospodarek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).