All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@voltaire.com>
To: "Michael S. Tsirkin" <mst@dev.mellanox.co.il>
Cc: netdev@vger.kernel.org, Roland Dreier <rdreier@cisco.com>,
	fubar@us.ibm.com, general@lists.openfabrics.org,
	davem@davemloft.net
Subject: Re: [PATCH V3 0/7] net/bonding: ADD IPoIB support for	the	bonding driver
Date: Tue, 31 Jul 2007 17:36:05 +0300	[thread overview]
Message-ID: <46AF48D5.9000502@voltaire.com> (raw)
In-Reply-To: <20070731142234.GC16015@mellanox.co.il>

Michael S. Tsirkin wrote:
>> Quoting Or Gerlitz <ogerlitz@voltaire.com>:

>> To be precise, bonding will copy all the symbols it copies today from 
>> the slave module (ipoib), see bond_setup_by_slave() in patch 3/7

> Not really.
> This copying of symbols is something that you added, isn't it?
> So with this approach, it won't be needed.

> It's always wrong to copy symbols from another module without
> referencing it.

Its the --first-- time you make this comment, please suggest a different 
approach, the relevant code is below.

> +static void bond_setup_by_slave(struct net_device *bond_dev,
> +				struct net_device *slave_dev)
> +{
> +	bond_dev->hard_header	        = slave_dev->hard_header;
> +	bond_dev->rebuild_header        = slave_dev->rebuild_header;
> +	bond_dev->hard_header_cache	= slave_dev->hard_header_cache;
> +	bond_dev->header_cache_update   = slave_dev->header_cache_update;
> +	bond_dev->hard_header_parse	= slave_dev->hard_header_parse;
> +
> +	bond_dev->neigh_setup           = slave_dev->neigh_setup;
> +
> +	bond_dev->type		    = slave_dev->type;
> +	bond_dev->hard_header_len   = slave_dev->hard_header_len;
> +	bond_dev->addr_len	    = slave_dev->addr_len;
> +
> +	memcpy(bond_dev->broadcast, slave_dev->broadcast,
> +		slave_dev->addr_len);
> +}
> +
>  /* enslave device <slave> to bond device <master> */
>  int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>  {
> @@ -1351,6 +1371,24 @@ int bond_enslave(struct net_device *bond
>  		goto err_undo_flags;
>  	}
>  
> +	/* set bonding device ether type by slave - 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 attribs/funcs.
> +	 *
> +	 * bond ether type mutual exclusion - don't allow slaves of dissimilar
> +	 * ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond
> +	 */
> +	if (bond->slave_cnt == 0) {
> +		if (slave_dev->type != ARPHRD_ETHER)
> +			bond_setup_by_slave(bond_dev, slave_dev);
> +	} else if (bond_dev->type != slave_dev->type) {
> +		printk(KERN_ERR DRV_NAME ": %s ether type (%d) is different from "
> +			"other slaves (%d), can not enslave it.\n", slave_dev->name,
> +			slave_dev->type, bond_dev->type);
> +			res = -EINVAL;
> +			goto err_undo_flags;
> +	}
> +




  reply	other threads:[~2007-07-31 14:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 12:37 [ofa-general] [PATCH V3 0/7] net/bonding: ADD IPoIB support for the bonding driver Moni Shoua
2007-07-30 12:48 ` [ofa-general] [PATCH V3 1/7] IB/ipoib: Bound the net device to the ipoib_neigh structue Moni Shoua
2007-07-30 12:49 ` [ofa-general] [PATCH V3 2/7] IB/ipoib: Verify address handle validity on send Moni Shoua
2007-07-30 12:51 ` [ofa-general] [PATCH V3 3/7] net/bonding: Enable bonding to enslave non ARPHRD_ETHER Moni Shoua
2007-07-30 12:52 ` [ofa-general] [PATCH V3 4/7] net/bonding: Enable bonding to enslave netdevices not supporting set_mac_address() Moni Shoua
2007-07-30 12:54 ` [ofa-general] [PATCH V3 5/7] net/bonding: Enable IP multicast for bonding IPoIB devices Moni Shoua
2007-07-30 12:54 ` [ofa-general] [PATCH V3 6/7] net/bonding: Handlle wrong assumptions that slave is always an Ethernet device Moni Shoua
2007-07-30 12:56 ` [ofa-general] [PATCH V3 7/7] net/bonding: Delay sending of gratuitous ARP to avoid failure Moni Shoua
2007-07-30 20:29   ` [ofa-general] " Jay Vosburgh
2007-07-31 13:33     ` Moni Shoua
2007-07-30 21:20 ` [PATCH V3 0/7] net/bonding: ADD IPoIB support for the bonding driver Roland Dreier
2007-07-31 13:44   ` [ofa-general] " Moni Shoua
2007-07-31 14:04     ` [ofa-general] " Michael S. Tsirkin
2007-07-31 14:19       ` Or Gerlitz
2007-07-31 14:22         ` [ofa-general] " Michael S. Tsirkin
2007-07-31 14:36           ` Or Gerlitz [this message]
2007-07-31 14:48             ` Michael S. Tsirkin
2007-07-31 14:57               ` [ofa-general] " Or Gerlitz
2007-08-01 14:12           ` [ofa-general] Re: " Moni Shoua
2007-08-01 16:10             ` Michael S. Tsirkin

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=46AF48D5.9000502@voltaire.com \
    --to=ogerlitz@voltaire.com \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=general@lists.openfabrics.org \
    --cc=mst@dev.mellanox.co.il \
    --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 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.