lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 22 Jun 2011 18:35:25 -0300
From:	Flavio Leitner <fbl@...hat.com>
To:	Stephen Hemminger <shemminger@...tta.com>
CC:	Jay Vosburgh <fubar@...ibm.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bonding: add min links parameter to 802.3ad

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@...tta.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@...hat.com>

fbl
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ