All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: Antonio Quartulli <a@unstable.cc>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH v5 1/2] batman-adv: split DAT cache into DAT cache and DAT DHT
Date: Thu, 12 Sep 2024 13:08:00 +0200	[thread overview]
Message-ID: <ZuLLkEf15zZTN5xj@sellars> (raw)
In-Reply-To: <0f7c0a9f-6577-4d37-8ad3-2a6b1369b539@unstable.cc>

Hi Antonio,

Thanks for the feedback!

> I haven't followed previous discussions, therefore my question may just
> sound redundant, but if "cache_hash" is for ARP what is the "DAT DHT"? (the
> A in DAT stands for ARP).

The dht_hash would just store what was pushed to it from remote nodes
through the DAT DHT feature. So through a BATADV_P_DAT_DHT_PUT in
a batman-adv unicast4addr packet.

And would only be used for responses to a BATADV_P_DAT_DHT_GET.

The cache_hash would store all the other cases. That is local
additions learned through bat0. Or the responses this node got to
a BATADV_P_DAT_DHT_GET.

> Moreover, it seems with this approach you are converting the DAT concept
> into something "type specific" - am I wrong?

You mean to be able to use it for other types than ARP? Like the
patchset we had for IPv6 a while ago? Hm, no, that at least wasn't
the intention.

> 
> Is it truly required just to have a different timeout?
> Wouldn't a mark on entries be enough to instruct the subsystem about what
> timeout value to use?

That would work, too, right. I just found a split simpler and less
error-prone. With flags I'm always worried about missing potential
race conditions when flipping it back and forth. Especially with
the two different timeouts involved here.

For instance if I had an entry through a remote node
(BATADV_P_DAT_DHT_PUT) and therefore with a flag set. But now got an update for the same
address/entry through bat0 (maybe the client device roamed to us?
Or some collision / duplicate address usage?).
Should I now always unset the flag? Or should I check if its remaining
timeout is less than 5min and only if it is then unset the
flag?

Should a response to a BATADV_P_DAT_DHT_GET only be to an entry
with the flag set? Or independent to what the flag is set to?

.oO(Maybe a split could also be useful if one wanted to introduce
individual limits for additions? Against remote attackers trying to
DoS a node?)

Let me know if you'd still prefer a flag instead of a separate
hash table and I could change that.

Regards, Linus

  reply	other threads:[~2024-09-12 11:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  4:57 [PATCH v5 0/2] batman-adv: increase DAT DHT timeout Linus Lüssing
2024-09-11  4:57 ` [PATCH v5 1/2] batman-adv: split DAT cache into DAT cache and DAT DHT Linus Lüssing
2024-09-11  7:35   ` Antonio Quartulli
2024-09-12 11:08     ` Linus Lüssing [this message]
2024-09-12 11:28       ` Antonio Quartulli
2024-09-17 10:29         ` Linus Lüssing
2024-10-28 13:25   ` Antonio Quartulli
2024-11-23 18:36     ` Sven Eckelmann
2024-11-29 17:57     ` Linus Lüssing
2024-09-11  4:57 ` [PATCH v5 2/2] batman-adv: increase DAT DHT timeout 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=ZuLLkEf15zZTN5xj@sellars \
    --to=linus.luessing@c0d3.blue \
    --cc=a@unstable.cc \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.