linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Andrea Mayer <andrea.mayer@uniroma2.it>,
	David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Shrijeet Mukherjee <shrijeet@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>, Shuah Khan <shuah@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Cc: Donald Sharp <sharpd@cumulusnetworks.com>,
	Roopa Prabhu <roopa@cumulusnetworks.com>,
	Dinesh Dutt <didutt@gmail.com>,
	Stefano Salsano <stefano.salsano@uniroma2.it>,
	Paolo Lungaroni <paolo.lungaroni@cnit.it>,
	Ahmed Abdelsalam <ahabdels@gmail.com>
Subject: Re: [RFC,net-next, 1/5] l3mdev: add infrastructure for table to VRF mapping
Date: Sat, 13 Jun 2020 18:37:09 -0600	[thread overview]
Message-ID: <983c5d6b-5366-dfd3-eab2-2727e056d5c5@gmail.com> (raw)
In-Reply-To: <20200612164937.5468-2-andrea.mayer@uniroma2.it>

On 6/12/20 10:49 AM, Andrea Mayer wrote:
> @@ -37,6 +45,15 @@ struct l3mdev_ops {
>  
>  #ifdef CONFIG_NET_L3_MASTER_DEV
>  
> +int l3mdev_table_lookup_register(enum l3mdev_type l3type,
> +				 int (*fn)(struct net *net, u32 table_id));
> +
> +void l3mdev_table_lookup_unregister(enum l3mdev_type l3type,
> +				    int (*fn)(struct net *net, u32 table_id));
> +
> +int l3mdev_ifindex_lookup_by_table_id(enum l3mdev_type l3type, struct net *net,
> +				      u32 table_id);
> +
>  int l3mdev_fib_rule_match(struct net *net, struct flowi *fl,
>  			  struct fib_lookup_arg *arg);
>  
> @@ -280,6 +297,26 @@ struct sk_buff *l3mdev_ip6_out(struct sock *sk, struct sk_buff *skb)
>  	return skb;
>  }
>  
> +static inline
> +int l3mdev_table_lookup_register(enum l3mdev_type l3type,
> +				 int (*fn)(struct net *net, u32 table_id))
> +{
> +	return -EOPNOTSUPP;
> +}
> +
> +static inline
> +void l3mdev_table_lookup_unregister(enum l3mdev_type l3type,
> +				    int (*fn)(struct net *net, u32 table_id))
> +{
> +}
> +
> +static inline
> +int l3mdev_ifindex_lookup_by_table_id(enum l3mdev_type l3type, struct net *net,
> +				      u32 table_id)
> +{
> +	return -ENODEV;
> +}
> +
>  static inline
>  int l3mdev_fib_rule_match(struct net *net, struct flowi *fl,
>  			  struct fib_lookup_arg *arg)
> diff --git a/net/l3mdev/l3mdev.c b/net/l3mdev/l3mdev.c
> index f35899d45a9a..6cc1fe7eb039 100644
> --- a/net/l3mdev/l3mdev.c
> +++ b/net/l3mdev/l3mdev.c
> @@ -9,6 +9,101 @@
>  #include <net/fib_rules.h>
>  #include <net/l3mdev.h>
>  
> +DEFINE_SPINLOCK(l3mdev_lock);
> +
> +typedef int (*lookup_by_table_id_t)(struct net *net, u32 table_d);
> +

I should have caught this earlier. Move lookup_by_table_id_t to l3mdev.h
and use above for 'fn' in l3mdev_table_lookup_{un,}register


  parent reply	other threads:[~2020-06-14  0:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12 16:49 [RFC,net-next, 0/5] Strict mode for VRF Andrea Mayer
2020-06-12 16:49 ` [RFC,net-next, 1/5] l3mdev: add infrastructure for table to VRF mapping Andrea Mayer
2020-06-12 17:51   ` Jakub Kicinski
2020-06-13 22:35     ` Andrea Mayer
2020-06-14  0:37   ` David Ahern [this message]
2020-06-14 21:56     ` Andrea Mayer
2020-06-12 16:49 ` [RFC,net-next, 2/5] vrf: track associations between VRF devices and tables Andrea Mayer
2020-06-13 19:28   ` Stephen Hemminger
2020-06-13 22:53     ` Andrea Mayer
2020-06-14  0:34       ` David Ahern
2020-06-14 21:23         ` Andrea Mayer
2020-06-12 16:49 ` [RFC,net-next, 3/5] vrf: add sysctl parameter for strict mode Andrea Mayer
2020-06-12 17:52   ` Jakub Kicinski
2020-06-13 22:40     ` Andrea Mayer
2020-06-12 16:49 ` [RFC,net-next, 4/5] vrf: add l3mdev registration for table to VRF device lookup Andrea Mayer
2020-06-12 16:49 ` [RFC,net-next, 5/5] selftests: add selftest for the VRF strict mode Andrea Mayer
2020-06-12 17:05 ` [RFC,net-next, 0/5] Strict mode for VRF Dinesh G Dutt
2020-06-13 22:29   ` Andrea Mayer
     [not found]     ` <3099cf72-d54c-494c-b11a-0131138f6d41@Spark>
2020-06-14  0:33       ` 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=983c5d6b-5366-dfd3-eab2-2727e056d5c5@gmail.com \
    --to=dsahern@gmail.com \
    --cc=ahabdels@gmail.com \
    --cc=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=didutt@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paolo.lungaroni@cnit.it \
    --cc=roopa@cumulusnetworks.com \
    --cc=sharpd@cumulusnetworks.com \
    --cc=shrijeet@gmail.com \
    --cc=shuah@kernel.org \
    --cc=stefano.salsano@uniroma2.it \
    /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).