public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@voltaire.com>
To: netdev@vger.kernel.org
Cc: Roland Dreier <rdreier@cisco.com>
Subject: [RFC][PATCH 1/3] enable bonding to enslave non ARPHRD_ETHER netdevices
Date: Tue, 26 Sep 2006 13:17:01 +0300 (IDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0609261316420.24189@zuben> (raw)
In-Reply-To: <Pine.LNX.4.64.0609261309540.24189@zuben>

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>

Index: net-2.6.19/drivers/net/bonding/bond_main.c
===================================================================
--- net-2.6.19.orig/drivers/net/bonding/bond_main.c	2006-09-20 14:40:13.000000000 +0300
+++ net-2.6.19/drivers/net/bonding/bond_main.c	2006-09-25 11:43:52.000000000 +0300
@@ -1013,6 +1013,23 @@ static struct slave *bond_find_best_slav
 	return bestslave;
 }

+void bond_setup_by_slave(struct bonding *bond, struct slave *new_active)
+{
+	bond->dev->hard_header	        = new_active->dev->hard_header;
+	bond->dev->rebuild_header       = new_active->dev->rebuild_header;
+	bond->dev->hard_header_cache	= new_active->dev->hard_header_cache;
+	bond->dev->header_cache_update  = new_active->dev->header_cache_update;
+	bond->dev->hard_header_parse	= new_active->dev->hard_header_parse;
+
+	bond->dev->type		    = new_active->dev->type;
+	bond->dev->hard_header_len  = new_active->dev->hard_header_len;
+	bond->dev->mtu		    = new_active->dev->mtu;
+	bond->dev->addr_len	    = new_active->dev->addr_len;
+
+	memcpy(bond->dev->broadcast, new_active->dev->broadcast,
+		new_active->dev->addr_len);
+}
+
 /**
  * change_active_interface - change the active slave into the specified one
  * @bond: our bonding struct
@@ -1091,6 +1108,14 @@ void bond_change_active_slave(struct bon
 		if (new_active) {
 			bond_set_slave_active_flags(new_active);
 		}
+
+		/* bonding netdevices are created with ether_setup, so when the
+		 * slave type is not ARPHRD_ETHER there is a need to override
+		 * some of the type dependent attributes/functions
+		 */
+		if (new_active && new_active->dev->type != ARPHRD_ETHER)
+			bond_setup_by_slave(bond, new_active);
+
 		bond_send_gratuitous_arp(bond);
 	}
 }


  reply	other threads:[~2006-09-26 10:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 10:16 [RFC][PATCH 0/3] bonding support for operation over IPoIB Or Gerlitz
2006-09-26 10:17 ` Or Gerlitz [this message]
2006-09-26 19:23   ` [RFC][PATCH 1/3] enable bonding to enslave non ARPHRD_ETHER netdevices Jay Vosburgh
2006-09-27 19:59     ` Or Gerlitz
2006-09-28 17:02       ` Jay Vosburgh
2006-10-03 12:56         ` Or Gerlitz
2006-09-26 10:17 ` [RFC][PATCH 2/3] enable bonding to enslave netdevices not supporting set_mac_address() Or Gerlitz
2006-09-26 10:18 ` [RFC] [PATCH 3/3] enable IP multicast when bonding IPoIB devices Or Gerlitz
2006-09-26 17:05   ` Stephen Hemminger
2006-09-27 20:16     ` Or Gerlitz
2006-09-26 23:40   ` Jay Vosburgh
2006-09-27 20:12     ` Or Gerlitz
2006-09-28 17:43       ` Jay Vosburgh
2006-10-03 13:06         ` Or Gerlitz
2006-10-03 23:10           ` Jay Vosburgh
2006-10-04 15:25             ` Or Gerlitz
2006-10-04 17:34               ` Jay Vosburgh
2006-10-05 14:56                 ` Or Gerlitz
2006-10-05 18:13                   ` Jay Vosburgh
2006-10-09 13:15                     ` Or Gerlitz

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=Pine.LNX.4.64.0609261316420.24189@zuben \
    --to=ogerlitz@voltaire.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox