All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <chris.friesen@genband.com>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH] bonding: only send arp monitor packets if no other traffic
Date: Wed, 16 May 2012 12:48:28 -0600	[thread overview]
Message-ID: <4FB3F67C.6000401@genband.com> (raw)

In order to minimize network traffic, when using load balancing modes
only send out arp monitor packets if it's been more than delta_in_ticks
jiffies since we either received or transmitted packets.  The rationale
behind this is that if there is a lot of other traffic going on we don't
need the arp monitor packets to determine whether or not the link is
working.

This makes the most difference if you have a lot of hosts all arping
the same target at high frequency.

Signed-off-by: Chris Friesen <chris.friesen@genand.com>
---
 drivers/net/bonding/bond_main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index bc13b3d..4c8459a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2885,8 +2885,12 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
 		 * do - all replies will be rx'ed on same link causing slaves
 		 * to be unstable during low/no traffic periods
 		 */
-		if (IS_UP(slave->dev))
-			bond_arp_send_all(bond, slave);
+		if (IS_UP(slave->dev)) {
+			if (time_after_eq(jiffies, dev_trans_start(slave->dev) + delta_in_ticks) ||
+			    time_after_eq(jiffies, slave->dev->last_rx + delta_in_ticks)) {
+				bond_arp_send_all(bond, slave);
+			}
+		}
 	}
 
 	if (do_failover) {

-- 

Chris Friesen
Software Designer
3500 Carling Avenue
Ottawa, Ontario K2H 8E9
www.genband.com

             reply	other threads:[~2012-05-16 19:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 18:48 Chris Friesen [this message]
2012-05-16 19:08 ` [PATCH] bonding: only send arp monitor packets if no other traffic Jay Vosburgh
2012-05-18  0:08 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FB3F67C.6000401@genband.com \
    --to=chris.friesen@genband.com \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.