netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL nf-next 0/2] Fourth Round of IPVS Updates for v4.4
@ 2015-10-07  5:23 Simon Horman
  2015-10-07  5:23 ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Simon Horman
  2015-10-07  5:23 ` [PATCH nf-next 2/2] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup} Simon Horman
  0 siblings, 2 replies; 7+ messages in thread
From: Simon Horman @ 2015-10-07  5:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, Simon Horman

Hi Pablo,

please consider these build warning cleanups from David Ahern and myself.
They resolve some minor side effects of Eric Biederman' heroic work to
cleanup IPVS which you recently pulled: its queued up for v4.4 so no need
to worry about earlier kernel versions.

The following changes since commit a29a9a585b2840a205f085a34dfd65c75e86f7c3:

  netfilter: nfnetlink_log: allow to attach conntrack (2015-10-05 17:32:14 +0200)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git tags/ipvs4-for-v4.4

for you to fetch changes up to 92240e8dc0d1a94ea3dde7cb19aace113dcc6cb9:

  ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup} (2015-10-07 10:12:00 +0900)

----------------------------------------------------------------
David Ahern (1):
      ipvs: Remove possibly unused variable from ip_vs_out

Simon Horman (1):
      ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup}

 net/netfilter/ipvs/ip_vs_conn.c | 13 +++++--------
 net/netfilter/ipvs/ip_vs_core.c |  3 +--
 2 files changed, 6 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out
  2015-10-07  5:23 [GIT PULL nf-next 0/2] Fourth Round of IPVS Updates for v4.4 Simon Horman
@ 2015-10-07  5:23 ` Simon Horman
  2015-10-07 13:58   ` Sergei Shtylyov
  2015-10-07  5:23 ` [PATCH nf-next 2/2] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup} Simon Horman
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2015-10-07  5:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, David Ahern, Simon Horman

From: David Ahern <dsa@cumulusnetworks.com>

Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
CONFIG_IP_VS_IPV6 is not enabled:

../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]

After the net refactoring there is only 1 user; push the reference to the
1 user. While the line length slightly exceeds 80 it seems to be the
best change.

Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
[horms: updated subject]
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d08df435c2aa..3773154d9b71 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1172,7 +1172,6 @@ drop:
 static unsigned int
 ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int af)
 {
-	struct net *net = ipvs->net;
 	struct ip_vs_iphdr iph;
 	struct ip_vs_protocol *pp;
 	struct ip_vs_proto_data *pd;
@@ -1272,7 +1271,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
 #ifdef CONFIG_IP_VS_IPV6
 				if (af == AF_INET6) {
 					if (!skb->dev)
-						skb->dev = net->loopback_dev;
+						skb->dev = ipvs->net->loopback_dev;
 					icmpv6_send(skb,
 						    ICMPV6_DEST_UNREACH,
 						    ICMPV6_PORT_UNREACH,
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH nf-next 2/2] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup}
  2015-10-07  5:23 [GIT PULL nf-next 0/2] Fourth Round of IPVS Updates for v4.4 Simon Horman
  2015-10-07  5:23 ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Simon Horman
@ 2015-10-07  5:23 ` Simon Horman
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Horman @ 2015-10-07  5:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, Simon Horman

If CONFIG_PROC_FS is undefined then the arguments of proc_create()
and remove_proc_entry() are unused. As a result the net variables of
ip_vs_conn_net_{init,cleanup} are unused.

net/netfilter/ipvs//ip_vs_conn.c: In function ‘ip_vs_conn_net_init’:
net/netfilter/ipvs//ip_vs_conn.c:1350:14: warning: unused variable ‘net’ [-Wunused-variable]
net/netfilter/ipvs//ip_vs_conn.c: In function ‘ip_vs_conn_net_cleanup’:
net/netfilter/ipvs//ip_vs_conn.c:1361:14: warning: unused variable ‘net’ [-Wunused-variable]
...

Resolve this by dereferencing net as needed rather than storing it
in a variable.

Fixes: 3d99376689ee ("ipvs: Pass ipvs not net into ip_vs_control_net_(init|cleanup)")
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Julian Anastasov <ja@ssi.bg>
---
 net/netfilter/ipvs/ip_vs_conn.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index d1d168c7fc68..85ca189bdc3d 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1347,23 +1347,20 @@ flush_again:
  */
 int __net_init ip_vs_conn_net_init(struct netns_ipvs *ipvs)
 {
-	struct net *net = ipvs->net;
-
 	atomic_set(&ipvs->conn_count, 0);
 
-	proc_create("ip_vs_conn", 0, net->proc_net, &ip_vs_conn_fops);
-	proc_create("ip_vs_conn_sync", 0, net->proc_net, &ip_vs_conn_sync_fops);
+	proc_create("ip_vs_conn", 0, ipvs->net->proc_net, &ip_vs_conn_fops);
+	proc_create("ip_vs_conn_sync", 0, ipvs->net->proc_net,
+		    &ip_vs_conn_sync_fops);
 	return 0;
 }
 
 void __net_exit ip_vs_conn_net_cleanup(struct netns_ipvs *ipvs)
 {
-	struct net *net = ipvs->net;
-
 	/* flush all the connection entries first */
 	ip_vs_conn_flush(ipvs);
-	remove_proc_entry("ip_vs_conn", net->proc_net);
-	remove_proc_entry("ip_vs_conn_sync", net->proc_net);
+	remove_proc_entry("ip_vs_conn", ipvs->net->proc_net);
+	remove_proc_entry("ip_vs_conn_sync", ipvs->net->proc_net);
 }
 
 int __init ip_vs_conn_init(void)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out
  2015-10-07  5:23 ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Simon Horman
@ 2015-10-07 13:58   ` Sergei Shtylyov
  2015-10-07 14:33     ` [Help needed] Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US region ? John D Allen, Leveridge Systems INC
  2015-10-12 15:43     ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Pablo Neira Ayuso
  0 siblings, 2 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2015-10-07 13:58 UTC (permalink / raw)
  To: Simon Horman, Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, David Ahern

Hello.

On 10/7/2015 8:23 AM, Simon Horman wrote:

> From: David Ahern <dsa@cumulusnetworks.com>
>
> Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> CONFIG_IP_VS_IPV6 is not enabled:
>
> ../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> ../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
>
> After the net refactoring there is only 1 user; push the reference to the
> 1 user. While the line length slightly exceeds 80 it seems to be the
> best change.
>
> Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")

    Minor nit: missing space before (. Could be probbably fixed while applying...

> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
> Acked-by: Julian Anastasov <ja@ssi.bg>
> [horms: updated subject]
> Signed-off-by: Simon Horman <horms@verge.net.au>

[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Help needed]  Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US region ?
  2015-10-07 13:58   ` Sergei Shtylyov
@ 2015-10-07 14:33     ` John D Allen, Leveridge Systems INC
  2015-10-12 15:43     ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Pablo Neira Ayuso
  1 sibling, 0 replies; 7+ messages in thread
From: John D Allen, Leveridge Systems INC @ 2015-10-07 14:33 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel

Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US ?

thanks, John.

> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out
  2015-10-07 13:58   ` Sergei Shtylyov
  2015-10-07 14:33     ` [Help needed] Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US region ? John D Allen, Leveridge Systems INC
@ 2015-10-12 15:43     ` Pablo Neira Ayuso
  2015-10-14  2:10       ` Simon Horman
  1 sibling, 1 reply; 7+ messages in thread
From: Pablo Neira Ayuso @ 2015-10-12 15:43 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Simon Horman, lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov, David Ahern

On Wed, Oct 07, 2015 at 04:58:47PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 10/7/2015 8:23 AM, Simon Horman wrote:
> 
> >From: David Ahern <dsa@cumulusnetworks.com>
> >
> >Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> >CONFIG_IP_VS_IPV6 is not enabled:
> >
> >../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> >../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
> >
> >After the net refactoring there is only 1 user; push the reference to the
> >1 user. While the line length slightly exceeds 80 it seems to be the
> >best change.
> >
> >Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
> 
>    Minor nit: missing space before (. Could be probbably fixed while applying...

I have pulled this anyway, I don't want to keep this back for this
minor style problem.

But please Simon, run checkpatch.pl before submitting next time.

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out
  2015-10-12 15:43     ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Pablo Neira Ayuso
@ 2015-10-14  2:10       ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2015-10-14  2:10 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Sergei Shtylyov, lvs-devel, netdev, netfilter-devel,
	Wensong Zhang, Julian Anastasov, David Ahern

On Mon, Oct 12, 2015 at 05:43:49PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Oct 07, 2015 at 04:58:47PM +0300, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 10/7/2015 8:23 AM, Simon Horman wrote:
> > 
> > >From: David Ahern <dsa@cumulusnetworks.com>
> > >
> > >Eric's net namespace changes in 1b75097dd7a26 leaves net unreferenced if
> > >CONFIG_IP_VS_IPV6 is not enabled:
> > >
> > >../net/netfilter/ipvs/ip_vs_core.c: In function ‘ip_vs_out’:
> > >../net/netfilter/ipvs/ip_vs_core.c:1177:14: warning: unused variable ‘net’ [-Wunused-variable]
> > >
> > >After the net refactoring there is only 1 user; push the reference to the
> > >1 user. While the line length slightly exceeds 80 it seems to be the
> > >best change.
> > >
> > >Fixes: 1b75097dd7a26("ipvs: Pass ipvs into ip_vs_out")
> > 
> >    Minor nit: missing space before (. Could be probbably fixed while applying...
> 
> I have pulled this anyway, I don't want to keep this back for this
> minor style problem.
> 
> But please Simon, run checkpatch.pl before submitting next time.

Sorry about that, I will try to be more careful.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-14  2:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07  5:23 [GIT PULL nf-next 0/2] Fourth Round of IPVS Updates for v4.4 Simon Horman
2015-10-07  5:23 ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Simon Horman
2015-10-07 13:58   ` Sergei Shtylyov
2015-10-07 14:33     ` [Help needed] Kernel level, OSI layers 2-3 Network driver developments, anyone in Northwest US region ? John D Allen, Leveridge Systems INC
2015-10-12 15:43     ` [PATCH nf-next 1/2] ipvs: Remove possibly unused variable from ip_vs_out Pablo Neira Ayuso
2015-10-14  2:10       ` Simon Horman
2015-10-07  5:23 ` [PATCH nf-next 2/2] ipvs: Remove possibly unused variables from ip_vs_conn_net_{init,cleanup} Simon Horman

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).