Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e32b0c6 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge



Included changes:
- introduction of the new Network Coding component. This new mechanism aims to
  increase throughput by fusing multiple packets in one transmission.
- minor cleanups

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7cc16380 2df5278b
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,14 @@ Description:
                Defines the penalty which will be applied to an
                Defines the penalty which will be applied to an
                originator message's tq-field on every hop.
                originator message's tq-field on every hop.


What:           /sys/class/net/<mesh_iface>/mesh/network_coding
Date:           Nov 2012
Contact:        Martin Hundeboll <martin@hundeboll.net>
Description:
                Controls whether Network Coding (using some magic
                to send fewer wifi packets but still the same
                content) is enabled or not.

What:           /sys/class/net/<mesh_iface>/mesh/orig_interval
What:           /sys/class/net/<mesh_iface>/mesh/orig_interval
Date:           May 2010
Date:           May 2010
Contact:        Marek Lindner <lindner_marek@yahoo.de>
Contact:        Marek Lindner <lindner_marek@yahoo.de>
+14 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,20 @@ config BATMAN_ADV_DAT
	  mesh networks. If you think that your network does not need
	  mesh networks. If you think that your network does not need
	  this option you can safely remove it and save some space.
	  this option you can safely remove it and save some space.


config BATMAN_ADV_NC
	bool "Network Coding"
	depends on BATMAN_ADV
	default n
	help
	  This option enables network coding, a mechanism that aims to
	  increase the overall network throughput by fusing multiple
	  packets in one transmission.
	  Note that interfaces controlled by batman-adv must be manually
	  configured to have promiscuous mode enabled in order to make
	  network coding work.
	  If you think that your network does not need this feature you
	  can safely disable it and save some space.

config BATMAN_ADV_DEBUG
config BATMAN_ADV_DEBUG
	bool "B.A.T.M.A.N. debugging"
	bool "B.A.T.M.A.N. debugging"
	depends on BATMAN_ADV
	depends on BATMAN_ADV
+1 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ batman-adv-y += hard-interface.o
batman-adv-y += hash.o
batman-adv-y += hash.o
batman-adv-y += icmp_socket.o
batman-adv-y += icmp_socket.o
batman-adv-y += main.o
batman-adv-y += main.o
batman-adv-$(CONFIG_BATMAN_ADV_NC) += network-coding.o
batman-adv-y += originator.o
batman-adv-y += originator.o
batman-adv-y += ring_buffer.o
batman-adv-y += ring_buffer.o
batman-adv-y += routing.o
batman-adv-y += routing.o
+5 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include "hard-interface.h"
#include "hard-interface.h"
#include "send.h"
#include "send.h"
#include "bat_algo.h"
#include "bat_algo.h"
#include "network-coding.h"


static struct batadv_neigh_node *
static struct batadv_neigh_node *
batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
@@ -1185,6 +1186,10 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
	if (!orig_neigh_node)
	if (!orig_neigh_node)
		goto out;
		goto out;


	/* Update nc_nodes of the originator */
	batadv_nc_update_nc_node(bat_priv, orig_node, orig_neigh_node,
				 batadv_ogm_packet, is_single_hop_neigh);

	orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);
	orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);


	/* drop packet if sender is not a direct neighbor and if we
	/* drop packet if sender is not a direct neighbor and if we
+18 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@
#include "icmp_socket.h"
#include "icmp_socket.h"
#include "bridge_loop_avoidance.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"
#include "distributed-arp-table.h"
#include "network-coding.h"


static struct dentry *batadv_debugfs;
static struct dentry *batadv_debugfs;


@@ -310,6 +311,14 @@ struct batadv_debuginfo {
	const struct file_operations fops;
	const struct file_operations fops;
};
};


#ifdef CONFIG_BATMAN_ADV_NC
static int batadv_nc_nodes_open(struct inode *inode, struct file *file)
{
	struct net_device *net_dev = (struct net_device *)inode->i_private;
	return single_open(file, batadv_nc_nodes_seq_print_text, net_dev);
}
#endif

#define BATADV_DEBUGINFO(_name, _mode, _open)		\
#define BATADV_DEBUGINFO(_name, _mode, _open)		\
struct batadv_debuginfo batadv_debuginfo_##_name = {	\
struct batadv_debuginfo batadv_debuginfo_##_name = {	\
	.attr = { .name = __stringify(_name),		\
	.attr = { .name = __stringify(_name),		\
@@ -348,6 +357,9 @@ static BATADV_DEBUGINFO(dat_cache, S_IRUGO, batadv_dat_cache_open);
static BATADV_DEBUGINFO(transtable_local, S_IRUGO,
static BATADV_DEBUGINFO(transtable_local, S_IRUGO,
			batadv_transtable_local_open);
			batadv_transtable_local_open);
static BATADV_DEBUGINFO(vis_data, S_IRUGO, batadv_vis_data_open);
static BATADV_DEBUGINFO(vis_data, S_IRUGO, batadv_vis_data_open);
#ifdef CONFIG_BATMAN_ADV_NC
static BATADV_DEBUGINFO(nc_nodes, S_IRUGO, batadv_nc_nodes_open);
#endif


static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
	&batadv_debuginfo_originators,
	&batadv_debuginfo_originators,
@@ -362,6 +374,9 @@ static struct batadv_debuginfo *batadv_mesh_debuginfos[] = {
#endif
#endif
	&batadv_debuginfo_transtable_local,
	&batadv_debuginfo_transtable_local,
	&batadv_debuginfo_vis_data,
	&batadv_debuginfo_vis_data,
#ifdef CONFIG_BATMAN_ADV_NC
	&batadv_debuginfo_nc_nodes,
#endif
	NULL,
	NULL,
};
};


@@ -431,6 +446,9 @@ int batadv_debugfs_add_meshif(struct net_device *dev)
		}
		}
	}
	}


	if (batadv_nc_init_debugfs(bat_priv) < 0)
		goto rem_attr;

	return 0;
	return 0;
rem_attr:
rem_attr:
	debugfs_remove_recursive(bat_priv->debug_dir);
	debugfs_remove_recursive(bat_priv->debug_dir);
Loading