From: Paolo Abeni <pabeni@redhat.com>
To: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Edward Cree <ecree@solarflare.com>
Subject: Re: [PATCH net-next v2 2/2] ipv4: use dst hint for ipv4 list receive
Date: Mon, 18 Nov 2019 17:31:08 +0100 [thread overview]
Message-ID: <3327209c4ac29e9051d1ebf41fb88a5749b46292.camel@redhat.com> (raw)
In-Reply-To: <f81feaf9-8792-a648-431f-be14e17e2ace@gmail.com>
Hi,
Thank you for the feedback.
On Mon, 2019-11-18 at 09:07 -0700, David Ahern wrote:
> On 11/18/19 4:01 AM, Paolo Abeni wrote:
> > @@ -535,9 +540,20 @@ static void ip_sublist_rcv_finish(struct list_head *head)
> > }
> > }
> >
> > +static bool ip_can_cache_route_hint(struct net *net, struct rtable *rt)
> > +{
> > + return rt->rt_type != RTN_BROADCAST &&
> > +#ifdef CONFIG_IP_MULTIPLE_TABLES
> > + !net->ipv6.fib6_has_custom_rules;
>
> that should be ipv4, not ipv6, right?
Indeed. More coffee needed here, sorry.
> Also, for readability it would be better to have 2 helpers in
> include//net/fib_rules.h that return true false and manage the net
> namespace issue.
Double checking I parsed the above correctly. Do you mean something
like the following - I think net/ip_fib.h fits more, as it already
deals with CONFIG_IP_MULTIPLE_TABLES?
---
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 52b2406a5dfc..b6c5cd544402 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -272,6 +272,11 @@ void fib_free_table(struct fib_table *tb);
#define TABLE_LOCAL_INDEX (RT_TABLE_LOCAL & (FIB_TABLE_HASHSZ - 1))
#define TABLE_MAIN_INDEX (RT_TABLE_MAIN & (FIB_TABLE_HASHSZ - 1))
+static bool fib4_has_custom_rules(struct net *net)
+{
+ return 0;
+}
+
static inline struct fib_table *fib_get_table(struct net *net, u32 id)
{
struct hlist_node *tb_hlist;
@@ -341,6 +346,11 @@ void __net_exit fib4_rules_exit(struct net *net);
struct fib_table *fib_new_table(struct net *net, u32 id);
struct fib_table *fib_get_table(struct net *net, u32 id);
+static bool fib4_has_custom_rules(struct net *net)
+{
+ return net->ipv4.fib_has_custom_rules;
+}
+
int __fib_lookup(struct net *net, struct flowi4 *flp,
struct fib_result *res, unsigned int flags);
---
plus something similar for the previous patch, in include/net/ip6_fib.h
Thank you,
Paolo
next prev parent reply other threads:[~2019-11-18 16:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 11:01 [PATCH net-next v2 0/2] net: introduce and use route hint Paolo Abeni
2019-11-18 11:01 ` [PATCH net-next v2 1/2] ipv6: introduce and uses route look hints for list input Paolo Abeni
2019-11-18 20:29 ` Willem de Bruijn
2019-11-18 21:58 ` Paolo Abeni
2019-11-19 14:10 ` Willem de Bruijn
2019-11-18 11:01 ` [PATCH net-next v2 2/2] ipv4: use dst hint for ipv4 list receive Paolo Abeni
2019-11-18 14:11 ` kbuild test robot
2019-11-18 16:07 ` David Ahern
2019-11-18 16:31 ` Paolo Abeni [this message]
2019-11-18 16:40 ` David Ahern
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=3327209c4ac29e9051d1ebf41fb88a5749b46292.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=ecree@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.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).