From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Marek Lindner <mareklindner@neomailbox.ch>
Subject: [B.A.T.M.A.N.] [PATCH v4 7/7] batman-adv: ELP - add throughput meter test duration attribute
Date: Tue, 7 Aug 2018 21:05:18 +0800 [thread overview]
Message-ID: <20180807130518.27018-8-mareklindner@neomailbox.ch> (raw)
In-Reply-To: <20180807130518.27018-1-mareklindner@neomailbox.ch>
When the ELP throughput meter fallback kicks in to trigger
a throughput meter measurement the test duration can be
configured via this attribute.
Default tp test duration: 1000ms
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
Documentation/ABI/testing/sysfs-class-net-batman-adv | 7 +++++++
net/batman-adv/bat_v.c | 1 +
net/batman-adv/bat_v_elp.c | 6 ++++--
net/batman-adv/sysfs.c | 3 +++
net/batman-adv/types.h | 3 +++
5 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-class-net-batman-adv b/Documentation/ABI/testing/sysfs-class-net-batman-adv
index 89810684..7b3974a5 100644
--- a/Documentation/ABI/testing/sysfs-class-net-batman-adv
+++ b/Documentation/ABI/testing/sysfs-class-net-batman-adv
@@ -6,6 +6,13 @@ Description:
Defines the interval in milliseconds in which batman
emits probing packets for neighbor sensing (ELP).
+What: /sys/class/net/<iface>/batman-adv/elp_tp_duration
+Date: May 2018
+Contact: Marek Lindner <mareklindner@neomailbox.ch>
+Description:
+ Defines measurement duration in milliseconds upon
+ ELP fallback throughput meter measurements.
+
What: /sys/class/net/<iface>/batman-adv/iface_status
Date: May 2010
Contact: Marek Lindner <mareklindner@neomailbox.ch>
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 6baec4e6..1b3a250f 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -1086,6 +1086,7 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface)
*/
atomic_set(&hard_iface->bat_v.throughput_override, 0);
atomic_set(&hard_iface->bat_v.elp_interval, 500);
+ atomic_set(&hard_iface->bat_v.elp_tp_duration, 1000);
}
/**
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 2d206a08..9a106fab 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -76,10 +76,12 @@ static void batadv_v_elp_tp_start(struct batadv_hardif_neigh_node *neigh)
{
struct batadv_hard_iface *hard_iface = neigh->if_incoming;
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
+ u32 elp_tp_duration;
neigh->bat_v.tp_meter_running = true;
- batadv_tp_start(bat_priv, neigh->addr, neigh,
- 1000, NULL, BATADV_TP_ELP);
+ elp_tp_duration = atomic_read(&hard_iface->bat_v.elp_tp_duration);
+ batadv_tp_start(bat_priv, neigh->addr, neigh, elp_tp_duration,
+ NULL, BATADV_TP_ELP);
}
/**
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index f2eef43b..d8d08bfa 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -1128,6 +1128,8 @@ static BATADV_ATTR(iface_status, 0444, batadv_show_iface_status, NULL);
#ifdef CONFIG_BATMAN_ADV_BATMAN_V
BATADV_ATTR_HIF_UINT(elp_interval, bat_v.elp_interval, 0644,
2 * BATADV_JITTER, INT_MAX, NULL);
+BATADV_ATTR_HIF_UINT(elp_tp_duration, bat_v.elp_tp_duration, 0644,
+ 1, INT_MAX, NULL);
static BATADV_ATTR(throughput_override, 0644, batadv_show_throughput_override,
batadv_store_throughput_override);
#endif
@@ -1137,6 +1139,7 @@ static struct batadv_attribute *batadv_batman_attrs[] = {
&batadv_attr_iface_status,
#ifdef CONFIG_BATMAN_ADV_BATMAN_V
&batadv_attr_elp_interval,
+ &batadv_attr_elp_tp_duration,
&batadv_attr_throughput_override,
#endif
NULL,
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index fe763410..62c9b49d 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -118,6 +118,9 @@ struct batadv_hard_iface_bat_v {
/** @elp_interval: time interval between two ELP transmissions */
atomic_t elp_interval;
+ /** @elp_tp_duration: throughput meter fallback test duration */
+ atomic_t elp_tp_duration;
+
/** @elp_seqno: current ELP sequence number */
atomic_t elp_seqno;
--
2.18.0
prev parent reply other threads:[~2018-08-07 13:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 13:05 [B.A.T.M.A.N.] [PATCH v4 0/7] B.A.T.M.A.N. V - fallback to tp meter estimation if throughput otherwise not available Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 1/7] batman-adv: tp_meter - prevent concurrent tp_meter sessions by using workqueue Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 2/7] batman-adv: tp_meter - don't check for existing session Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 3/7] batman-adv: tp_meter - allow up to 10 queued sessions Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 4/7] batman-adv: tp_meter - add caller distinction Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 5/7] batman-adv: tp_meter - add option to perform one-hop test Marek Lindner
2018-08-07 13:05 ` [B.A.T.M.A.N.] [PATCH v4 6/7] batman-adv: ELP - use tp meter to estimate the throughput if otherwise not available Marek Lindner
2018-08-07 13:05 ` Marek Lindner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180807130518.27018-8-mareklindner@neomailbox.ch \
--to=mareklindner@neomailbox.ch \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).