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,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Leone Fernando <leone4fernando@gmail.com>
Subject: [PATCH net-next v2 1/4] net: route: expire rt if the dst it holds is expired
Date: Tue, 2 Jul 2024 16:24:03 +0200 [thread overview]
Message-ID: <20240702142406.465415-2-leone4fernando@gmail.com> (raw)
In-Reply-To: <20240702142406.465415-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 54512acbead7..fd0883da7834 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -390,7 +390,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-07-02 14:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 14:24 [RESEND PATCH net-next v2 0/4] net: route: improve route hinting Leone Fernando
2024-07-02 14:24 ` Leone Fernando [this message]
2024-07-02 14:24 ` [PATCH net-next v2 2/4] net: dst_cache: add input_dst_cache API Leone Fernando
2024-07-02 15:15 ` Eric Dumazet
2024-07-08 8:45 ` Leone Fernando
2024-07-02 14:24 ` [PATCH net-next v2 3/4] net: route: always compile dst_cache Leone Fernando
2024-07-02 14:24 ` [PATCH net-next v2 4/4] net: route: replace route hints with input_dst_cache Leone Fernando
-- strict thread matches above, loose matches on Subject: below --
2024-05-07 12:42 [PATCH net-next v2 0/4] net: route: improve route hinting Leone Fernando
2024-05-07 12:42 ` [PATCH net-next v2 1/4] net: route: expire rt if the dst it holds is expired 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=20240702142406.465415-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