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.] [RFC 3/6] batman-adv: tp_meter - allow up to 10 queued sessions
Date: Wed, 9 May 2018 00:41:27 +0800 [thread overview]
Message-ID: <20180508164130.8633-4-mareklindner@neomailbox.ch> (raw)
In-Reply-To: <20180508164130.8633-1-mareklindner@neomailbox.ch>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
net/batman-adv/main.h | 6 ++++--
net/batman-adv/tp_meter.c | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 8da3c933..89dfaf87 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -137,9 +137,11 @@
#define BATADV_NC_NODE_TIMEOUT 10000 /* Milliseconds */
/**
- * BATADV_TP_MAX_NUM - maximum number of simultaneously active tp sessions
+ * BATADV_TP_MAX_NUM_QUEUE - maximum number of queued (outgoing) tp sessions
+ * BATADV_TP_MAX_NUM_RECV - maximum number of simultaneous receiving streams
*/
-#define BATADV_TP_MAX_NUM 5
+#define BATADV_TP_MAX_NUM_QUEUE 10
+#define BATADV_TP_MAX_NUM_RECV 1
/**
* enum batadv_mesh_state - State of a soft interface
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index d91d371d..eb7862cd 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -939,7 +939,8 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst,
session_cookie = batadv_tp_session_cookie(session_id, icmp_uid);
*cookie = session_cookie;
- if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
+ if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM_QUEUE)) {
+ spin_unlock_bh(&bat_priv->tp_list_lock);
batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
"Meter: too many ongoing sessions, aborting (SEND)\n");
batadv_tp_batctl_error_notify(BATADV_TP_REASON_TOO_MANY, dst,
@@ -1316,7 +1317,7 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv,
if (tp_vars)
goto out_unlock;
- if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
+ if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM_RECV)) {
batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
"Meter: too many ongoing sessions, aborting (RECV)\n");
goto out_unlock;
--
2.17.0
next prev parent reply other threads:[~2018-05-08 16:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 16:41 [B.A.T.M.A.N.] [RFC 0/6] B.A.T.M.A.N. V - fallback to tp meter estimation if throughput otherwise not available Marek Lindner
2018-05-08 16:41 ` [B.A.T.M.A.N.] [RFC 1/6] batman-adv: tp_meter - prevent concurrent tp_meter sessions by using workqueue Marek Lindner
2018-05-08 16:41 ` [B.A.T.M.A.N.] [RFC 2/6] batman-adv: tp_meter - don't check for existing session Marek Lindner
2018-05-08 16:41 ` Marek Lindner [this message]
2018-05-08 16:41 ` [B.A.T.M.A.N.] [RFC 4/6] batman-adv: tp_meter - add caller distinction Marek Lindner
2018-05-08 16:41 ` [B.A.T.M.A.N.] [RFC 5/6] batman-adv: to_meter - add option to perform one-hop test Marek Lindner
2018-05-08 16:41 ` [B.A.T.M.A.N.] [RFC 6/6] batman-adv: ELP - use tp meter to estimate the throughput if otherwise not available Marek Lindner
2018-05-08 18:36 ` [B.A.T.M.A.N.] [RFC 0/6] B.A.T.M.A.N. V - fallback to tp meter estimation if throughput " Sven Eckelmann
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=20180508164130.8633-4-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).