From patchwork Wed Mar 2 17:18:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 864 Return-Path: Received: from ascomax.hasler.ascom.ch (ascomax.hasler.ascom.ch [139.79.135.1]) by open-mesh.org (Postfix) with ESMTPS id 02849154204 for ; Wed, 2 Mar 2011 18:18:47 +0100 (CET) Received: from eiger.ma.tech.ascom.ch (eiger.ma.tech.ascom.ch [139.79.100.1]) by ascomax.hasler.ascom.ch (8.14.4/8.14.4) with ESMTP id p22HIkCI017496; Wed, 2 Mar 2011 18:18:46 +0100 (MET) Received: from [139.79.100.104] (helo=localhost) by eiger.ma.tech.ascom.ch with esmtp (Exim 3.16 #1) id 1PuphC-000485-00; Wed, 02 Mar 2011 18:18:42 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 2 Mar 2011 18:18:37 +0100 Message-Id: <1299086321-25116-9-git-send-email-linus.luessing@ascom.ch> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299086321-25116-1-git-send-email-linus.luessing@ascom.ch> References: <1299086321-25116-1-git-send-email-linus.luessing@ascom.ch> MIME-Version: 1.0 Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCH 08/12] batman-adv: Add sysfs option for enabling redundant bonding mode X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2011 17:18:49 -0000 When bonding is enabled, then enabling red_bonding too changes the behavior from throughput bonding (round robin sending on interfaces) to redundant bonding (sending every packet on all interfaces available for bonding). Signed-off-by: Linus Lüssing --- bat_sysfs.c | 10 ++++++++++ soft-interface.c | 1 + types.h | 1 + 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/bat_sysfs.c b/bat_sysfs.c index e449bf6..3b8cf26 100644 --- a/bat_sysfs.c +++ b/bat_sysfs.c @@ -356,8 +356,17 @@ static ssize_t store_gw_bwidth(struct kobject *kobj, struct attribute *attr, return gw_bandwidth_set(net_dev, buff, count); } +static void print_bonding_notice(struct net_device *net_dev) +{ + bat_info(net_dev, "Redundant Bonding mode is currently not compatible " + "with batman-adv's link layer fragmentation and will " + "be ignored. Also make sure to activate general " + "bonding for redundant bonding to take effect.\n"); +} + BAT_ATTR_BOOL(aggregated_ogms, S_IRUGO | S_IWUSR, NULL); BAT_ATTR_BOOL(bonding, S_IRUGO | S_IWUSR, NULL); +BAT_ATTR_BOOL(red_bonding, S_IRUGO | S_IWUSR, print_bonding_notice); BAT_ATTR_BOOL(fragmentation, S_IRUGO | S_IWUSR, update_min_mtu); static BAT_ATTR(vis_mode, S_IRUGO | S_IWUSR, show_vis_mode, store_vis_mode); static BAT_ATTR(gw_mode, S_IRUGO | S_IWUSR, show_gw_mode, store_gw_mode); @@ -374,6 +383,7 @@ BAT_ATTR_UINT(log_level, S_IRUGO | S_IWUSR, 0, 3, NULL); static struct bat_attribute *mesh_attrs[] = { &bat_attr_aggregated_ogms, &bat_attr_bonding, + &bat_attr_red_bonding, &bat_attr_fragmentation, &bat_attr_vis_mode, &bat_attr_gw_mode, diff --git a/soft-interface.c b/soft-interface.c index 8224fdc..7f0e768 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -571,6 +571,7 @@ struct net_device *softif_create(char *name) atomic_set(&bat_priv->aggregated_ogms, 1); atomic_set(&bat_priv->bonding, 0); + atomic_set(&bat_priv->red_bonding, 0); atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE); atomic_set(&bat_priv->gw_mode, GW_MODE_OFF); atomic_set(&bat_priv->gw_sel_class, 20); diff --git a/types.h b/types.h index 83445cf..0ce4b99 100644 --- a/types.h +++ b/types.h @@ -133,6 +133,7 @@ struct bat_priv { struct net_device_stats stats; atomic_t aggregated_ogms; /* boolean */ atomic_t bonding; /* boolean */ + atomic_t red_bonding; /* boolean */ atomic_t fragmentation; /* boolean */ atomic_t vis_mode; /* VIS_TYPE_* */ atomic_t gw_mode; /* GW_MODE_* */