netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bonding: use bond_is_lb() when it's appropriate
@ 2009-05-27 15:42 Jiri Pirko
  2009-05-27 16:13 ` Jay Vosburgh
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2009-05-27 15:42 UTC (permalink / raw)
  To: netdev; +Cc: davem, fubar, bonding-devel

[PATCH] bonding: use bond_is_lb() when it's appropriate

Signed-off-by: Jiri Pirko <jpirko@redhat.com>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7482402..3ec7d52 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2399,8 +2399,7 @@ static void bond_miimon_commit(struct bonding *bond)
 				bond_3ad_handle_link_change(slave,
 							    BOND_LINK_DOWN);
 
-			if (bond->params.mode == BOND_MODE_TLB ||
-			    bond->params.mode == BOND_MODE_ALB)
+			if (bond_is_lb(bond))
 				bond_alb_handle_link_change(bond, slave,
 							    BOND_LINK_DOWN);
 
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index ca849d2..41ceca1 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -286,8 +286,7 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
 static inline void bond_set_slave_inactive_flags(struct slave *slave)
 {
 	struct bonding *bond = netdev_priv(slave->dev->master);
-	if (bond->params.mode != BOND_MODE_TLB &&
-	    bond->params.mode != BOND_MODE_ALB)
+	if (!bond_is_lb(bond))
 		slave->state = BOND_STATE_BACKUP;
 	slave->dev->priv_flags |= IFF_SLAVE_INACTIVE;
 	if (slave_do_arp_validate(bond, slave))

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

* Re: [PATCH] bonding: use bond_is_lb() when it's appropriate
  2009-05-27 15:42 [PATCH] bonding: use bond_is_lb() when it's appropriate Jiri Pirko
@ 2009-05-27 16:13 ` Jay Vosburgh
  2009-05-30  5:08   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jay Vosburgh @ 2009-05-27 16:13 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev, davem, bonding-devel

Jiri Pirko <jpirko@redhat.com> wrote:

>[PATCH] bonding: use bond_is_lb() when it's appropriate
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>

	Looks good.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>


>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 7482402..3ec7d52 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2399,8 +2399,7 @@ static void bond_miimon_commit(struct bonding *bond)
> 				bond_3ad_handle_link_change(slave,
> 							    BOND_LINK_DOWN);
>
>-			if (bond->params.mode == BOND_MODE_TLB ||
>-			    bond->params.mode == BOND_MODE_ALB)
>+			if (bond_is_lb(bond))
> 				bond_alb_handle_link_change(bond, slave,
> 							    BOND_LINK_DOWN);
>
>diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
>index ca849d2..41ceca1 100644
>--- a/drivers/net/bonding/bonding.h
>+++ b/drivers/net/bonding/bonding.h
>@@ -286,8 +286,7 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
> static inline void bond_set_slave_inactive_flags(struct slave *slave)
> {
> 	struct bonding *bond = netdev_priv(slave->dev->master);
>-	if (bond->params.mode != BOND_MODE_TLB &&
>-	    bond->params.mode != BOND_MODE_ALB)
>+	if (!bond_is_lb(bond))
> 		slave->state = BOND_STATE_BACKUP;
> 	slave->dev->priv_flags |= IFF_SLAVE_INACTIVE;
> 	if (slave_do_arp_validate(bond, slave))

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

* Re: [PATCH] bonding: use bond_is_lb() when it's appropriate
  2009-05-27 16:13 ` Jay Vosburgh
@ 2009-05-30  5:08   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-05-30  5:08 UTC (permalink / raw)
  To: fubar; +Cc: jpirko, netdev, bonding-devel

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Wed, 27 May 2009 09:13:42 -0700

> Jiri Pirko <jpirko@redhat.com> wrote:
> 
>>[PATCH] bonding: use bond_is_lb() when it's appropriate
>>
>>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> 
> 	Looks good.
> 
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

Applied, thanks.

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

end of thread, other threads:[~2009-05-30  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 15:42 [PATCH] bonding: use bond_is_lb() when it's appropriate Jiri Pirko
2009-05-27 16:13 ` Jay Vosburgh
2009-05-30  5:08   ` David Miller

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).