From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Increase purge timeout on DAT DHT candidates
Date: Sun, 10 Feb 2019 19:59:59 +0800 [thread overview]
Message-ID: <3604216.NcQoz811mF@rousseau> (raw)
In-Reply-To: <20190111210208.29139-1-linus.luessing@c0d3.blue>
[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]
On Saturday, 12 January 2019 05:02:08 HKT Linus Lüssing wrote:
> Some old investigations and analysis seemed to indicate a potential
> reduction of 91.71% of unanswered ARP Requests (45min: 97.95%, 60min:
> 98.95%):
Does this reduction apply to this patch specifically or to the DHCPACK
snooping or both ? Has this patch been tested ?
>
> https://www.open-mesh.org/projects/batman-adv/wiki/DAT_DHCP_Snooping
>
> This patch is rebased on top of:
>
> "batman-adv: DHCP snooping for DAT"
That patch is now called "batman-adv: Snoop DHCPACKs for DAT" and has been
merged ?
> @@ -152,7 +152,9 @@ static void batadv_dat_entry_put(struct batadv_dat_entry
> *dat_entry) static bool batadv_dat_to_purge(struct batadv_dat_entry
> *dat_entry) {
> return batadv_has_timed_out(dat_entry->last_update,
> - BATADV_DAT_ENTRY_TIMEOUT);
> + BATADV_DAT_ENTRY_TIMEOUT) &&
> + batadv_has_timed_out(dat_entry->last_dht_update,
> + BATADV_DAT_DHT_TIMEOUT);
> }
This bit could be further simplified. Introducing 2 timeout fields is a bit
misleading since there only are 2 cases:
* last_update is updated (or not) while last_dht_update is/remains 0
* last_update and last_dht_update have the same value
Why not turn last_dht_update into a bool and apply the timeout length based on
that bool. Something like:
if (is_global_entry)
return batadv_has_timed_out(dat_entry->last_update,
BATADV_DAT_DHT_TIMEOUT);
else
return batadv_has_timed_out(dat_entry->last_update,
BATADV_DAT_ENTRY_TIMEOUT));
Furthermore, don't jiffies overflow at some point on some architectures ?
Initializing a jiffies field with 0 appears error-prone.
Cheers,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-02-10 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 21:02 [B.A.T.M.A.N.] [PATCH] batman-adv: Increase purge timeout on DAT DHT candidates Linus Lüssing
2019-02-02 5:14 ` Sven Eckelmann
2019-02-10 11:50 ` Marek Lindner
2019-02-10 11:59 ` Marek Lindner [this message]
2019-02-10 15:09 ` Linus Lüssing
2019-02-10 22:21 ` Antonio Quartulli
2019-02-11 7:51 ` Linus Lüssing
2019-04-07 11:09 ` Linus Lüssing
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=3604216.NcQoz811mF@rousseau \
--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