From: Moni Shoua <monisonlists@gmail•com>
To: Jay Vosburgh <fubar@us•ibm.com>
Cc: Moni Shoua <monis@voltaire•com>,
netdev@vger•kernel.org, rdreier@cisco•com, davem@davemloft•net,
general@lists•openfabrics.org
Subject: Re: [ofa-general] Re: [PATCH V4 8/10] net/bonding: Handlle wrong assumptions that slave is always an Ethernet device
Date: Wed, 29 Aug 2007 16:37:34 +0300 [thread overview]
Message-ID: <46D5769E.6000405@gmail.com> (raw)
In-Reply-To: <416.1188343604@death>
Jay Vosburgh wrote:
> Moni Shoua <monis@voltaire•com> wrote:
>
>> bonding sometimes uses Ethernet constants (such as MTU and address length) which
>> are not good when it enslaves non Ethernet devices (such as InfiniBand).
>>
>> Signed-off-by: Moni Shoua <monis@voltaire•com>
>> ---
>> drivers/net/bonding/bond_main.c | 3 ++-
>> drivers/net/bonding/bond_sysfs.c | 19 +++++++++++++------
>> drivers/net/bonding/bonding.h | 1 +
>> 3 files changed, 16 insertions(+), 7 deletions(-)
>>
>> Index: net-2.6/drivers/net/bonding/bond_main.c
>> ===================================================================
>> --- net-2.6.orig/drivers/net/bonding/bond_main.c 2007-08-15 10:55:48.000000000 +0300
>> +++ net-2.6/drivers/net/bonding/bond_main.c 2007-08-20 14:29:11.911298577 +0300
>> @@ -1224,7 +1224,8 @@ static int bond_compute_features(struct
>> struct slave *slave;
>> struct net_device *bond_dev = bond->dev;
>> unsigned long features = bond_dev->features;
>> - unsigned short max_hard_header_len = ETH_HLEN;
>> + unsigned short max_hard_header_len = max((u16)ETH_HLEN,
>> + bond_dev->hard_header_len);
>
> Since non-IB bonding masters are run through ether_setup, which
> sets hard_header_len to ETH_HLEN, the max() is probably unnecessary, and
> I think this could just be bond_dev->hard_header_len.
>
This is true except for the case where there are no slaves left.
In that case max_hard_header_len has equals to the initialization value.
bond_for_each_slave(bond, slave, i) {
features = netdev_compute_features(features,
slave->dev->features);
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
}
features |= (bond_dev->features & BOND_VLAN_FEATURES);
bond_dev->features = features;
bond_dev->hard_header_len = max_hard_header_len;
next prev parent reply other threads:[~2007-08-29 13:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-20 15:34 [PATCH V4 0/10] net/bonding: ADD IPoIB support for the bonding driver Moni Shoua
2007-08-20 15:42 ` [ofa-general] [PATCH V4 1/10] IB/ipoib: Export call to call_netdevice_notifiers and add new private flag Moni Shoua
2007-08-20 15:43 ` [ofa-general] [PATCH V4 2/10] IB/ipoib: Notify the world before doing unregister Moni Shoua
2007-08-20 15:44 ` [ofa-general] [PATCH V4 3/10] IB/ipoib: Bound the net device to the ipoib_neigh structue Moni Shoua
2007-08-20 15:46 ` [PATCH V4 4/10] IB/ipoib: Verify address handle validity on send Moni Shoua
2007-08-20 15:48 ` [PATCH V4 5/10] net/bonding: Enable bonding to enslave non ARPHRD_ETHER Moni Shoua
2007-08-20 15:49 ` [PATCH V4 6/10] net/bonding: Enable bonding to enslave netdevices not supporting set_mac_address() Moni Shoua
2007-08-20 15:51 ` [PATCH V4 7/10] net/bonding: Enable IP multicast for bonding IPoIB devices Moni Shoua
2007-08-20 15:52 ` [PATCH V4 8/10] net/bonding: Handlle wrong assumptions that slave is always an Ethernet device Moni Shoua
[not found] ` <416.1188343604@death>
2007-08-29 13:37 ` Moni Shoua [this message]
2007-08-20 15:53 ` [ofa-general] PATCH V4 9/10] net/bonding: Delay sending of gratuitous ARP to avoid failure Moni Shoua
2007-08-20 15:58 ` [PATCH V4 10/10] net/bonding: Destroy bonding master when last slave is gone Moni Shoua
[not found] ` <3403.1188343986@death>
2007-08-29 14:06 ` [ofa-general] " Moni Shoua
2007-08-29 19:50 ` Jay Vosburgh
2007-09-02 11:32 ` Moni Shoua
2007-09-01 20:19 ` [ofa-general] [PATCH V4 0/10] net/bonding: ADD IPoIB support for the bonding driver Or Gerlitz
2007-09-10 14:31 ` Moni Shoua
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=46D5769E.6000405@gmail.com \
--to=monisonlists@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=fubar@us$(echo .)ibm.com \
--cc=general@lists$(echo .)openfabrics.org \
--cc=monis@voltaire$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rdreier@cisco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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