netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: netdev@vger.kernel.org
Cc: kvm@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	linux-kernel@vger.kernel.org, James Morris <jmorris@namei.org>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	xen-devel@lists.xenproject.org,
	"David S. Miller" <davem@davemloft.net>
Subject: [RFC v2 2/4] net: enables interface option to skip IP
Date: Fri, 14 Feb 2014 18:59:38 -0800	[thread overview]
Message-ID: <1392433180-16052-3-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1392433180-16052-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

Some interfaces do not need to have any IPv4 or IPv6
addresses, so enable an option to specify this. One
example where this is observed are virtualization
backend interfaces which just use the net_device
constructs to help with their respective frontends.

This should optimize boot time and complexity on
virtualization environments for each backend interface
while also avoiding triggering SLAAC and DAD, which is
simply pointless for these type of interfaces.

Cc: "David S. Miller" <davem@davemloft.net>
cC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 include/uapi/linux/if.h | 1 +
 net/ipv4/devinet.c      | 3 +++
 net/ipv6/addrconf.c     | 6 ++++++
 3 files changed, 10 insertions(+)

diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
index 8d10382..566d856 100644
--- a/include/uapi/linux/if.h
+++ b/include/uapi/linux/if.h
@@ -85,6 +85,7 @@
 					 * change when it's running */
 #define IFF_MACVLAN 0x200000		/* Macvlan device */
 #define IFF_BRIDGE_NON_ROOT 0x400000    /* Don't consider for root bridge */
+#define IFF_SKIP_IP	0x800000	/* Skip IPv4, IPv6 */
 
 
 #define IF_GET_IFACE	0x0001		/* for querying only */
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a1b5bcb..8e9ef07 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1342,6 +1342,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
 
 	ASSERT_RTNL();
 
+	if (dev->priv_flags & IFF_SKIP_IP)
+		goto out;
+
 	if (!in_dev) {
 		if (event == NETDEV_REGISTER) {
 			in_dev = inetdev_init(dev);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4b6b720..57f58e3 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -314,6 +314,9 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 
 	ASSERT_RTNL();
 
+	if (dev->priv_flags & IFF_SKIP_IP)
+		return NULL;
+
 	if (dev->mtu < IPV6_MIN_MTU)
 		return NULL;
 
@@ -2749,6 +2752,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 	int run_pending = 0;
 	int err;
 
+	if (dev->priv_flags & IFF_SKIP_IP)
+		return NOTIFY_OK;
+
 	switch (event) {
 	case NETDEV_REGISTER:
 		if (!idev && dev->mtu >= IPV6_MIN_MTU) {
-- 
1.8.5.2

  parent reply	other threads:[~2014-02-15  2:59 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15  2:59 [RFC v2 0/4] net: bridge / ip optimizations for virtual net backends Luis R. Rodriguez
2014-02-15  2:59 ` [RFC v2 1/4] bridge: enable interfaces to opt out from becoming the root bridge Luis R. Rodriguez
2014-02-16 18:56   ` Ben Hutchings
2014-02-16 18:57   ` Stephen Hemminger
2014-02-18 21:02     ` Luis R. Rodriguez
2014-02-19  9:52       ` [Xen-devel] " Ian Campbell
2014-02-19 14:35         ` Zoltan Kiss
2014-02-19 17:02           ` Luis R. Rodriguez
2014-02-19 17:08             ` Stephen Hemminger
2014-02-19 17:59               ` Luis R. Rodriguez
2014-02-20 17:19                 ` Stephen Hemminger
2014-02-20 20:24                   ` Luis R. Rodriguez
2014-02-21 13:02                     ` Zoltan Kiss
2014-02-21 16:01                       ` Luis R. Rodriguez
2014-02-22  1:38                         ` Luis R. Rodriguez
2014-02-20 13:19             ` Zoltan Kiss
2014-02-20 20:01               ` Luis R. Rodriguez
2014-02-21 13:02                 ` Zoltan Kiss
2014-02-21 15:59                   ` Luis R. Rodriguez
2014-02-17 17:52   ` Zoltan Kiss
2014-02-19 16:45     ` Luis R. Rodriguez
2014-02-20 14:47       ` Zoltan Kiss
2014-02-20 20:28         ` Luis R. Rodriguez
2014-02-15  2:59 ` Luis R. Rodriguez [this message]
2014-02-17 20:23   ` [RFC v2 2/4] net: enables interface option to skip IP Dan Williams
2014-02-18 21:19     ` Luis R. Rodriguez
2014-02-18 21:42       ` Stephen Hemminger
2014-02-19 17:13         ` Luis R. Rodriguez
2014-02-19 16:45       ` Dan Williams
2014-02-19 17:20         ` Luis R. Rodriguez
2014-02-19 19:13           ` Zoltan Kiss
2014-02-20 20:39             ` Luis R. Rodriguez
2014-02-21 13:02               ` Zoltan Kiss
2014-02-22  1:40                 ` Luis R. Rodriguez
2014-02-20  0:56           ` Dan Williams
2014-02-20  0:58             ` Hannes Frederic Sowa
2014-02-20  1:02               ` Dan Williams
2014-02-20 20:31             ` Luis R. Rodriguez
2014-02-24 18:22               ` Dan Williams
2014-02-24 20:33                 ` Luis R. Rodriguez
2014-02-24 23:04                 ` David Miller
2014-02-25  0:02                   ` Ben Hutchings
2014-02-25  0:12                     ` David Miller
2014-02-25  2:01                       ` Ben Hutchings
2014-02-25  2:23                         ` Hannes Frederic Sowa
2014-02-25 19:50                       ` Paul Marks
2014-02-25 21:07                   ` Dan Williams
2014-02-25 21:18                     ` David Miller
2014-02-26  1:29                       ` Hannes Frederic Sowa
2014-02-15  2:59 ` [RFC v2 3/4] xen-netback: use a random MAC address Luis R. Rodriguez
2014-02-17 10:29   ` [Xen-devel] " David Vrabel
2014-02-18 11:22     ` Ian Campbell
2014-02-18 21:30       ` Luis R. Rodriguez
2014-02-15  2:59 ` [RFC v2 4/4] xen-netback: skip IPv4 and IPv6 interfaces Luis R. Rodriguez
2014-02-17 14:36   ` [Xen-devel] " Zoltan Kiss
2014-02-18 20:16     ` Luis R. Rodriguez
2014-02-19  9:47       ` Ian Campbell
2014-02-17 10:27 ` [Xen-devel] [RFC v2 0/4] net: bridge / ip optimizations for virtual net backends David Vrabel
2014-02-18 19:43   ` Luis R. Rodriguez
2014-02-19  9:48     ` Ian Campbell
2014-02-19 17:10       ` Luis R. Rodriguez

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=1392433180-16052-3-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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).