* [PATCH][RFC] Shrink ip_vs_*.c includes
@ 2006-02-06 0:48 Roberto Nibali
2006-02-06 9:13 ` Horms
0 siblings, 1 reply; 6+ messages in thread
From: Roberto Nibali @ 2006-02-06 0:48 UTC (permalink / raw)
To: netdev, lvs-users, Horms
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
Hello,
This patch against the latest GIT HEAD reduces the includes to the
necessary ones. I've compile-tested it against following (and s/y/m/)
configuration on x86:
CONFIG_IP_VS=y
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_FTP=y
Please consider applying (but test it first on your local tree since we
don't want stupid breakage resulting from such changes).
Alternatively/additionally I could envision a patch on top of this one
that completely removes the includes from the ../net/ipv4/ipvs/*.c
except the ../include/net/ip_vs.h, which would carry all the needed
header includes.
Signed-off-by: Roberto Nibali <ratz@drugphish.ch>
Best regards,
Roberto Nibali, ratz
--
echo
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
[-- Attachment #2: ipvs_shrink_includes-2.diff --]
[-- Type: text/plain, Size: 10214 bytes --]
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 9b176a9..9f5676b 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -20,17 +20,9 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
-#include <asm/system.h>
-#include <linux/stat.h>
#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 87b8381..b3e8dc5 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -24,14 +24,11 @@
*
*/
-#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/net.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/proc_fs.h> /* for proc_net_* */
-#include <linux/seq_file.h>
+#include <linux/proc_fs.h>
#include <linux/jhash.h>
#include <linux/random.h>
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index 3f47ad8..927fbc0 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -26,19 +26,13 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/icmp.h>
#include <net/ip.h>
-#include <net/tcp.h>
-#include <net/udp.h>
#include <net/icmp.h> /* for icmp_send */
-#include <net/route.h>
+#include <net/route.h> /* for inet_addr_type */
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 7f0288b..a130c5f 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -20,26 +20,14 @@
*
*/
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/capability.h>
-#include <linux/fs.h>
-#include <linux/sysctl.h>
#include <linux/proc_fs.h>
-#include <linux/workqueue.h>
-#include <linux/swap.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip.h>
#include <net/route.h>
#include <net/sock.h>
-#include <asm/uaccess.h>
+//#include <asm/uaccess.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c
index 9fee19c..e40998c 100644
--- a/net/ipv4/ipvs/ip_vs_dh.c
+++ b/net/ipv4/ipvs/ip_vs_dh.c
@@ -38,8 +38,6 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c
index c453e1e..ce3d3c3 100644
--- a/net/ipv4/ipvs/ip_vs_est.c
+++ b/net/ipv4/ipvs/ip_vs_est.c
@@ -13,12 +13,8 @@
* Changes:
*
*/
-#include <linux/config.h>
-#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index a19a33c..ab730b1 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -24,13 +24,7 @@
*
*/
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 6e5cb92..ae51ae8 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -42,14 +42,8 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-/* for sysctl */
-#include <linux/fs.h>
-#include <linux/sysctl.h>
-
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 32ba37b..ebe05a8 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -40,16 +40,8 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-/* for sysctl */
-#include <linux/fs.h>
-#include <linux/sysctl.h>
-/* for proc_net_create/proc_net_remove */
-#include <linux/proc_fs.h>
-
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c
index d88fef9..db63c0f 100644
--- a/net/ipv4/ipvs/ip_vs_lc.c
+++ b/net/ipv4/ipvs/ip_vs_lc.c
@@ -17,7 +17,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c
index bc2a9e5..f1b4341 100644
--- a/net/ipv4/ipvs/ip_vs_nq.c
+++ b/net/ipv4/ipvs/ip_vs_nq.c
@@ -34,7 +34,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index 867d4e9..9084338 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -15,17 +15,8 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
-#include <net/udp.h>
-#include <asm/system.h>
-#include <linux/stat.h>
-#include <linux/proc_fs.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_ah.c b/net/ipv4/ipvs/ip_vs_proto_ah.c
index 8b0505b..cb95f58 100644
--- a/net/ipv4/ipvs/ip_vs_proto_ah.c
+++ b/net/ipv4/ipvs/ip_vs_proto_ah.c
@@ -14,9 +14,6 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c
index c36ccf0..bcbad11 100644
--- a/net/ipv4/ipvs/ip_vs_proto_esp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_esp.c
@@ -14,9 +14,6 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index bc28b11..deb98e7 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -15,11 +15,7 @@
*
*/
-#include <linux/kernel.h>
-#include <linux/ip.h>
-#include <linux/tcp.h> /* for tcphdr */
-#include <net/ip.h>
-#include <net/tcp.h> /* for csum_tcpudp_magic */
+#include <net/tcp.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 89d9175..7ffd5c2 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -17,9 +17,8 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/kernel.h>
-#include <linux/netfilter_ipv4.h>
#include <linux/udp.h>
+#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c
index b23bab2..00ebed8 100644
--- a/net/ipv4/ipvs/ip_vs_rr.c
+++ b/net/ipv4/ipvs/ip_vs_rr.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c
index 8bc42b7..8abc2e9 100644
--- a/net/ipv4/ipvs/ip_vs_sched.c
+++ b/net/ipv4/ipvs/ip_vs_sched.c
@@ -20,11 +20,6 @@
*/
#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <asm/string.h>
-#include <linux/kmod.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c
index ff366f7..8269e6c 100644
--- a/net/ipv4/ipvs/ip_vs_sed.c
+++ b/net/ipv4/ipvs/ip_vs_sed.c
@@ -38,7 +38,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c
index 7775e6c..878c63f 100644
--- a/net/ipv4/ipvs/ip_vs_sh.c
+++ b/net/ipv4/ipvs/ip_vs_sh.c
@@ -35,8 +35,6 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 1bca714..8d2dba4 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -19,20 +19,13 @@
* Justin Ossevoort : Fix endian problem on sync message size.
*/
-#include <linux/module.h>
-#include <linux/slab.h>
#include <linux/inetdevice.h>
-#include <linux/net.h>
-#include <linux/completion.h>
#include <linux/delay.h>
-#include <linux/skbuff.h>
-#include <linux/in.h>
#include <linux/igmp.h> /* for ip_mc_join_group */
#include <linux/udp.h>
+#include <linux/sched.h>
#include <net/ip.h>
-#include <net/sock.h>
-#include <asm/uaccess.h> /* for get_fs and set_fs */
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c
index 8a9d913..6d90a7c 100644
--- a/net/ipv4/ipvs/ip_vs_wlc.c
+++ b/net/ipv4/ipvs/ip_vs_wlc.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c
index 749fa04..bfcd5fb 100644
--- a/net/ipv4/ipvs/ip_vs_wrr.c
+++ b/net/ipv4/ipvs/ip_vs_wrr.c
@@ -21,7 +21,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index 52c12e9..19d85e3 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -15,14 +15,9 @@
*
*/
-#include <linux/kernel.h>
-#include <linux/ip.h>
-#include <linux/tcp.h> /* for tcphdr */
-#include <net/tcp.h> /* for csum_tcpudp_magic */
-#include <net/udp.h>
+#include <net/ip.h>
#include <net/icmp.h> /* for icmp_send */
#include <net/route.h> /* for ip_route_output */
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH][RFC] Shrink ip_vs_*.c includes
2006-02-06 0:48 [PATCH][RFC] Shrink ip_vs_*.c includes Roberto Nibali
@ 2006-02-06 9:13 ` Horms
2006-02-06 9:26 ` Roberto Nibali
0 siblings, 1 reply; 6+ messages in thread
From: Horms @ 2006-02-06 9:13 UTC (permalink / raw)
To: Roberto Nibali; +Cc: LinuxVirtualServer.org users mailing list., netdev
On Mon, Feb 06, 2006 at 01:48:33AM +0100, Roberto Nibali wrote:
> Hello,
>
> This patch against the latest GIT HEAD reduces the includes to the
> necessary ones. I've compile-tested it against following (and s/y/m/)
> configuration on x86:
>
> CONFIG_IP_VS=y
> CONFIG_IP_VS_DEBUG=y
> CONFIG_IP_VS_TAB_BITS=12
> CONFIG_IP_VS_PROTO_TCP=y
> CONFIG_IP_VS_PROTO_UDP=y
> CONFIG_IP_VS_PROTO_ESP=y
> CONFIG_IP_VS_PROTO_AH=y
> CONFIG_IP_VS_RR=y
> CONFIG_IP_VS_WRR=y
> CONFIG_IP_VS_LC=y
> CONFIG_IP_VS_WLC=y
> CONFIG_IP_VS_LBLC=y
> CONFIG_IP_VS_LBLCR=y
> CONFIG_IP_VS_DH=y
> CONFIG_IP_VS_SH=y
> CONFIG_IP_VS_SED=y
> CONFIG_IP_VS_NQ=y
> CONFIG_IP_VS_FTP=y
>
> Please consider applying (but test it first on your local tree since we
> don't want stupid breakage resulting from such changes).
>
> Alternatively/additionally I could envision a patch on top of this one
> that completely removes the includes from the ../net/ipv4/ipvs/*.c
> except the ../include/net/ip_vs.h, which would carry all the needed
> header includes.
Hi Rats,
I'm all for this patch, but I get horrible breakage with the following
config (I can give the rest if you need it).
CONFIG_IP_VS=m
# CONFIG_IP_VS_DEBUG is not set
CONFIG_IP_VS_TAB_BITS=12
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_RR=m
CONFIG_IP_VS_WRR=m
CONFIG_IP_VS_LC=m
CONFIG_IP_VS_WLC=m
CONFIG_IP_VS_LBLC=m
CONFIG_IP_VS_LBLCR=m
CONFIG_IP_VS_DH=m
CONFIG_IP_VS_SH=m
CONFIG_IP_VS_SED=m
CONFIG_IP_VS_NQ=m
CONFIG_IP_VS_FTP=m
# make
CHK include/linux/version.h
CHK include/linux/compile.h
CHK usr/initramfs_list
CC [M] net/ipv4/ipvs/ip_vs_conn.o
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_array':
net/ipv4/ipvs/ip_vs_conn.c:672: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_start':
net/ipv4/ipvs/ip_vs_conn.c:684: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c:685: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
net/ipv4/ipvs/ip_vs_conn.c:685: error: (Each undeclared identifier is reported only once
net/ipv4/ipvs/ip_vs_conn.c:685: error: for each function it appears in.)
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_next':
net/ipv4/ipvs/ip_vs_conn.c:691: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c:695: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
net/ipv4/ipvs/ip_vs_conn.c:708: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c:713: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_stop':
net/ipv4/ipvs/ip_vs_conn.c:719: error: dereferencing pointer to incomplete type
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_show':
net/ipv4/ipvs/ip_vs_conn.c:728: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
net/ipv4/ipvs/ip_vs_conn.c:729: warning: implicit declaration of function 'seq_puts'
net/ipv4/ipvs/ip_vs_conn.c:734: warning: implicit declaration of function 'seq_printf'
net/ipv4/ipvs/ip_vs_conn.c: At top level:
net/ipv4/ipvs/ip_vs_conn.c:746: error: variable 'ip_vs_conn_seq_ops' has initializer but incomplete type
net/ipv4/ipvs/ip_vs_conn.c:747: error: unknown field 'start' specified in initializer
net/ipv4/ipvs/ip_vs_conn.c:747: warning: excess elements in struct initializer
net/ipv4/ipvs/ip_vs_conn.c:747: warning: (near initialization for 'ip_vs_conn_seq_ops')
net/ipv4/ipvs/ip_vs_conn.c:748: error: unknown field 'next' specified in initializer
net/ipv4/ipvs/ip_vs_conn.c:748: warning: excess elements in struct initializer
net/ipv4/ipvs/ip_vs_conn.c:748: warning: (near initialization for 'ip_vs_conn_seq_ops')
net/ipv4/ipvs/ip_vs_conn.c:749: error: unknown field 'stop' specified in initializer
net/ipv4/ipvs/ip_vs_conn.c:749: warning: excess elements in struct initializer
net/ipv4/ipvs/ip_vs_conn.c:749: warning: (near initialization for 'ip_vs_conn_seq_ops')
net/ipv4/ipvs/ip_vs_conn.c:750: error: unknown field 'show' specified in initializer
net/ipv4/ipvs/ip_vs_conn.c:750: warning: excess elements in struct initializer
net/ipv4/ipvs/ip_vs_conn.c:750: warning: (near initialization for 'ip_vs_conn_seq_ops')
net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_open':
net/ipv4/ipvs/ip_vs_conn.c:755: warning: implicit declaration of function 'seq_open'
net/ipv4/ipvs/ip_vs_conn.c: At top level:
net/ipv4/ipvs/ip_vs_conn.c:759: error: 'THIS_MODULE' undeclared here (not in a function)
net/ipv4/ipvs/ip_vs_conn.c:761: error: 'seq_read' undeclared here (not in a function)
net/ipv4/ipvs/ip_vs_conn.c:762: error: 'seq_lseek' undeclared here (not in a function)
net/ipv4/ipvs/ip_vs_conn.c:763: error: 'seq_release' undeclared here (not in a function)
make[3]: *** [net/ipv4/ipvs/ip_vs_conn.o] Error 1
make[2]: *** [net/ipv4/ipvs] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
--
Horms
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][RFC] Shrink ip_vs_*.c includes
2006-02-06 9:13 ` Horms
@ 2006-02-06 9:26 ` Roberto Nibali
2006-02-06 10:09 ` Horms
0 siblings, 1 reply; 6+ messages in thread
From: Roberto Nibali @ 2006-02-06 9:26 UTC (permalink / raw)
To: Roberto Nibali, netdev, lvs-users
> Hi Rats,
>
> I'm all for this patch, but I get horrible breakage with the following
> config (I can give the rest if you need it).
Darn!
> CONFIG_IP_VS=m
> # CONFIG_IP_VS_DEBUG is not set
> CONFIG_IP_VS_TAB_BITS=12
> CONFIG_IP_VS_PROTO_TCP=y
> CONFIG_IP_VS_PROTO_UDP=y
> CONFIG_IP_VS_PROTO_ESP=y
> CONFIG_IP_VS_PROTO_AH=y
> CONFIG_IP_VS_RR=m
> CONFIG_IP_VS_WRR=m
> CONFIG_IP_VS_LC=m
> CONFIG_IP_VS_WLC=m
> CONFIG_IP_VS_LBLC=m
> CONFIG_IP_VS_LBLCR=m
> CONFIG_IP_VS_DH=m
> CONFIG_IP_VS_SH=m
> CONFIG_IP_VS_SED=m
> CONFIG_IP_VS_NQ=m
> CONFIG_IP_VS_FTP=m
Ok, this is m/y mixed. Haven't tried it yet.
> # make
> CHK include/linux/version.h
> CHK include/linux/compile.h
> CHK usr/initramfs_list
> CC [M] net/ipv4/ipvs/ip_vs_conn.o
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_array':
> net/ipv4/ipvs/ip_vs_conn.c:672: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_start':
> net/ipv4/ipvs/ip_vs_conn.c:684: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c:685: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
> net/ipv4/ipvs/ip_vs_conn.c:685: error: (Each undeclared identifier is reported only once
> net/ipv4/ipvs/ip_vs_conn.c:685: error: for each function it appears in.)
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_next':
> net/ipv4/ipvs/ip_vs_conn.c:691: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c:695: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
> net/ipv4/ipvs/ip_vs_conn.c:708: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c:713: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_stop':
> net/ipv4/ipvs/ip_vs_conn.c:719: error: dereferencing pointer to incomplete type
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_seq_show':
> net/ipv4/ipvs/ip_vs_conn.c:728: error: 'SEQ_START_TOKEN' undeclared (first use in this function)
> net/ipv4/ipvs/ip_vs_conn.c:729: warning: implicit declaration of function 'seq_puts'
> net/ipv4/ipvs/ip_vs_conn.c:734: warning: implicit declaration of function 'seq_printf'
> net/ipv4/ipvs/ip_vs_conn.c: At top level:
> net/ipv4/ipvs/ip_vs_conn.c:746: error: variable 'ip_vs_conn_seq_ops' has initializer but incomplete type
> net/ipv4/ipvs/ip_vs_conn.c:747: error: unknown field 'start' specified in initializer
> net/ipv4/ipvs/ip_vs_conn.c:747: warning: excess elements in struct initializer
> net/ipv4/ipvs/ip_vs_conn.c:747: warning: (near initialization for 'ip_vs_conn_seq_ops')
> net/ipv4/ipvs/ip_vs_conn.c:748: error: unknown field 'next' specified in initializer
> net/ipv4/ipvs/ip_vs_conn.c:748: warning: excess elements in struct initializer
> net/ipv4/ipvs/ip_vs_conn.c:748: warning: (near initialization for 'ip_vs_conn_seq_ops')
> net/ipv4/ipvs/ip_vs_conn.c:749: error: unknown field 'stop' specified in initializer
> net/ipv4/ipvs/ip_vs_conn.c:749: warning: excess elements in struct initializer
> net/ipv4/ipvs/ip_vs_conn.c:749: warning: (near initialization for 'ip_vs_conn_seq_ops')
> net/ipv4/ipvs/ip_vs_conn.c:750: error: unknown field 'show' specified in initializer
> net/ipv4/ipvs/ip_vs_conn.c:750: warning: excess elements in struct initializer
> net/ipv4/ipvs/ip_vs_conn.c:750: warning: (near initialization for 'ip_vs_conn_seq_ops')
> net/ipv4/ipvs/ip_vs_conn.c: In function 'ip_vs_conn_open':
> net/ipv4/ipvs/ip_vs_conn.c:755: warning: implicit declaration of function 'seq_open'
> net/ipv4/ipvs/ip_vs_conn.c: At top level:
> net/ipv4/ipvs/ip_vs_conn.c:759: error: 'THIS_MODULE' undeclared here (not in a function)
> net/ipv4/ipvs/ip_vs_conn.c:761: error: 'seq_read' undeclared here (not in a function)
> net/ipv4/ipvs/ip_vs_conn.c:762: error: 'seq_lseek' undeclared here (not in a function)
> net/ipv4/ipvs/ip_vs_conn.c:763: error: 'seq_release' undeclared here (not in a function)
> make[3]: *** [net/ipv4/ipvs/ip_vs_conn.o] Error 1
> make[2]: *** [net/ipv4/ipvs] Error 2
> make[1]: *** [net/ipv4] Error 2
> make: *** [net] Error 2
>
I'll reproduce it with your config. I didn't think of trying it with
mixed y/m settings. Following include is missing then:
#include <linux/seq_file.h>
Or do you think we could put all the needed includes into ip_vs.h and
simply be done with it?
Best regards,
Roberto Nibali, ratz
--
-------------------------------------------------------------
addr://Kasinostrasse 30, CH-5001 Aarau tel://++41 62 823 9355
http://www.terreactive.com fax://++41 62 823 9356
-------------------------------------------------------------
10 Jahre Kompetenz in IT-Sicherheit. 1996 - 2006
Wir sichern Ihren Erfolg. terreActive AG
-------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][RFC] Shrink ip_vs_*.c includes
2006-02-06 9:26 ` Roberto Nibali
@ 2006-02-06 10:09 ` Horms
2006-02-06 10:33 ` Roberto Nibali
0 siblings, 1 reply; 6+ messages in thread
From: Horms @ 2006-02-06 10:09 UTC (permalink / raw)
To: lvs-users; +Cc: netdev
In gmane.comp.linux.lvs.user Roberto Nibali <ratz@tac.ch> wrote:
>> Hi Rats,
>>
>> I'm all for this patch, but I get horrible breakage with the following
>> config (I can give the rest if you need it).
>
> Darn!
>
>> CONFIG_IP_VS=m
>> # CONFIG_IP_VS_DEBUG is not set
>> CONFIG_IP_VS_TAB_BITS=12
>> CONFIG_IP_VS_PROTO_TCP=y
>> CONFIG_IP_VS_PROTO_UDP=y
>> CONFIG_IP_VS_PROTO_ESP=y
>> CONFIG_IP_VS_PROTO_AH=y
>> CONFIG_IP_VS_RR=m
>> CONFIG_IP_VS_WRR=m
>> CONFIG_IP_VS_LC=m
>> CONFIG_IP_VS_WLC=m
>> CONFIG_IP_VS_LBLC=m
>> CONFIG_IP_VS_LBLCR=m
>> CONFIG_IP_VS_DH=m
>> CONFIG_IP_VS_SH=m
>> CONFIG_IP_VS_SED=m
>> CONFIG_IP_VS_NQ=m
>> CONFIG_IP_VS_FTP=m
>
> Ok, this is m/y mixed. Haven't tried it yet.
Actually, I think that its completely modular.
[snip]
> I'll reproduce it with your config. I didn't think of trying it with
> mixed y/m settings. Following include is missing then:
>
> #include <linux/seq_file.h>
Thanks, I found that linux/module.h was also needed.
After putting those two back into ip_vs_conn.c the build went
find. I also tried a few other combinations, all on ia64, without issue.
My diff is below. Could you recheck it?
> Or do you think we could put all the needed includes into ip_vs.h and
> simply be done with it?
I spoke breifly with Dave about this, and he isn't very keen on it.
The problem with that approach, is that while its less work to
maintain the headers by hand, it will likely result in uneeded
includes in some cases. So all of LVS will get built when
a given header is touched, where perhaps only half of it needed
to be built. So with that in mind, could you continue in the vein of
your original patch?
--
Horms
Hello,
This patch against the latest GIT HEAD reduces the includes to the
necessary ones. I've compile-tested it against following (and s/y/m/)
configuration on x86:
CONFIG_IP_VS=y
CONFIG_IP_VS_DEBUG=y
CONFIG_IP_VS_TAB_BITS=12
CONFIG_IP_VS_PROTO_TCP=y
CONFIG_IP_VS_PROTO_UDP=y
CONFIG_IP_VS_PROTO_ESP=y
CONFIG_IP_VS_PROTO_AH=y
CONFIG_IP_VS_RR=y
CONFIG_IP_VS_WRR=y
CONFIG_IP_VS_LC=y
CONFIG_IP_VS_WLC=y
CONFIG_IP_VS_LBLC=y
CONFIG_IP_VS_LBLCR=y
CONFIG_IP_VS_DH=y
CONFIG_IP_VS_SH=y
CONFIG_IP_VS_SED=y
CONFIG_IP_VS_NQ=y
CONFIG_IP_VS_FTP=y
Please consider applying (but test it first on your local tree since we
don't want stupid breakage resulting from such changes).
Alternatively/additionally I could envision a patch on top of this one
that completely removes the includes from the ../net/ipv4/ipvs/*.c
except the ../include/net/ip_vs.h, which would carry all the needed
header includes.
Signed-off-by: Roberto Nibali <ratz@drugphish.ch>
Signed-off-by: Horms <horms@verge.net.au>
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 9b176a9..9f5676b 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -20,17 +20,9 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
-#include <asm/system.h>
-#include <linux/stat.h>
#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 87b8381..157b9ad 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -24,13 +24,12 @@
*
*/
-#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/net.h>
-#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/slab.h>
#include <linux/vmalloc.h>
-#include <linux/proc_fs.h> /* for proc_net_* */
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/jhash.h>
#include <linux/random.h>
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index 3f47ad8..927fbc0 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -26,19 +26,13 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/icmp.h>
#include <net/ip.h>
-#include <net/tcp.h>
-#include <net/udp.h>
#include <net/icmp.h> /* for icmp_send */
-#include <net/route.h>
+#include <net/route.h> /* for inet_addr_type */
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 7f0288b..a130c5f 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -20,26 +20,14 @@
*
*/
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/capability.h>
-#include <linux/fs.h>
-#include <linux/sysctl.h>
#include <linux/proc_fs.h>
-#include <linux/workqueue.h>
-#include <linux/swap.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip.h>
#include <net/route.h>
#include <net/sock.h>
-#include <asm/uaccess.h>
+//#include <asm/uaccess.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c
index 9fee19c..e40998c 100644
--- a/net/ipv4/ipvs/ip_vs_dh.c
+++ b/net/ipv4/ipvs/ip_vs_dh.c
@@ -38,8 +38,6 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c
index c453e1e..ce3d3c3 100644
--- a/net/ipv4/ipvs/ip_vs_est.c
+++ b/net/ipv4/ipvs/ip_vs_est.c
@@ -13,12 +13,8 @@
* Changes:
*
*/
-#include <linux/config.h>
-#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index a19a33c..ab730b1 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -24,13 +24,7 @@
*
*/
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 6e5cb92..ae51ae8 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -42,14 +42,8 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-/* for sysctl */
-#include <linux/fs.h>
-#include <linux/sysctl.h>
-
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 32ba37b..ebe05a8 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -40,16 +40,8 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-/* for sysctl */
-#include <linux/fs.h>
-#include <linux/sysctl.h>
-/* for proc_net_create/proc_net_remove */
-#include <linux/proc_fs.h>
-
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c
index d88fef9..db63c0f 100644
--- a/net/ipv4/ipvs/ip_vs_lc.c
+++ b/net/ipv4/ipvs/ip_vs_lc.c
@@ -17,7 +17,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c
index bc2a9e5..f1b4341 100644
--- a/net/ipv4/ipvs/ip_vs_nq.c
+++ b/net/ipv4/ipvs/ip_vs_nq.c
@@ -34,7 +34,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index 867d4e9..9084338 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -15,17 +15,8 @@
*
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
-#include <linux/in.h>
-#include <linux/ip.h>
-#include <net/protocol.h>
#include <net/tcp.h>
-#include <net/udp.h>
-#include <asm/system.h>
-#include <linux/stat.h>
-#include <linux/proc_fs.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_ah.c b/net/ipv4/ipvs/ip_vs_proto_ah.c
index 8b0505b..cb95f58 100644
--- a/net/ipv4/ipvs/ip_vs_proto_ah.c
+++ b/net/ipv4/ipvs/ip_vs_proto_ah.c
@@ -14,9 +14,6 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c
index c36ccf0..bcbad11 100644
--- a/net/ipv4/ipvs/ip_vs_proto_esp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_esp.c
@@ -14,9 +14,6 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index bc28b11..deb98e7 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -15,11 +15,7 @@
*
*/
-#include <linux/kernel.h>
-#include <linux/ip.h>
-#include <linux/tcp.h> /* for tcphdr */
-#include <net/ip.h>
-#include <net/tcp.h> /* for csum_tcpudp_magic */
+#include <net/tcp.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 89d9175..7ffd5c2 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -17,9 +17,8 @@
#include <linux/in.h>
#include <linux/ip.h>
-#include <linux/kernel.h>
-#include <linux/netfilter_ipv4.h>
#include <linux/udp.h>
+#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c
index b23bab2..00ebed8 100644
--- a/net/ipv4/ipvs/ip_vs_rr.c
+++ b/net/ipv4/ipvs/ip_vs_rr.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c
index 8bc42b7..8abc2e9 100644
--- a/net/ipv4/ipvs/ip_vs_sched.c
+++ b/net/ipv4/ipvs/ip_vs_sched.c
@@ -20,11 +20,6 @@
*/
#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <asm/string.h>
-#include <linux/kmod.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c
index ff366f7..8269e6c 100644
--- a/net/ipv4/ipvs/ip_vs_sed.c
+++ b/net/ipv4/ipvs/ip_vs_sed.c
@@ -38,7 +38,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c
index 7775e6c..878c63f 100644
--- a/net/ipv4/ipvs/ip_vs_sh.c
+++ b/net/ipv4/ipvs/ip_vs_sh.c
@@ -35,8 +35,6 @@
*/
#include <linux/ip.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 1bca714..8d2dba4 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -19,20 +19,13 @@
* Justin Ossevoort : Fix endian problem on sync message size.
*/
-#include <linux/module.h>
-#include <linux/slab.h>
#include <linux/inetdevice.h>
-#include <linux/net.h>
-#include <linux/completion.h>
#include <linux/delay.h>
-#include <linux/skbuff.h>
-#include <linux/in.h>
#include <linux/igmp.h> /* for ip_mc_join_group */
#include <linux/udp.h>
+#include <linux/sched.h>
#include <net/ip.h>
-#include <net/sock.h>
-#include <asm/uaccess.h> /* for get_fs and set_fs */
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c
index 8a9d913..6d90a7c 100644
--- a/net/ipv4/ipvs/ip_vs_wlc.c
+++ b/net/ipv4/ipvs/ip_vs_wlc.c
@@ -22,7 +22,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c
index 749fa04..bfcd5fb 100644
--- a/net/ipv4/ipvs/ip_vs_wrr.c
+++ b/net/ipv4/ipvs/ip_vs_wrr.c
@@ -21,7 +21,6 @@
*/
#include <linux/module.h>
-#include <linux/kernel.h>
#include <net/ip_vs.h>
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index 52c12e9..19d85e3 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -15,14 +15,9 @@
*
*/
-#include <linux/kernel.h>
-#include <linux/ip.h>
-#include <linux/tcp.h> /* for tcphdr */
-#include <net/tcp.h> /* for csum_tcpudp_magic */
-#include <net/udp.h>
+#include <net/ip.h>
#include <net/icmp.h> /* for icmp_send */
#include <net/route.h> /* for ip_route_output */
-#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <net/ip_vs.h>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH][RFC] Shrink ip_vs_*.c includes
2006-02-06 10:09 ` Horms
@ 2006-02-06 10:33 ` Roberto Nibali
2006-02-07 4:00 ` Horms
0 siblings, 1 reply; 6+ messages in thread
From: Roberto Nibali @ 2006-02-06 10:33 UTC (permalink / raw)
To: LinuxVirtualServer.org users mailing list.; +Cc: netdev
>>> CONFIG_IP_VS=m
>>> # CONFIG_IP_VS_DEBUG is not set
>>> CONFIG_IP_VS_TAB_BITS=12
>>> CONFIG_IP_VS_PROTO_TCP=y
>>> CONFIG_IP_VS_PROTO_UDP=y
>>> CONFIG_IP_VS_PROTO_ESP=y
>>> CONFIG_IP_VS_PROTO_AH=y
These 'y' caused me to think that it wasn't modular.
>>> CONFIG_IP_VS_RR=m
>>> CONFIG_IP_VS_WRR=m
>>> CONFIG_IP_VS_LC=m
>>> CONFIG_IP_VS_WLC=m
>>> CONFIG_IP_VS_LBLC=m
>>> CONFIG_IP_VS_LBLCR=m
>>> CONFIG_IP_VS_DH=m
>>> CONFIG_IP_VS_SH=m
>>> CONFIG_IP_VS_SED=m
>>> CONFIG_IP_VS_NQ=m
>>> CONFIG_IP_VS_FTP=m
>> Ok, this is m/y mixed. Haven't tried it yet.
>
> Actually, I think that its completely modular.
So why the heck didn't it trigger on my system? Is it because the
include/net/* headers are not always included on ia64? Well, tant pis!
>> I'll reproduce it with your config. I didn't think of trying it with
>> mixed y/m settings. Following include is missing then:
>>
>> #include <linux/seq_file.h>
>
> Thanks, I found that linux/module.h was also needed.
Ok. I thought this would get included by any of the other headers. Well,
so long as it also compiles fine on your system, I'm good.
> After putting those two back into ip_vs_conn.c the build went
> find. I also tried a few other combinations, all on ia64, without issue.
> My diff is below. Could you recheck it?
Seems fine to me, thanks for testing this. I would have felt really bad
if I broke IPVS in mainline because of such changes.
>> Or do you think we could put all the needed includes into ip_vs.h and
>> simply be done with it?
>
> I spoke breifly with Dave about this, and he isn't very keen on it.
Fair enough.
> The problem with that approach, is that while its less work to
> maintain the headers by hand, it will likely result in uneeded
> includes in some cases.
How so? All includes nota bene have the prevailing:
#ifndef _FOOBAR_H
#define _FOOBAR_H
[...]
#endif /* _FOOBAR_H */
framework. So would this speak slightely against that? Also, from the
includes we take today, I reckon that in the end we half of the
include/{net,linux}/*.h is in our objects :). But you guys decide. I
could maybe run a call-graph.
> So all of LVS will get built when
> a given header is touched, where perhaps only half of it needed
> to be built.
Well, it does not happen so ofter that a core network related header is
touched to my avail.
> So with that in mind, could you continue in the vein of
> your original patch?
Sure thing. Your attached patch is fine; if you feel confident with our
changes, submit it.
Best regards,
Roberto Nibali, ratz
--
-------------------------------------------------------------
addr://Kasinostrasse 30, CH-5001 Aarau tel://++41 62 823 9355
http://www.terreactive.com fax://++41 62 823 9356
-------------------------------------------------------------
10 Jahre Kompetenz in IT-Sicherheit. 1996 - 2006
Wir sichern Ihren Erfolg. terreActive AG
-------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH][RFC] Shrink ip_vs_*.c includes
2006-02-06 10:33 ` Roberto Nibali
@ 2006-02-07 4:00 ` Horms
0 siblings, 0 replies; 6+ messages in thread
From: Horms @ 2006-02-07 4:00 UTC (permalink / raw)
To: lvs-users; +Cc: netdev
In gmane.comp.linux.lvs.user Roberto Nibali <ratz@tac.ch> wrote:
>>>> CONFIG_IP_VS=m
>>>> # CONFIG_IP_VS_DEBUG is not set
>>>> CONFIG_IP_VS_TAB_BITS=12
>>>> CONFIG_IP_VS_PROTO_TCP=y
>>>> CONFIG_IP_VS_PROTO_UDP=y
>>>> CONFIG_IP_VS_PROTO_ESP=y
>>>> CONFIG_IP_VS_PROTO_AH=y
>
> These 'y' caused me to think that it wasn't modular.
Me too :)
>>>> CONFIG_IP_VS_RR=m
>>>> CONFIG_IP_VS_WRR=m
>>>> CONFIG_IP_VS_LC=m
>>>> CONFIG_IP_VS_WLC=m
>>>> CONFIG_IP_VS_LBLC=m
>>>> CONFIG_IP_VS_LBLCR=m
>>>> CONFIG_IP_VS_DH=m
>>>> CONFIG_IP_VS_SH=m
>>>> CONFIG_IP_VS_SED=m
>>>> CONFIG_IP_VS_NQ=m
>>>> CONFIG_IP_VS_FTP=m
>>> Ok, this is m/y mixed. Haven't tried it yet.
>>
>> Actually, I think that its completely modular.
>
> So why the heck didn't it trigger on my system? Is it because the
> include/net/* headers are not always included on ia64? Well, tant pis!
I can reproduce the problem on x86 too.
>>> I'll reproduce it with your config. I didn't think of trying it with
>>> mixed y/m settings. Following include is missing then:
>>>
>>> #include <linux/seq_file.h>
>>
>> Thanks, I found that linux/module.h was also needed.
>
> Ok. I thought this would get included by any of the other headers. Well,
> so long as it also compiles fine on your system, I'm good.
>
>> After putting those two back into ip_vs_conn.c the build went
>> find. I also tried a few other combinations, all on ia64, without issue.
>> My diff is below. Could you recheck it?
>
> Seems fine to me, thanks for testing this. I would have felt really bad
> if I broke IPVS in mainline because of such changes.
>
>>> Or do you think we could put all the needed includes into ip_vs.h and
>>> simply be done with it?
>>
>> I spoke breifly with Dave about this, and he isn't very keen on it.
>
> Fair enough.
>
>> The problem with that approach, is that while its less work to
>> maintain the headers by hand, it will likely result in uneeded
>> includes in some cases.
>
> How so? All includes nota bene have the prevailing:
>
> #ifndef _FOOBAR_H
> #define _FOOBAR_H
> [...]
> #endif /* _FOOBAR_H */
>
> framework. So would this speak slightely against that?
I dare say that they do. However thats actually not the issue at hand.
The problem is, lets say that a.h is listed in ip_vs.h because
some of ipvs/*.c need it. Well, a.h is going to end up inclded in
all of ipvs/*.c, even the ones that don't need it, and thus would
otherwise not have it (assuming that we prune things by hand,
as you have done). So if a.h gets touched, for some reason,
then all of ipvs/*.c will be recompiled, some of which is not
neccessary.
This of course assumes that there is some variance in the includes
needed by the ipvs/*.c files. I think that is a fair assumption, though
I haven't done any analysis on it. Its also a reasonable expectation
that this could be the case in the future, even if it is not the case
now.
> Also, from the
> includes we take today, I reckon that in the end we half of the
> include/{net,linux}/*.h is in our objects :). But you guys decide. I
> could maybe run a call-graph.
Thats a slightly different issue. Perhaps the headers should be cleaned
up a little. But at least by taking the approach that your current patch
does, IPVS can get the benifit of any subsequent cleanups, rather than
partially annuling them.
>> So all of LVS will get built when
>> a given header is touched, where perhaps only half of it needed
>> to be built.
>
> Well, it does not happen so ofter that a core network related header is
> touched to my avail.
That I would tend to agree with. But Dave seemed to think it is worth
the effort to break the headers out in IPVS, as they currently are.
And I think its reasonable enough.
>> So with that in mind, could you continue in the vein of
>> your original patch?
>
> Sure thing. Your attached patch is fine; if you feel confident with our
> changes, submit it.
Will do. I'll drop the lvs-users CC as its a closed list whereas
netdev isn't. For the benifit of people who are on lvs-users and not
netdev, the patch will be the same as what I posted yesterday.
--
Horms
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-07 4:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 0:48 [PATCH][RFC] Shrink ip_vs_*.c includes Roberto Nibali
2006-02-06 9:13 ` Horms
2006-02-06 9:26 ` Roberto Nibali
2006-02-06 10:09 ` Horms
2006-02-06 10:33 ` Roberto Nibali
2006-02-07 4:00 ` Horms
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).