Skip to contentSkip to conversation

sctp: fix compile issue with disabled CONFIG_NET_NS

PATCH Applied Ulrich Weber 4 participants 6 messages Aug 16, 2012 – Aug 17, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: fix compile issue with disabled CONFIG_NET_NS

struct seq_net_private has no struct net
if CONFIG_NET_NS is not enabled

---
 net/sctp/proc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
net/sctp/proc.c +3 -6
index 3e62ee5..d9cb2ab 100644
@@ -199,7 +199,6 @@ static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 /* Display sctp endpoints (/proc/net/sctp/eps). */
 static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_endpoint *ep;
@@ -216,7 +215,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 	sctp_for_each_hentry(epb, node, &head->chain) {
 		ep = sctp_ep(epb);
 		sk = epb->sk;
-		if (!net_eq(sock_net(sk), priv->net))
+		if (!net_eq(sock_net(sk), seq_file_net(seq)))
 			continue;
 		seq_printf(seq, "%8pK %8pK %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
 			   sctp_sk(sk)->type, sk->sk_state, hash,
@@ -307,7 +306,6 @@ static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 /* Display sctp associations (/proc/net/sctp/assocs). */
 static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_association *assoc;
@@ -324,7 +322,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 	sctp_for_each_hentry(epb, node, &head->chain) {
 		assoc = sctp_assoc(epb);
 		sk = epb->sk;
-		if (!net_eq(sock_net(sk), priv->net))
+		if (!net_eq(sock_net(sk), seq_file_net(seq)))
 			continue;
 		seq_printf(seq,
 			   "%8pK %8pK %-3d %-3d %-2d %-4d "
@@ -423,7 +421,6 @@ static void sctp_remaddr_seq_stop(struct seq_file *seq, void *v)
 
 static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_association *assoc;
@@ -438,7 +435,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 	sctp_local_bh_disable();
 	read_lock(&head->lock);
 	sctp_for_each_hentry(epb, node, &head->chain) {
-		if (!net_eq(sock_net(epb->sk), priv->net))
+		if (!net_eq(sock_net(epb->sk), seq_file_net(seq)))
 			continue;
 		assoc = sctp_assoc(epb);
 		list_for_each_entry(tsp, &assoc->peer.transport_addr_list,
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Ulrich Weber

struct seq_net_private has no struct net
if CONFIG_NET_NS is not enabled

My mistake.

Quoted 1 line

Ulrich do you get any performance advantage by disabling the network namespace?

I am wondering if there is any benefit to keeping it possible to disable the network namespace?

The original reason for the option was so that distributions and other who wanted to avoid new code could protect their users, and that reasons seems to have long since passed.

Quoted 59 lines
---
 net/sctp/proc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
net/sctp/proc.c +3 -6
index 3e62ee5..d9cb2ab 100644
@@ -199,7 +199,6 @@ static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 /* Display sctp endpoints (/proc/net/sctp/eps). */
 static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_endpoint *ep;
@@ -216,7 +215,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 	sctp_for_each_hentry(epb, node, &head->chain) {
 		ep = sctp_ep(epb);
 		sk = epb->sk;
-		if (!net_eq(sock_net(sk), priv->net))
+		if (!net_eq(sock_net(sk), seq_file_net(seq)))
 			continue;
 		seq_printf(seq, "%8pK %8pK %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
 			   sctp_sk(sk)->type, sk->sk_state, hash,
@@ -307,7 +306,6 @@ static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 /* Display sctp associations (/proc/net/sctp/assocs). */
 static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_association *assoc;
@@ -324,7 +322,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 	sctp_for_each_hentry(epb, node, &head->chain) {
 		assoc = sctp_assoc(epb);
 		sk = epb->sk;
-		if (!net_eq(sock_net(sk), priv->net))
+		if (!net_eq(sock_net(sk), seq_file_net(seq)))
 			continue;
 		seq_printf(seq,
 			   "%8pK %8pK %-3d %-3d %-2d %-4d "
@@ -423,7 +421,6 @@ static void sctp_remaddr_seq_stop(struct seq_file *seq, void *v)
 
 static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 {
-	struct seq_net_private *priv = seq->private;
 	struct sctp_hashbucket *head;
 	struct sctp_ep_common *epb;
 	struct sctp_association *assoc;
@@ -438,7 +435,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 	sctp_local_bh_disable();
 	read_lock(&head->lock);
 	sctp_for_each_hentry(epb, node, &head->chain) {
-		if (!net_eq(sock_net(epb->sk), priv->net))
+		if (!net_eq(sock_net(epb->sk), seq_file_net(seq)))
 			continue;
 		assoc = sctp_assoc(epb);
 		list_for_each_entry(tsp, &assoc->peer.transport_addr_list,
#2 lore raw
Quoted 14 lines · Eric W. Biederman
Quoted 2 lines · Ulrich Weber

struct seq_net_private has no struct net
if CONFIG_NET_NS is not enabled

My mistake.

Quoted 1 line

Ulrich do you get any performance advantage by disabling the network namespace?

Quoted 6 lines

I am wondering if there is any benefit to keeping it possible to disable the network namespace?

The original reason for the option was so that distributions and other who wanted to avoid new code could protect their users, and that reasons seems to have long since passed.

[...]

Network namespaces are now used by common applications such as Chrome/ Chromium and vsftpd (which flushed out some of the early implementation problems). They undoubtedly have some overhead that some users would like to avoid, but I wouldn't expect distributions to disable the option.

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#3 lore raw
Quoted 21 lines · Ben Hutchings
Quoted 14 lines · Eric W. Biederman
Quoted 2 lines · Ulrich Weber

struct seq_net_private has no struct net
if CONFIG_NET_NS is not enabled

My mistake.

Quoted 1 line

Ulrich do you get any performance advantage by disabling the network namespace?

Quoted 6 lines

I am wondering if there is any benefit to keeping it possible to disable the network namespace?

The original reason for the option was so that distributions and other who wanted to avoid new code could protect their users, and that reasons seems to have long since passed.

Quoted 7 lines

[...]

Network namespaces are now used by common applications such as Chrome/ Chromium and vsftpd (which flushed out some of the early implementation problems). They undoubtedly have some overhead that some users would like to avoid, but I wouldn't expect distributions to disable the option.

When the network namespace code was merged we could not mearsure the overhead, at least not on gigabit ethernet. And there is very little code change when network namespaces go away.

So I am starting to look for people who care. Especially for people who can measure overhead associated with network namespaces.

Eric

#5 lore raw
In reply to Eric W. Biederman

Hi Eric,

Quoted 1 line · Eric W. Biederman

Ulrich do you get any performance advantage by disabling the network namespace? I am wondering if there is any benefit to keeping it possible to disable the network namespace? The original reason for the option was so that distributions and other who wanted to avoid new code could protect their users, and that reasons seems to have long since passed.

we just disable most of the options we don't use. I have no idea, if there are any performance advantages here...

Cheers
Ulrich

Signature · 3 lines
Ulrich Weber | [email protected] | Senior Software Engineer
Astaro - a Sophos company | Amalienbadstr 41 | 76227 Karlsruhe | Germany
Phone +49-721-25516-0 | Fax –200 | www.astaro.com