From: Leone Fernando <leone4fernando@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, dsahern@kernel.org, willemb@google.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Leone Fernando <leone4fernando@gmail.com>
Subject: [PATCH net-next 1/4] net: route: expire rt if the dst it holds is expired
Date: Thu, 7 Mar 2024 18:11:59 +0100 [thread overview]
Message-ID: <20240307171202.232684-2-leone4fernando@gmail.com> (raw)
In-Reply-To: <20240307171202.232684-1-leone4fernando@gmail.com>
The function rt_is_expired is used to verify that a cached dst is valid.
Currently, this function ignores the rt.dst->expires value.
Add a check to rt_is_expired that validates that the dst is not expired.
Signed-off-by: Leone Fernando <leone4fernando@gmail.com>
---
net/ipv4/route.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c8f76f56dc16..73e742424e97 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -392,7 +392,8 @@ static inline int ip_rt_proc_init(void)
static inline bool rt_is_expired(const struct rtable *rth)
{
- return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev));
+ return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev)) ||
+ (rth->dst.expires && time_after(jiffies, rth->dst.expires));
}
void rt_cache_flush(struct net *net)
--
2.34.1
next prev parent reply other threads:[~2024-03-07 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 17:11 [PATCH net-next 0/4] net: route: improve route hinting Leone Fernando
2024-03-07 17:11 ` Leone Fernando [this message]
2024-03-07 17:12 ` [PATCH net-next 2/4] net: dst_cache: add input_dst_cache API Leone Fernando
2024-03-09 3:55 ` Jakub Kicinski
2024-03-14 14:04 ` Leone Fernando
2024-03-14 18:20 ` Jakub Kicinski
2024-03-07 17:12 ` [PATCH net-next 3/4] net: route: always compile dst_cache Leone Fernando
2024-03-07 17:12 ` [PATCH net-next 4/4] net: route: replace route hints with input_dst_cache Leone Fernando
2024-03-09 4:53 ` [PATCH net-next 0/4] net: route: improve route hinting David Ahern
2024-03-12 15:38 ` Leone Fernando
2024-04-02 10:08 ` Leone Fernando
2024-04-02 15:02 ` David Ahern
2024-04-03 11:50 ` Leone Fernando
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=20240307171202.232684-2-leone4fernando@gmail.com \
--to=leone4fernando@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/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;
as well as URLs for NNTP newsgroup(s).