Skip to contentSkip to conversation

team: couple of patches

PATCH In review Jiri Pirko 2 participants 7 messages Jul 11, 2012 – Jul 12, 2012

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

cover team: couple of patches

Jiri Pirko (3):
team: use function team_port_txable() for determing enabled and up
port
team: add broadcast mode
team: make team_port_enabled() and team_port_txable() static inline

 drivers/net/team/Kconfig                |   13 ++++-
 drivers/net/team/Makefile               |    1 +
 drivers/net/team/team.c                 |    6 ---
 drivers/net/team/team_mode_broadcast.c  |   88 +++++++++++++++++++++++++++++++
 drivers/net/team/team_mode_roundrobin.c |    6 +--
 include/linux/if_team.h                 |   10 +++-
 6 files changed, 113 insertions(+), 11 deletions(-)
 create mode 100644 drivers/net/team/team_mode_broadcast.c
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 1/3 team: use function team_port_txable() for determing enabled and up port

---
 drivers/net/team/team.c                 |    6 ++++++
 drivers/net/team/team_mode_roundrobin.c |    6 +++---
 include/linux/if_team.h                 |    1 +
 3 files changed, 10 insertions(+), 3 deletions(-)
drivers/net/team/team.c +6 -0
index 9b94f53..bc7afa5 100644
@@ -677,6 +677,12 @@ bool team_port_enabled(struct team_port *port)
 }
 EXPORT_SYMBOL(team_port_enabled);
 
+bool team_port_txable(struct team_port *port)
+{
+	return port->linkup && team_port_enabled(port);
+}
+EXPORT_SYMBOL(team_port_txable);
+
 /*
  * Enable/disable port by adding to enabled port hashlist and setting
  * port->index (Might be racy so reader could see incorrect ifindex when
drivers/net/team/team_mode_roundrobin.c +3 -3
index 52dd0ec..0cf38e9 100644
@@ -30,16 +30,16 @@ static struct team_port *__get_first_port_up(struct team *team,
 {
 	struct team_port *cur;
 
-	if (port->linkup)
+	if (team_port_txable(port))
 		return port;
 	cur = port;
 	list_for_each_entry_continue_rcu(cur, &team->port_list, list)
-		if (cur->linkup)
+		if (team_port_txable(port))
 			return cur;
 	list_for_each_entry_rcu(cur, &team->port_list, list) {
 		if (cur == port)
 			break;
-		if (cur->linkup)
+		if (team_port_txable(port))
 			return cur;
 	}
 	return NULL;
include/linux/if_team.h +1 -0
index 99efd60..dca426c 100644
@@ -64,6 +64,7 @@ struct team_port {
 };
 
 extern bool team_port_enabled(struct team_port *port);
+extern bool team_port_txable(struct team_port *port);
 
 struct team_mode_ops {
 	int (*init)(struct team *team);
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/3 team: add broadcast mode

In reply to Jiri Pirko
---
 drivers/net/team/Kconfig               |   13 ++++-
 drivers/net/team/Makefile              |    1 +
 drivers/net/team/team_mode_broadcast.c |   88 ++++++++++++++++++++++++++++++++
 3 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/team/team_mode_broadcast.c
drivers/net/team/Kconfig +12 -1
index 89024d5..6a7260b 100644
@@ -15,6 +15,17 @@ menuconfig NET_TEAM
 
 if NET_TEAM
 
+config NET_TEAM_MODE_BROADCAST
+	tristate "Broadcast mode support"
+	depends on NET_TEAM
+	---help---
+	  Basic mode where packets are transmitted always by all suitable ports.
+
+	  All added ports are setup to have team's mac address.
+
+	  To compile this team mode as a module, choose M here: the module
+	  will be called team_mode_broadcast.
+
 config NET_TEAM_MODE_ROUNDROBIN
 	tristate "Round-robin mode support"
 	depends on NET_TEAM
@@ -22,7 +33,7 @@ config NET_TEAM_MODE_ROUNDROBIN
 	  Basic mode where port used for transmitting packets is selected in
 	  round-robin fashion using packet counter.
 
-	  All added ports are setup to have bond's mac address.
+	  All added ports are setup to have team's mac address.
 
 	  To compile this team mode as a module, choose M here: the module
 	  will be called team_mode_roundrobin.
drivers/net/team/Makefile +1 -0
index fb9f4c1..9757630 100644
@@ -3,6 +3,7 @@
 #
 
 obj-$(CONFIG_NET_TEAM) += team.o
+obj-$(CONFIG_NET_TEAM_MODE_BROADCAST) += team_mode_broadcast.o
 obj-$(CONFIG_NET_TEAM_MODE_ROUNDROBIN) += team_mode_roundrobin.o
 obj-$(CONFIG_NET_TEAM_MODE_ACTIVEBACKUP) += team_mode_activebackup.o
 obj-$(CONFIG_NET_TEAM_MODE_LOADBALANCE) += team_mode_loadbalance.o
drivers/net/team/team_mode_broadcast.c new file +88 -0

88 lines not on this page · raw message

Signature · 1 line
1.7.10.4
author
#3 lore raw

PATCH 3/3 team: make team_port_enabled() and team_port_txable() static inline

In reply to Jiri Pirko
---
 drivers/net/team/team.c |   12 ------------
 include/linux/if_team.h |   11 +++++++++--
 2 files changed, 9 insertions(+), 14 deletions(-)
drivers/net/team/team.c +0 -12
index bc7afa5..3620c63 100644
@@ -671,18 +671,6 @@ static bool team_port_find(const struct team *team,
 	return false;
 }
 
-bool team_port_enabled(struct team_port *port)
-{
-	return port->index != -1;
-}
-EXPORT_SYMBOL(team_port_enabled);
-
-bool team_port_txable(struct team_port *port)
-{
-	return port->linkup && team_port_enabled(port);
-}
-EXPORT_SYMBOL(team_port_txable);
-
 /*
  * Enable/disable port by adding to enabled port hashlist and setting
  * port->index (Might be racy so reader could see incorrect ifindex when
include/linux/if_team.h +9 -2
index dca426c..dfa0c8e 100644
@@ -63,8 +63,15 @@ struct team_port {
 	long mode_priv[0];
 };
 
-extern bool team_port_enabled(struct team_port *port);
-extern bool team_port_txable(struct team_port *port);
+static inline bool team_port_enabled(struct team_port *port)
+{
+	return port->index != -1;
+}
+
+static inline bool team_port_txable(struct team_port *port)
+{
+	return port->linkup && team_port_enabled(port);
+}
 
 struct team_mode_ops {
 	int (*init)(struct team *team);
Signature · 1 line
1.7.10.4
maintainer
#4 lore raw
In reply to Jiri Pirko

From: Jiri Pirko <[email protected]>
Date: Wed, 11 Jul 2012 17:34:01 +0200

Quoted 5 lines

Jiri Pirko (3):
team: use function team_port_txable() for determing enabled and up
port
team: add broadcast mode
team: make team_port_enabled() and team_port_txable() static inline

All applied, thanks.

maintainer
#5 lore raw

From: David Miller <[email protected]>
Date: Thu, 12 Jul 2012 08:11:24 -0700 (PDT)

Quoted 10 lines

From: Jiri Pirko <[email protected]>
Date: Wed, 11 Jul 2012 17:34:01 +0200

Quoted 5 lines

Jiri Pirko (3):
team: use function team_port_txable() for determing enabled and up
port
team: add broadcast mode
team: make team_port_enabled() and team_port_txable() static inline

All applied, thanks.

Jiri, btw, any chance I can convince you to remove the EXPERIMENTAL Kconfig dependency?

Code I've written and checked in myself over the past few days is several orders of magnitude more experimental than the team driver is :-)

author
#6 lore raw
Quoted 12 lines · Thu, Jul 12, 2012 at 05:14:43PM CEST, [email protected] wrote:

From: David Miller <[email protected]>
Date: Thu, 12 Jul 2012 08:11:24 -0700 (PDT)

Quoted 9 lines

From: Jiri Pirko <[email protected]>
Date: Wed, 11 Jul 2012 17:34:01 +0200

Quoted 5 lines

Jiri Pirko (3):
team: use function team_port_txable() for determing enabled and up
port
team: add broadcast mode
team: make team_port_enabled() and team_port_txable() static inline

Quoted 8 lines
Quoted 1 line

All applied, thanks.

Jiri, btw, any chance I can convince you to remove the EXPERIMENTAL Kconfig dependency?

Code I've written and checked in myself over the past few days is several orders of magnitude more experimental than the team driver is :-)

Hehe :) Nevertheless, I would like to keep this flag for some more time. I will remove that once I have all planned basic functionality in.

Jirka