diff options
-rw-r--r-- | 0001-batman-adv-introduce-no_rebroadcast-option.patch | 185 | ||||
-rw-r--r-- | 0002-batman-adv-decrease-maximum-fragment-size.patch | 28 |
2 files changed, 0 insertions, 213 deletions
diff --git a/0001-batman-adv-introduce-no_rebroadcast-option.patch b/0001-batman-adv-introduce-no_rebroadcast-option.patch deleted file mode 100644 index 332410208d8b..000000000000 --- a/0001-batman-adv-introduce-no_rebroadcast-option.patch +++ /dev/null @@ -1,185 +0,0 @@ -From bb9feeed3b49a55034cce90be996b11cd095b1ce Mon Sep 17 00:00:00 2001 -Message-Id: <bb9feeed3b49a55034cce90be996b11cd095b1ce.1454958586.git.mschiffer@universe-factory.net> -From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de> -Date: Tue, 24 Sep 2013 04:36:27 +0200 -Subject: [PATCH 1/2] batman-adv: introduce 'no_rebroadcast' option -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This patch introduces a new sysfs option named "no_rebroadcast" on -a per hard interface basis. It allows manually enabling a split-horizon -like behaviour for the layer 2 multicast payload frames, in that -incoming multicast payload frames on such a hard interface are only -being rebroadcasted on all interfaces except the incoming one instead -of being rebroadcasted on all interfaces. - -Such an option should only be enabled if you are certain that these -rebroadcasts are unnecessary. This is usually the case for instance -for point-to-point wifi longshots or wired links. - -This option can especially safe a significant amount of upload overhead -if the neighbourhood on a link is rather large, for instance in some -transitive, symmetric VPN configurations. - -Using this option wrongly will break your mesh network, use this option -wisely and at your own risk! - -Signed-off-by: Linus Lüssing <linus.luessing@web.de> ---- - .../ABI/testing/sysfs-class-net-batman-adv | 10 ++++ - net/batman-adv/hard-interface.c | 2 + - net/batman-adv/send.c | 4 ++ - net/batman-adv/sysfs.c | 59 ++++++++++++++++++++++ - net/batman-adv/types.h | 1 + - 5 files changed, 76 insertions(+) - -diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv -index 7f34a95..cf7fe00 100644 ---- a/Documentation/ABI/testing/sysfs-class-net-batman-adv -+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv -@@ -13,3 +13,13 @@ Description: - displays the batman mesh interface this <iface> - currently is associated with. - -+What: /sys/class/net/<iface>/batman-adv/no_rebroadcast -+Date: Sep 2013 -+Contact: Linus Lüssing <linus.luessing@web.de> -+Description: -+ With this option set incoming multicast payload frames on -+ <iface> are not being rebroadcasted on <iface> again. This -+ option should be set on links which are known to be transitive -+ and symmetric only, for instance point-to-point wifi longshots -+ or wired links. Using this option wrongly is going to -+ break your mesh network, use at your own risk! -diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c -index aea4d06..66a703d 100644 ---- a/net/batman-adv/hard-interface.c -+++ b/net/batman-adv/hard-interface.c -@@ -657,6 +657,8 @@ batadv_hardif_add_interface(struct net_device *net_dev) - /* extra reference for return */ - atomic_set(&hard_iface->refcount, 2); - -+ atomic_set(&hard_iface->no_rebroadcast, 0); -+ - batadv_check_known_mac_addr(hard_iface->net_dev); - list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list); - -diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c -index c188f46..145f7cb 100644 ---- a/net/batman-adv/send.c -+++ b/net/batman-adv/send.c -@@ -535,6 +535,10 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work) - if (forw_packet->num_packets >= hard_iface->num_bcasts) - continue; - -+ if (atomic_read(&hard_iface->no_rebroadcast) && -+ forw_packet->skb->dev == hard_iface->net_dev) -+ continue; -+ - /* send a copy of the saved skb */ - skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); - if (skb1) -diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c -index f38d7b7..600633c 100644 ---- a/net/batman-adv/sysfs.c -+++ b/net/batman-adv/sysfs.c -@@ -131,6 +131,17 @@ struct batadv_attribute batadv_attr_vlan_##_name = { \ - .store = _store, \ - } - -+/* Use this, if you have customized show and store functions -+ * for hard interface attrs -+ */ -+#define BATADV_ATTR_HIF(_name, _mode, _show, _store) \ -+struct batadv_attribute batadv_attr_hif_##_name = { \ -+ .attr = {.name = __stringify(_name), \ -+ .mode = _mode }, \ -+ .show = _show, \ -+ .store = _store, \ -+}; -+ - /* Use this, if you have customized show and store functions */ - #define BATADV_ATTR(_name, _mode, _show, _store) \ - struct batadv_attribute batadv_attr_##_name = { \ -@@ -241,6 +252,52 @@ ssize_t batadv_show_vlan_##_name(struct kobject *kobj, \ - static BATADV_ATTR_VLAN(_name, _mode, batadv_show_vlan_##_name, \ - batadv_store_vlan_##_name) - -+#define BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \ -+ssize_t batadv_store_hif_##_name(struct kobject *kobj, \ -+ struct attribute *attr, char *buff, \ -+ size_t count) \ -+{ \ -+ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ -+ struct batadv_hard_iface *hard_iface; \ -+ size_t res; \ -+ \ -+ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ -+ if (!hard_iface) \ -+ return 0; \ -+ \ -+ res = __batadv_store_bool_attr(buff, count, _post_func, \ -+ attr, &hard_iface->_name, \ -+ hard_iface->soft_iface); \ -+ batadv_hardif_free_ref(hard_iface); \ -+ return res; \ -+} -+ -+#define BATADV_ATTR_HIF_SHOW_BOOL(_name) \ -+ssize_t batadv_show_hif_##_name(struct kobject *kobj, \ -+ struct attribute *attr, char *buff) \ -+{ \ -+ struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ -+ struct batadv_hard_iface *hard_iface; \ -+ size_t res; \ -+ \ -+ hard_iface = batadv_hardif_get_by_netdev(net_dev); \ -+ if (!hard_iface) \ -+ return 0; \ -+ \ -+ res = sprintf(buff, "%s\n", \ -+ atomic_read(&hard_iface->_name) == 0 ? \ -+ "disabled" : "enabled"); \ -+ batadv_hardif_free_ref(hard_iface); \ -+ return res; \ -+} -+ -+/* Use this, if you are going to turn a [name] in the vlan struct on or off */ -+#define BATADV_ATTR_HIF_BOOL(_name, _mode, _post_func) \ -+ static BATADV_ATTR_HIF_STORE_BOOL(_name, _post_func) \ -+ static BATADV_ATTR_HIF_SHOW_BOOL(_name) \ -+ static BATADV_ATTR_HIF(_name, _mode, batadv_show_hif_##_name, \ -+ batadv_store_hif_##_name) -+ - static int batadv_store_bool_attr(char *buff, size_t count, - struct net_device *net_dev, - const char *attr_name, atomic_t *attr, -@@ -870,10 +927,12 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj, - static BATADV_ATTR(mesh_iface, S_IRUGO | S_IWUSR, batadv_show_mesh_iface, - batadv_store_mesh_iface); - static BATADV_ATTR(iface_status, S_IRUGO, batadv_show_iface_status, NULL); -+BATADV_ATTR_HIF_BOOL(no_rebroadcast, S_IRUGO | S_IWUSR, NULL); - - static struct batadv_attribute *batadv_batman_attrs[] = { - &batadv_attr_mesh_iface, - &batadv_attr_iface_status, -+ &batadv_attr_hif_no_rebroadcast, - NULL, - }; - -diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h -index 5e8c8df..913f104 100644 ---- a/net/batman-adv/types.h -+++ b/net/batman-adv/types.h -@@ -120,6 +120,7 @@ struct batadv_hard_iface { - struct hlist_head neigh_list; - /* neigh_list_lock protects: neigh_list */ - spinlock_t neigh_list_lock; -+ atomic_t no_rebroadcast; - }; - - /** --- -2.7.0 - diff --git a/0002-batman-adv-decrease-maximum-fragment-size.patch b/0002-batman-adv-decrease-maximum-fragment-size.patch deleted file mode 100644 index 56311ea953a0..000000000000 --- a/0002-batman-adv-decrease-maximum-fragment-size.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 3de3f885d441f9059a4d4c88504845851667a68c Mon Sep 17 00:00:00 2001 -Message-Id: <3de3f885d441f9059a4d4c88504845851667a68c.1454958586.git.mschiffer@universe-factory.net> -In-Reply-To: <bb9feeed3b49a55034cce90be996b11cd095b1ce.1454958586.git.mschiffer@universe-factory.net> -References: <bb9feeed3b49a55034cce90be996b11cd095b1ce.1454958586.git.mschiffer@universe-factory.net> -From: Matthias Schiffer <mschiffer@universe-factory.net> -Date: Thu, 6 Aug 2015 22:27:01 +0200 -Subject: [PATCH 2/2] batman-adv: decrease maximum fragment size - ---- - net/batman-adv/main.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h -index 34f56ef..81a7cc2 100644 ---- a/net/batman-adv/main.h -+++ b/net/batman-adv/main.h -@@ -147,7 +147,7 @@ enum batadv_uev_type { - /* Maximum number of fragments for one packet */ - #define BATADV_FRAG_MAX_FRAGMENTS 16 - /* Maxumim size of each fragment */ --#define BATADV_FRAG_MAX_FRAG_SIZE 1400 -+#define BATADV_FRAG_MAX_FRAG_SIZE 1280 - /* Time to keep fragments while waiting for rest of the fragments */ - #define BATADV_FRAG_TIMEOUT 10000 - --- -2.7.0 - |