[kernel/f18] Resolves: rhbz 971893

Neil Horman nhorman at fedoraproject.org
Mon Sep 23 14:46:51 UTC 2013


commit 38d9b677795aeb13e94af13b282f4ea7f6212b20
Author: Neil Horman <nhorman at tuxdriver.com>
Date:   Mon Sep 23 10:46:25 2013 -0400

    Resolves: rhbz 971893

 bonding-driver-alb-learning.patch |  155 +++++++++++++++++++++++++++++++++++++
 kernel.spec                       |    9 ++
 2 files changed, 164 insertions(+), 0 deletions(-)
---
diff --git a/bonding-driver-alb-learning.patch b/bonding-driver-alb-learning.patch
new file mode 100644
index 0000000..c7f8e8f
--- /dev/null
+++ b/bonding-driver-alb-learning.patch
@@ -0,0 +1,155 @@
+commit 7eacd03810960823393521063734fc8188446bca
+Author: Neil Horman <nhorman at tuxdriver.com>
+Date:   Fri Sep 13 11:05:33 2013 -0400
+
+    bonding: Make alb learning packet interval configurable
+    
+    running bonding in ALB mode requires that learning packets be sent periodically,
+    so that the switch knows where to send responding traffic.  However, depending
+    on switch configuration, there may not be any need to send traffic at the
+    default rate of 3 packets per second, which represents little more than wasted
+    data.  Allow the ALB learning packet interval to be made configurable via sysfs
+    
+    Signed-off-by: Neil Horman <nhorman at tuxdriver.com>
+    Acked-by: Acked-by: Veaceslav Falico <vfalico at redhat.com>
+    CC: Jay Vosburgh <fubar at us.ibm.com>
+    CC: Andy Gospodarek <andy at greyhouse.net>
+    CC: "David S. Miller" <davem at davemloft.net>
+    Signed-off-by: Andy Gospodarek <andy at greyhouse.net>
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
+index 87bbcfe..9b28e71 100644
+--- a/Documentation/networking/bonding.txt
++++ b/Documentation/networking/bonding.txt
+@@ -1362,6 +1362,12 @@ To add ARP targets:
+ To remove an ARP target:
+ # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
+ 
++To configure the interval between learning packet transmits:
++# echo 12 > /sys/class/net/bond0/bonding/lp_interval
++	NOTE: the lp_inteval is the number of seconds between instances where
++the bonding driver sends learning packets to each slaves peer switch.  The
++default interval is 1 second.
++
+ Example Configuration
+ ---------------------
+ 	We begin with the same example that is shown in section 3.3,
+diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
+index 91f179d..f428ef57 100644
+--- a/drivers/net/bonding/bond_alb.c
++++ b/drivers/net/bonding/bond_alb.c
+@@ -1472,7 +1472,7 @@ void bond_alb_monitor(struct work_struct *work)
+ 	bond_info->lp_counter++;
+ 
+ 	/* send learning packets */
+-	if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) {
++	if (bond_info->lp_counter >= BOND_ALB_LP_TICKS(bond)) {
+ 		/* change of curr_active_slave involves swapping of mac addresses.
+ 		 * in order to avoid this swapping from happening while
+ 		 * sending the learning packets, the curr_slave_lock must be held for
+diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
+index 28d8e4c..c5eff5d 100644
+--- a/drivers/net/bonding/bond_alb.h
++++ b/drivers/net/bonding/bond_alb.h
+@@ -36,14 +36,15 @@ struct slave;
+ 					 * Used for division - never set
+ 					 * to zero !!!
+ 					 */
+-#define BOND_ALB_LP_INTERVAL	    1	/* In seconds, periodic send of
+-					 * learning packets to the switch
+-					 */
++#define BOND_ALB_DEFAULT_LP_INTERVAL 1
++#define BOND_ALB_LP_INTERVAL(bond) (bond->params.lp_interval)	/* In seconds, periodic send of
++								 * learning packets to the switch
++								 */
+ 
+ #define BOND_TLB_REBALANCE_TICKS (BOND_TLB_REBALANCE_INTERVAL \
+ 				  * ALB_TIMER_TICKS_PER_SEC)
+ 
+-#define BOND_ALB_LP_TICKS (BOND_ALB_LP_INTERVAL \
++#define BOND_ALB_LP_TICKS(bond) (BOND_ALB_LP_INTERVAL(bond) \
+ 			   * ALB_TIMER_TICKS_PER_SEC)
+ 
+ #define TLB_HASH_TABLE_SIZE 256	/* The size of the clients hash table.
+diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
+index 72df399..55bbb8b 100644
+--- a/drivers/net/bonding/bond_main.c
++++ b/drivers/net/bonding/bond_main.c
+@@ -4416,6 +4416,7 @@ static int bond_check_params(struct bond_params *params)
+ 	params->all_slaves_active = all_slaves_active;
+ 	params->resend_igmp = resend_igmp;
+ 	params->min_links = min_links;
++	params->lp_interval = BOND_ALB_DEFAULT_LP_INTERVAL;
+ 
+ 	if (primary) {
+ 		strncpy(params->primary, primary, IFNAMSIZ);
+diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
+index eeab40b..c29b836 100644
+--- a/drivers/net/bonding/bond_sysfs.c
++++ b/drivers/net/bonding/bond_sysfs.c
+@@ -1699,6 +1699,44 @@ out:
+ static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR,
+ 		   bonding_show_resend_igmp, bonding_store_resend_igmp);
+ 
++
++static ssize_t bonding_show_lp_interval(struct device *d,
++					struct device_attribute *attr,
++					char *buf)
++{
++	struct bonding *bond = to_bond(d);
++	return sprintf(buf, "%d\n", bond->params.lp_interval);
++}
++
++static ssize_t bonding_store_lp_interval(struct device *d,
++					 struct device_attribute *attr,
++					 const char *buf, size_t count)
++{
++	struct bonding *bond = to_bond(d);
++	int new_value, ret = count;
++
++	if (sscanf(buf, "%d", &new_value) != 1) {
++		pr_err("%s: no lp interval value specified.\n",
++			bond->dev->name);
++		ret = -EINVAL;
++		goto out;
++	}
++
++	if (new_value <= 0) {
++		pr_err ("%s: lp_interval must be between 1 and %d\n",
++			bond->dev->name, INT_MAX);
++		ret = -EINVAL;
++		goto out;
++	}
++
++	bond->params.lp_interval = new_value;
++out:
++	return ret;
++}
++
++static DEVICE_ATTR(lp_interval, S_IRUGO | S_IWUSR,
++		   bonding_show_lp_interval, bonding_store_lp_interval);
++
+ static struct attribute *per_bond_attrs[] = {
+ 	&dev_attr_slaves.attr,
+ 	&dev_attr_mode.attr,
+@@ -1729,6 +1767,7 @@ static struct attribute *per_bond_attrs[] = {
+ 	&dev_attr_all_slaves_active.attr,
+ 	&dev_attr_resend_igmp.attr,
+ 	&dev_attr_min_links.attr,
++	&dev_attr_lp_interval.attr,
+ 	NULL,
+ };
+ 
+diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
+index 7ad8bd5..03cf3fd 100644
+--- a/drivers/net/bonding/bonding.h
++++ b/drivers/net/bonding/bonding.h
+@@ -176,6 +176,7 @@ struct bond_params {
+ 	int tx_queues;
+ 	int all_slaves_active;
+ 	int resend_igmp;
++	int lp_interval;
+ };
+ 
+ struct bond_parm_tbl {
diff --git a/kernel.spec b/kernel.spec
index 1d141cf..97cd193 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -791,6 +791,9 @@ Patch25104: ansi_cprng-Fix-off-by-one-error-in-non-block-size-request.patch
 #rhbz 928561
 Patch25105: 0001-HID-kye-Add-report-fixup-for-Genius-Gx-Imperator-Key.patch
 
+#rhbz 971893
+Patch25106: bonding-driver-alb-learning.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
@@ -1517,6 +1520,9 @@ ApplyPatch ansi_cprng-Fix-off-by-one-error-in-non-block-size-request.patch
 #rhbz 928561
 ApplyPatch 0001-HID-kye-Add-report-fixup-for-Genius-Gx-Imperator-Key.patch
 
+#rhbz 971893
+ApplyPatch bonding-driver-alb-learning.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2358,6 +2364,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Mon Sep 23 2013 Neil Horman <nhorman at redhat.com>
+- Add alb learning packet config knob (rhbz 971893)
+
 * Fri Sep 20 2013 Josh Boyer <jwboyer at fedoraproject.org>
 - Fix multimedia keys on Genius GX keyboard (rhbz 928561)
 


More information about the scm-commits mailing list