team: couple of patches
Subsystems (3)
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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Wed, 11 Jul 2012 17:34:01 +0200
Quoted 5 lines
Jiri Pirko (3):
team: use functionteam_port_txable()for determing enabled and up
port
team: add broadcast mode
team: maketeam_port_enabled()andteam_port_txable()static inline
All applied, thanks.
David Miller
maintainerFrom: 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 +0200Quoted 5 lines
Jiri Pirko (3):
team: use functionteam_port_txable()for determing enabled and up
port
team: add broadcast mode
team: maketeam_port_enabled()andteam_port_txable()static inlineAll 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 :-)
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 +0200Quoted 5 lines
Jiri Pirko (3):
team: use functionteam_port_txable()for determing enabled and up
port
team: add broadcast mode
team: maketeam_port_enabled()andteam_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
Kconfigdependency?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