From: Martin Schitter <ms+git@mur.at>
To: passt-dev@passt.top
Cc: Martin Schitter <ms+git@mur.at>
Subject: [PATCH 2/3] Timekeeping: Resolving Route Dependencies
Date: Tue, 8 Sep 2026 16:52:23 +0000 [thread overview]
Message-ID: <20260908165322.521274-3-ms+git@mur.at> (raw)
In-Reply-To: <20260908165322.521274-1-ms+git@mur.at>
---
netlink.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/netlink.c b/netlink.c
index 52c1125..2b49fe3 100644
--- a/netlink.c
+++ b/netlink.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <sys/types.h>
#include <limits.h>
+#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
@@ -604,6 +605,7 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
char buf[NLBUFSIZ * 8];
uint32_t seq;
unsigned i;
+ struct timespec start, now;
seq = nl_send(s_src, &req, RTM_GETROUTE, NLM_F_DUMP, sizeof(req));
@@ -706,6 +708,7 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
* can safely ignore that and repeat the requests. This avoids the need
* to calculate dependencies: let the kernel do that.
*/
+ clock_gettime(CLOCK_MONOTONIC, &start);
for (i = 0; i < dup_routes; i++) {
for (nh = (struct nlmsghdr *)buf, left = nlmsgs_size;
NLMSG_OK(nh, left);
@@ -724,6 +727,9 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
return rc;
}
}
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ debug("route dependency handling time: %f s",
+ (now.tv_sec - start.tv_sec) + (now.tv_nsec - start.tv_nsec)/1.0e9);
return 0;
}
--
2.53.0
next prev parent reply other threads:[~2026-09-08 16:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 16:52 Fix for Bug #221 -- Issue concerning bigger routing tables Martin Schitter
2026-09-08 16:52 ` [PATCH 1/3] Fix handling of netlink multipart route dumps Martin Schitter
2026-09-08 16:52 ` Martin Schitter [this message]
2026-09-08 16:52 ` [PATCH 3/3] Optimize route dependency solver Martin Schitter
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=20260908165322.521274-3-ms+git@mur.at \
--to=ms+git@mur.at \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).