Skip to content

alfred: TQ query optimizations

Sven Eckelmann batman 1 version In review

Get series with b4
b4 am 4690435.IOLn72U8Ez@bentobox

Versions newest first

  1. v1 Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5alfred: Move alfred specific netlink code in separate fileMakefile batadv_query.c batadv_querynl.c +3 more+273 -2030 replies
2/5alfred: Only query tq of remote master in slave moderecv.c+8 -20 replies
3/5alfred: Check the TQ of master servers before pushing dataalfred.h recv.c server.c+36 -220 replies
4/5alfred: Cache the TQ values for each originatorbatadv_query.c batadv_query.h batadv_querynl.c +2 more+121 -510 replies
5/5alfred: Cache the global translation table entriesbatadv_query.c batadv_query.h batadv_querynl.c +2 more+118 -530 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [B.A.T.M.A.N.] [PATCH 0/5] alfred: TQ query optimizations

Hi,

alfred uses the TQ from batman-adv to find its best alfred neighbor. This best neighbor information is used by slave servers to request/publish data.

This is done for each server announcement packet by:

* requesting the global translation table (netlink or debugfs) and then searching in it for the MAC address of the detected alfred server to find its originator address
* requesting the originator table (netlink or debugfs) and then searching it it for the originator address of the detected alfred server to find its TQ value

This was previously done whenever a new announcement packet received by alfred. We've observed that this can be a problem on networks with a lot of master servers (~100) which can see each other, large translation tables and slow CPUs. alfred still worked but the CPU load by alfred was rather high (~20% on an 560MHz AR9344).

The idea is now to avoid this lookup for master servers. And (for slave servers) to process all servers at once. This is done before the wants to push its local data to a master server in an sync interval.

The process which was described earlier was now changed to:

* requesting the global translation table (netlink or debugfs) and then put MAC address and corresponding originator address in tg hash
* requesting the originator table (netlink or debugfs) and then put originator address and corresponding TQ value orig hash
* got through all servers:
- search in tg hash for for the MAC address of the alfred server to find its originator address
- search in orig hash for for the originator address of the alfred server to find its TQ value

These changes reduced the load on the previously mentioned devices significantly.

Kind regards,
Sven

Sven Eckelmann (5):
alfred: Move alfred specific netlink code in separate file
alfred: Only query tq of remote master in slave mode
alfred: Check the TQ of master servers before pushing data
alfred: Cache the TQ values for each originator
alfred: Cache the global translation table entries

 Makefile         |   1 +
 alfred.h         |   1 -
 batadv_query.c   | 227 +++++++++++++++++++++++++++++++++++++++++--------------
 batadv_query.h   |  25 +++++-
 batadv_querynl.c | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 batadv_querynl.h |  34 +++++++++
 netlink.c        | 195 -----------------------------------------------
 netlink.h        |   7 --
 recv.c           |  15 +---
 server.c         |  56 +++++++++++++-
 10 files changed, 501 insertions(+), 276 deletions(-)
 create mode 100644 batadv_querynl.c
 create mode 100644 batadv_querynl.h