[0/5] alfred: TQ query optimizations
Message ID | 4690435.IOLn72U8Ez@bentobox (mailing list archive) |
---|---|
Headers |
Return-Path: <b.a.t.m.a.n-bounces@lists.open-mesh.org> Delivered-To: sven@narfation.org Received: from narfation.org (79.140.41.39:993) by sven-atom.home.narfation.org with IMAP4-SSL for <sven@narfation.org>; 24 May 2017 10:34:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sven-atom.home.narfation.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, GAPPY_SUBJECT, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SPF_HELO_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Original-To: sven@narfation.org Delivered-To: sven@narfation.org Received: from open-mesh.org (open-mesh.org [IPv6:2a01:4f8:141:3341:78:46:248:236]) by v3-1039.vlinux.de (Postfix) with ESMTPS id 3439E1100CE for <sven@narfation.org>; Wed, 24 May 2017 12:34:14 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=openmesh.com Authentication-Results: v3-1039.vlinux.de; dkim=fail reason="verification failed; unprotected key" header.d=openmesh-com.20150623.gappssmtp.com header.i=@openmesh-com.20150623.gappssmtp.com header.b=ZJl5eeub; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 03D82837EA; Wed, 24 May 2017 12:34:13 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=openmesh.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=openmesh-com.20150623.gappssmtp.com header.i=@openmesh-com.20150623.gappssmtp.com header.b=ZJl5eeub; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) by open-mesh.org (Postfix) with ESMTPS id CFA5F837DE for <b.a.t.m.a.n@lists.open-mesh.org>; Wed, 24 May 2017 12:31:31 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=openmesh.com Received: by mail-wm0-x22b.google.com with SMTP id 7so58871317wmo.1 for <b.a.t.m.a.n@lists.open-mesh.org>; Wed, 24 May 2017 03:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openmesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:user-agent:mime-version; bh=0cvy/qn6Jt2QWkdOEvoB3kW+5rRzdQOl8NYWEAlTthw=; b=ZJl5eeubMunHwSefKPvFFlsZ2aAzRqrmZR2KlVrEtvUunczPTGSNSA7tNjZqDbsYgS hVlWApkpSwnH+OWkZF2/PY4qNWfpPQI1YDkQkZ58MOJ0ObfakOHm6WMlMzO7lw3HRrPh pPz80XWWlCenXpw+zpZEvTYQFHHBGmKXfzBwp7QLk4251VqzMCSXfb1z/BlCv++OXltT boNuMp8vaaFoZJ0c9XCztS2hP8RsqD0U7tAZA+6BXPEy5a3tiGcf40lwPJBYMwMmEdyR P8MOdJTGybb30sHDcymMkXZ5Ki5haNoLCPwIu8cKaGvvjqNHIbor19fTl6B9w88WzuCW eRiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=0cvy/qn6Jt2QWkdOEvoB3kW+5rRzdQOl8NYWEAlTthw=; b=myPn+Wf77BVdk5qRLqrAZH0707IdWfMju8N2HTmJNXrSDEU4fXWHJZgpL5xvZkTsUl OwmEcDrmgXsSce0vGZJ4m7xAko72o7wCEPHjjcAdtufMQG4zMWy6qZ0zS4nph9FJ/Le/ scQ43c9hJ9Xo23PprzKcy6sC7n1dfTbF4ksWYgi7/4o8uZ7QXwjyj3lurEq4HtI/zABS znhPLzc/9rwma6x7TiUKwW4G7p7c7V16gL0/AjHmfLlNoSMkjKj+pP33dqhBp8HpLzKO d+zObHKhwOceFSgSY1G1qSbuJ1u0f3OndCIwzeauTVopggsT0tFMVQ5iF0JJP14UVggP GywQ== X-Gm-Message-State: AODbwcBAodUDl84fFmH1Ap3wOFKbafYril/MbSEBFDLoVqN+ISmFdKBj +F184pMxeq4zSOG3zE8= X-Received: by 10.28.157.11 with SMTP id g11mr5261213wme.113.1495621890658; Wed, 24 May 2017 03:31:30 -0700 (PDT) Received: from bentobox.localnet (p2003007C6F5B7CFE527B9DFFFECE2683.dip0.t-ipconnect.de. [2003:7c:6f5b:7cfe:527b:9dff:fece:2683]) by smtp.gmail.com with ESMTPSA id m38sm4974560wrm.4.2017.05.24.03.31.29 for <b.a.t.m.a.n@lists.open-mesh.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 May 2017 03:31:29 -0700 (PDT) From: Sven Eckelmann <sven.eckelmann@openmesh.com> To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 24 May 2017 12:31:28 +0200 Message-ID: <4690435.IOLn72U8Ez@bentobox> User-Agent: KMail/5.2.3 (Linux/4.9.0-2-amd64; KDE/5.28.0; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6233723.35ZseKWhTF"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Mailman-Approved-At: Wed, 24 May 2017 12:34:12 +0200 Subject: [B.A.T.M.A.N.] [PATCH 0/5] alfred: TQ query optimizations X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n.lists.open-mesh.org> List-Unsubscribe: <https://lists.open-mesh.org/mm/options/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=unsubscribe> List-Archive: <http://lists.open-mesh.org/pipermail/b.a.t.m.a.n/> List-Post: <mailto:b.a.t.m.a.n@lists.open-mesh.org> List-Help: <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=help> List-Subscribe: <https://lists.open-mesh.org/mm/listinfo/b.a.t.m.a.n>, <mailto:b.a.t.m.a.n-request@lists.open-mesh.org?subject=subscribe> Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n@lists.open-mesh.org> Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" <b.a.t.m.a.n-bounces@lists.open-mesh.org> X-getmail-retrieved-from-mailbox: INBOX X-getmail-filter-classifier: fd[10]: OK |
Message
Sven Eckelmann
May 24, 2017, 10:31 a.m. UTC
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