From: Moni Shoua <monisonlists@gmail.com>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: rdreier@cisco.com, davem@davemloft.net,
general@lists.openfabrics.org, netdev@vger.kernel.org
Subject: Re: [ofa-general] Re: [PATCH V4 10/10] net/bonding: Destroy bonding master when last slave is gone
Date: Sun, 02 Sep 2007 14:32:53 +0300 [thread overview]
Message-ID: <46DA9F65.2020201@gmail.com> (raw)
In-Reply-To: <16908.1188417014@death>
Jay Vosburgh wrote:
> Moni Shoua <monisonlists@gmail.com> wrote:
>
>> Jay Vosburgh wrote:
>>> Moni Shoua <monis@voltaire.com> wrote:
>>>
>>>> When bonding enslaves non Ethernet devices it takes pointers to functions
>>>> in the module that owns the slaves. In this case it becomes unsafe
>>>> to keep the bonding master registered after last slave was unenslaved
>>>> because we don't know if the pointers are still valid. Destroying the bond when slave_cnt is zero
>>>> ensures that these functions be used anymore.
>>> Would it not be simpler to run the bonding master through
>>> ether_setup() again when the final slave is released (to reset all of
>>> the pointers to their "ethernet" values)? I'm presuming here the
>>> pointers of questionable validity are the ones set in the
>>> bond_setup_by_slave() copied from the slave_dev->hard_header, et al.
>>>
>>> Having the bonding master disappear (but only sometimes) after
>>> the last slave is removed is a semantic change I'd rather not introduce
>>> if it's not necessary.
>> Thanks for the comments.
>>
>> Having the master disappear is one way I could think of to solve the problem of leaving
>> the bonding module with pointers to illegal addresses.
>> The other way is to increase the usage count, with try_module_get(), of the module which owns of the slave.
>> To do that I have to restore the field owner in structure net_device (it was removed in 2.6).
>
> What I was asking above is really whether or not it's feasible
> to simply reset the affected pointers back to the "ethernet" values from
> ether_setup(). I would think this should return the bonding master back
> to the original state it started in before any slaves were added.
> Unless I'm missing something; I'm willing to believe there's some
> IB-specific tidbit I'm unaware of that makes this more complicated than
> it seems.
It's possible to reset the bonding master by calling ether_setup but with one exception: its neighbors.
When enslaving IPoIB devices, the bonding master neighbors point to a destructor function in the ib_ipoib module.
When ib_ipoib goes down the neighbors of the bonding master still exist and when their turn come to die they will
try to access this function and the kernel will crash. This is why I want to destroy the bonding master before ib_ipoib
is unloaded (to kill its neighbors). For any other issue (i.e. taken pointer), ether_setup would solve the problem.
>
> This presumes that I'm correct in thinking that the pointers
> you're talking about (as being unsafe after removal of last slave) are
> the ones copied in your new function bond_setup_by_slave().
>
> I don't think it's desirable to acquire a reference to the slave
> driver module.
>
> -J
>
> ---
> -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>
next prev parent reply other threads:[~2007-09-02 11:32 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 ` [ofa-general] " Moni Shoua
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 [this message]
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=46DA9F65.2020201@gmail.com \
--to=monisonlists@gmail.com \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=general@lists.openfabrics.org \
--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.