From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: shemminger@vyatta.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH iproute2 net-next-3.11] ip: add support of link flag IFF_NOPROC
Date: Thu, 3 Oct 2013 15:30:19 +0200 [thread overview]
Message-ID: <1380807019-4653-1-git-send-email-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <1380806905-4461-1-git-send-email-nicolas.dichtel@6wind.com>
When this flag is specified, /proc/sys/net/ipv[4|6]/[conf|neigh]/<dev> and
/proc/net/dev_snmp6/<dev> directories are not created.
This flag cannot be removed.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
include/linux/if.h | 2 ++
ip/ipaddress.c | 1 +
ip/iplink.c | 3 +++
man/man8/ip-link.8.in | 8 ++++++++
4 files changed, 14 insertions(+)
diff --git a/include/linux/if.h b/include/linux/if.h
index 7f261c08e816..5b8a5ebff599 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -53,6 +53,8 @@
#define IFF_ECHO 0x40000 /* echo sent packets */
+#define IFF_NOPROC 0x80000 /* no proc/sysctl directories */
+
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 1c3e4da0d0da..b2e35028c844 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -116,6 +116,7 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
_PF(LOWER_UP);
_PF(DORMANT);
_PF(ECHO);
+ _PF(NOPROC);
#undef _PF
if (flags)
fprintf(fp, "%x", flags);
diff --git a/ip/iplink.c b/ip/iplink.c
index ada9d4255ba2..253ed1cc3f6f 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -50,6 +50,7 @@ void iplink_usage(void)
fprintf(stderr, " [ mtu MTU ]\n");
fprintf(stderr, " [ numtxqueues QUEUE_COUNT ]\n");
fprintf(stderr, " [ numrxqueues QUEUE_COUNT ]\n");
+ fprintf(stderr, " [ noproc ]\n");
fprintf(stderr, " type TYPE [ ARGS ]\n");
fprintf(stderr, " ip link delete DEV type TYPE [ ARGS ]\n");
fprintf(stderr, "\n");
@@ -480,6 +481,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
invarg("Invalid \"numrxqueues\" value\n", *argv);
addattr_l(&req->n, sizeof(*req), IFLA_NUM_RX_QUEUES,
&numrxqueues, 4);
+ } else if (matches(*argv, "noproc") == 0) {
+ req->i.ifi_flags |= IFF_NOPROC;
} else {
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 76f92ddbd82c..b16d1a1f8a41 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -45,6 +45,8 @@ ip-link \- network device configuration
.RB "[ " numrxqueues
.IR QUEUE_COUNT " ]"
.br
+.RB "[ " noproc " ]"
+.br
.BR type " TYPE"
.RI "[ " ARGS " ]"
@@ -197,6 +199,12 @@ specifies the number of transmit queues for new device.
specifies the number of receive queues for new device.
.TP
+.BI noproc
+specifies to no create iface related directories under /proc
+(/proc/sys/net/ipv[4|6]/[conf|neigh]/<dev> and
+/proc/net/dev_snmp6/<dev>)
+
+.TP
VXLAN Type Support
For a link of type
.I VXLAN
--
1.8.2.1
next prev parent reply other threads:[~2013-10-03 13:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 13:28 [PATCH net-next] dev: add support of flag IFF_NOPROC Nicolas Dichtel
2013-10-03 13:30 ` Nicolas Dichtel [this message]
2013-10-03 17:46 ` Stephen Hemminger
2013-10-03 19:09 ` David Miller
2013-10-04 12:07 ` Nicolas Dichtel
2013-10-04 17:29 ` David Miller
2014-10-02 15:24 ` [RFC PATCH linux 0/2] Optimize network interfaces creation Nicolas Dichtel
2014-10-02 15:25 ` [RFC PATCH linux 1/2] proc_net: declare /proc/net as a directory Nicolas Dichtel
2014-10-02 15:25 ` [RFC PATCH linux 2/2] fs/proc: use a hash table for the directory entries Nicolas Dichtel
2014-10-02 16:46 ` Stephen Hemminger
2014-10-03 13:10 ` Nicolas Dichtel
2014-10-02 17:28 ` Alexey Dobriyan
2014-10-03 13:07 ` Nicolas Dichtel
2014-10-02 18:01 ` Eric W. Biederman
2014-10-02 20:06 ` Alexey Dobriyan
2014-10-02 21:07 ` Eric W. Biederman
2014-10-02 21:27 ` Stephen Hemminger
2014-10-03 7:28 ` Nicolas Dichtel
2014-10-03 13:09 ` Nicolas Dichtel
2014-10-06 14:30 ` [PATCH linux v2 0/1] Optimize network interfaces creation Nicolas Dichtel
2014-10-06 14:30 ` [PATCH linux v2 1/1] fs/proc: use a rb tree for the directory entries Nicolas Dichtel
2014-10-06 22:14 ` David Miller
2014-10-07 9:02 ` [PATCH linux v3 0/1] Optimize network interfaces creation Nicolas Dichtel
2014-10-07 9:02 ` [PATCH linux v3 1/1] fs/proc: use a rb tree for the directory entries Nicolas Dichtel
2014-10-13 11:14 ` Nicolas Dichtel
2014-10-14 19:30 ` David Miller
2014-10-14 19:56 ` Eric W. Biederman
2014-10-15 9:02 ` Nicolas Dichtel
2014-10-15 21:37 ` Andrew Morton
2014-10-03 10:55 ` [RFC PATCH linux 2/2] fs/proc: use a hash table " Alexey Dobriyan
2014-10-03 13:07 ` Nicolas Dichtel
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=1380807019-4653-1-git-send-email-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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).