From: Flavio Leitner <fbl@redhat.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>,
Andy Gospodarek <andy@greyhouse.net>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bonding: add min links parameter to 802.3ad
Date: Wed, 22 Jun 2011 18:35:25 -0300 [thread overview]
Message-ID: <4E02601D.1010406@redhat.com> (raw)
In-Reply-To: <20110622125439.44e47a2c@nehalam.ftrdhcpuser.net>
On 06/22/2011 04:54 PM, Stephen Hemminger wrote:
> This adds support for a configuring the minimum number of links that
> must be active before asserting carrier. It is similar to the Cisco
> EtherChannel min-links feature. This allows setting the minimum number
> of member ports that must be up (link-up state) before marking the
> bond device as up (carrier on). This is useful for situations where
> higher level services such as clustering want to ensure a minimum
> number of low bandwidth links are active before switchover.
>
> See:
> http://bugzilla.vyatta.com/show_bug.cgi?id=7196
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - need to transition to carrier_off if insufficient number of links
> and whitespace cleanup
>
> drivers/net/bonding/bond_3ad.c | 8 ++++++--
> drivers/net/bonding/bond_main.c | 5 +++++
> drivers/net/bonding/bond_procfs.c | 1 +
> drivers/net/bonding/bond_sysfs.c | 35 +++++++++++++++++++++++++++++++++++
> drivers/net/bonding/bonding.h | 1 +
> 5 files changed, 48 insertions(+), 2 deletions(-)
[...]
> --- a/drivers/net/bonding/bond_3ad.c 2011-06-22 08:43:25.599999586 -0700
> +++ b/drivers/net/bonding/bond_3ad.c 2011-06-22 12:51:43.431614028 -0700
> @@ -2342,8 +2342,17 @@ void bond_3ad_handle_link_change(struct
> */
> int bond_3ad_set_carrier(struct bonding *bond)
> {
> - if (__get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator))) {
> - if (!netif_carrier_ok(bond->dev)) {
> + struct aggregator *active;
> +
> + active = __get_active_agg(&(SLAVE_AD_INFO(bond->first_slave).aggregator));
> + if (active) {
> + /* are enough slaves available to consider link up? */
> + if (active->num_of_ports < bond->params.min_links) {
> + if (netif_carrier_ok(bond->dev)) {
> + netif_carrier_off(bond->dev);
> + return 1;
> + }
> + } else if (!netif_carrier_ok(bond->dev)) {
> netif_carrier_on(bond->dev);
> return 1;
> }
Looks good and works here, thanks!
Signed-off-by: Flavio Leitner <fbl@redhat.com>
fbl
next prev parent reply other threads:[~2011-06-22 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 17:54 [PATCH net-next] bonding: add min links parameter to 802.3ad Stephen Hemminger
2011-06-22 19:40 ` Flavio Leitner
2011-06-22 19:54 ` Stephen Hemminger
2011-06-22 21:35 ` Flavio Leitner [this message]
2011-06-23 1:58 ` Andy Gospodarek
2011-06-23 9:13 ` David Miller
2011-06-22 19:50 ` Andy Gospodarek
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=4E02601D.1010406@redhat.com \
--to=fbl@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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.