diff options
author | Antonio Quartulli <antonio@open-mesh.com> | 2015-11-10 18:50:51 +0100 |
---|---|---|
committer | Antonio Quartulli <a@unstable.cc> | 2016-02-29 09:25:06 +0100 |
commit | c833484e5f3872a38fe232c663586069d5ad9645 (patch) | |
tree | d4ab62093f50a411de1fb0ed6bef90634fbe61b1 /net/batman-adv/bat_v.c | |
parent | batman-adv: keep track of when unicast packets are sent (diff) | |
download | linux-c833484e5f3872a38fe232c663586069d5ad9645.tar.xz linux-c833484e5f3872a38fe232c663586069d5ad9645.zip |
batman-adv: ELP - compute the metric based on the estimated throughput
In case of wireless interface retrieve the throughput by
querying cfg80211. To perform this call a separate work
must be scheduled because the function may sleep and this
is not allowed within an RCU protected context (RCU in this
case is used to iterate over all the neighbours).
Use ethtool to retrieve information about an Ethernet link
like HALF/FULL_DUPLEX and advertised bandwidth (e.g.
100/10Mbps).
The metric is updated each time a new ELP packet is sent,
this way it is possible to timely react to a metric
variation which can imply (for example) a neighbour
disconnection.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/bat_v.c')
-rw-r--r-- | net/batman-adv/bat_v.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c index d9cb5c4922c1..ff31f2af9cfe 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -21,6 +21,7 @@ #include <linux/atomic.h> #include <linux/cache.h> #include <linux/init.h> +#include <linux/workqueue.h> #include "bat_v_elp.h" #include "bat_v_ogm.h" @@ -65,6 +66,8 @@ static void batadv_v_hardif_neigh_init(struct batadv_hardif_neigh_node *hardif_neigh) { ewma_throughput_init(&hardif_neigh->bat_v.throughput); + INIT_WORK(&hardif_neigh->bat_v.metric_work, + batadv_v_elp_throughput_metric_update); } static void batadv_v_ogm_schedule(struct batadv_hard_iface *hard_iface) |