All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes
@ 2023-01-26  7:14 Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 01/11] net: add missing includes of linux/net.h Jakub Kicinski
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

skbuff.h is included in a significant portion of the tree.
Clean up unused dependencies to speed up builds.

This set only takes care of the most obvious cases.

Jakub Kicinski (11):
  net: add missing includes of linux/net.h
  net: skbuff: drop the linux/net.h include
  net: checksum: drop the linux/uaccess.h include
  net: skbuff: drop the linux/textsearch.h include
  net: add missing includes of linux/sched/clock.h
  net: skbuff: drop the linux/sched/clock.h include
  net: skbuff: drop the linux/sched.h include
  net: add missing includes of linux/splice.h
  net: skbuff: drop the linux/splice.h include
  net: skbuff: drop the linux/hrtimer.h include
  net: remove unnecessary includes from net/flow.h

 arch/arm/include/asm/checksum.h                            | 1 +
 arch/x86/include/asm/checksum_64.h                         | 1 -
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c     | 2 ++
 drivers/net/wireless/intersil/orinoco/hermes.c             | 1 +
 drivers/scsi/lpfc/lpfc_init.c                              | 1 +
 include/linux/filter.h                                     | 1 +
 include/linux/igmp.h                                       | 1 +
 include/linux/skbuff.h                                     | 7 +------
 include/net/checksum.h                                     | 4 +++-
 include/net/flow.h                                         | 5 +++--
 net/core/skbuff.c                                          | 1 +
 net/rds/ib_recv.c                                          | 1 +
 net/rds/recv.c                                             | 1 +
 net/smc/af_smc.c                                           | 1 +
 net/smc/smc_rx.c                                           | 1 +
 net/unix/af_unix.c                                         | 1 +
 17 files changed, 21 insertions(+), 10 deletions(-)

-- 
2.39.1


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

* [PATCH net-next 01/11] net: add missing includes of linux/net.h
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 02/11] net: skbuff: drop the linux/net.h include Jakub Kicinski
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, kvalo, martin.lau, ast,
	linux-wireless

linux/net.h will soon not be included by linux/skbuff.h.
Fix the cases where source files were depending on the implicit
include.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: kvalo@kernel.org
CC: martin.lau@kernel.org
CC: ast@kernel.org
CC: linux-wireless@vger.kernel.org
---
 drivers/net/wireless/intersil/orinoco/hermes.c | 1 +
 include/linux/igmp.h                           | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/wireless/intersil/orinoco/hermes.c b/drivers/net/wireless/intersil/orinoco/hermes.c
index 256946552742..4888286727ff 100644
--- a/drivers/net/wireless/intersil/orinoco/hermes.c
+++ b/drivers/net/wireless/intersil/orinoco/hermes.c
@@ -38,6 +38,7 @@
  * under either the MPL or the GPL.
  */
 
+#include <linux/net.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 78890143f079..b19d3284551f 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -15,6 +15,7 @@
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/refcount.h>
+#include <linux/sockptr.h>
 #include <uapi/linux/igmp.h>
 
 static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb)
-- 
2.39.1


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

* [PATCH net-next 02/11] net: skbuff: drop the linux/net.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 01/11] net: add missing includes of linux/net.h Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 03/11] net: checksum: drop the linux/uaccess.h include Jakub Kicinski
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

It appears nothing needs it. The kernel builds fine with this
include removed, building an otherwise empty source file with:

 #include <linux/skbuff.h>
 #ifdef _LINUX_NET_H
 #error linux/net.h is back
 #endif

works too (meaning net.h is not just pulled in indirectly).

This gives us a slight 0.5% reduction in the pre-processed size
of skbuff.h.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4c8492401a10..b93818e11da0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -23,7 +23,6 @@
 #include <linux/atomic.h>
 #include <asm/types.h>
 #include <linux/spinlock.h>
-#include <linux/net.h>
 #include <linux/textsearch.h>
 #include <net/checksum.h>
 #include <linux/rcupdate.h>
-- 
2.39.1


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

* [PATCH net-next 03/11] net: checksum: drop the linux/uaccess.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 01/11] net: add missing includes of linux/net.h Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 02/11] net: skbuff: drop the linux/net.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 04/11] net: skbuff: drop the linux/textsearch.h include Jakub Kicinski
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, linux, tglx, mingo, bp,
	dave.hansen, x86, hpa

net/checksum.h pulls in linux/uaccess.h which is large.

In the x86 header the include seems to not be needed at all.
ARM on the other hand does not include uaccess.h, even tho
it calls access_ok().

In the generic implementation guard the include of linux/uaccess.h
with the same condition as the code that needs it.

With this change pre-processed net/checksum.h shrinks on x86
from 30616 lines to just 1193.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: linux@armlinux.org.uk
CC: tglx@linutronix.de
CC: mingo@redhat.com
CC: bp@alien8.de
CC: dave.hansen@linux.intel.com
CC: x86@kernel.org
CC: hpa@zytor.com
---
 arch/arm/include/asm/checksum.h    | 1 +
 arch/x86/include/asm/checksum_64.h | 1 -
 include/net/checksum.h             | 4 +++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/checksum.h b/arch/arm/include/asm/checksum.h
index f0f54aef3724..d8a13959bff0 100644
--- a/arch/arm/include/asm/checksum.h
+++ b/arch/arm/include/asm/checksum.h
@@ -11,6 +11,7 @@
 #define __ASM_ARM_CHECKSUM_H
 
 #include <linux/in6.h>
+#include <linux/uaccess.h>
 
 /*
  * computes the checksum of a memory block at buff, length len,
diff --git a/arch/x86/include/asm/checksum_64.h b/arch/x86/include/asm/checksum_64.h
index 407beebadaf4..4d4a47a3a8ab 100644
--- a/arch/x86/include/asm/checksum_64.h
+++ b/arch/x86/include/asm/checksum_64.h
@@ -9,7 +9,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/uaccess.h>
 #include <asm/byteorder.h>
 
 /**
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 6bc783b7a06c..1338cb92c8e7 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -18,8 +18,10 @@
 #include <linux/errno.h>
 #include <asm/types.h>
 #include <asm/byteorder.h>
-#include <linux/uaccess.h>
 #include <asm/checksum.h>
+#if !defined(_HAVE_ARCH_COPY_AND_CSUM_FROM_USER) || !defined(HAVE_CSUM_COPY_USER)
+#include <linux/uaccess.h>
+#endif
 
 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
 static __always_inline
-- 
2.39.1


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

* [PATCH net-next 04/11] net: skbuff: drop the linux/textsearch.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (2 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 03/11] net: checksum: drop the linux/uaccess.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 05/11] net: add missing includes of linux/sched/clock.h Jakub Kicinski
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

This include was added for skb_find_text() but all we need there
is a forward declaration of struct ts_config.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 2 +-
 net/core/skbuff.c      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b93818e11da0..7eeb06f9ca1f 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -23,7 +23,6 @@
 #include <linux/atomic.h>
 #include <asm/types.h>
 #include <linux/spinlock.h>
-#include <linux/textsearch.h>
 #include <net/checksum.h>
 #include <linux/rcupdate.h>
 #include <linux/hrtimer.h>
@@ -279,6 +278,7 @@ struct napi_struct;
 struct bpf_prog;
 union bpf_attr;
 struct skb_ext;
+struct ts_config;
 
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 struct nf_bridge_info {
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 180df58e85c7..bb79b4cb89db 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -79,6 +79,7 @@
 #include <linux/capability.h>
 #include <linux/user_namespace.h>
 #include <linux/indirect_call_wrapper.h>
+#include <linux/textsearch.h>
 
 #include "dev.h"
 #include "sock_destructor.h"
-- 
2.39.1


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

* [PATCH net-next 05/11] net: add missing includes of linux/sched/clock.h
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (3 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 04/11] net: skbuff: drop the linux/textsearch.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 06/11] net: skbuff: drop the linux/sched/clock.h include Jakub Kicinski
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, yisen.zhuang,
	salil.mehta, james.smart, dick.kennedy, jejb, martin.petersen,
	ast, daniel, john.fastabend, andrii, martin.lau, song, yhs,
	kpsingh, sdf, haoluo, jolsa, santosh.shilimkar, huangguangbin2,
	lipeng321, linux-scsi, bpf, linux-rdma

Number of files depend on linux/sched/clock.h getting included
by linux/skbuff.h which soon will no longer be the case.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: yisen.zhuang@huawei.com
CC: salil.mehta@huawei.com
CC: james.smart@broadcom.com
CC: dick.kennedy@broadcom.com
CC: jejb@linux.ibm.com
CC: martin.petersen@oracle.com
CC: ast@kernel.org
CC: daniel@iogearbox.net
CC: john.fastabend@gmail.com
CC: andrii@kernel.org
CC: martin.lau@linux.dev
CC: song@kernel.org
CC: yhs@fb.com
CC: kpsingh@kernel.org
CC: sdf@google.com
CC: haoluo@google.com
CC: jolsa@kernel.org
CC: santosh.shilimkar@oracle.com
CC: huangguangbin2@huawei.com
CC: lipeng321@huawei.com
CC: linux-scsi@vger.kernel.org
CC: bpf@vger.kernel.org
CC: linux-rdma@vger.kernel.org
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c     | 2 ++
 drivers/scsi/lpfc/lpfc_init.c                              | 1 +
 include/linux/filter.h                                     | 1 +
 net/rds/ib_recv.c                                          | 1 +
 net/rds/recv.c                                             | 1 +
 6 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 142415c84c6b..a0b46e7d863e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -2,6 +2,7 @@
 /* Copyright (c) 2018-2019 Hisilicon Limited. */
 
 #include <linux/device.h>
+#include <linux/sched/clock.h>
 
 #include "hclge_debugfs.h"
 #include "hclge_err.h"
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
index 6efd768cc07c..3f35227ef1fa 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0+
 /* Copyright (c) 2016-2017 Hisilicon Limited. */
 
+#include <linux/sched/clock.h>
+
 #include "hclge_err.h"
 
 static const struct hclge_hw_error hclge_imp_tcm_ecc_int[] = {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 25ba20e42825..389a35308be3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -30,6 +30,7 @@
 #include <linux/kthread.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
+#include <linux/sched/clock.h>
 #include <linux/ctype.h>
 #include <linux/aer.h>
 #include <linux/slab.h>
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ccc4a4a58c72..1727898f1641 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -14,6 +14,7 @@
 #include <linux/printk.h>
 #include <linux/workqueue.h>
 #include <linux/sched.h>
+#include <linux/sched/clock.h>
 #include <linux/capability.h>
 #include <linux/set_memory.h>
 #include <linux/kallsyms.h>
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index cfbf0e129cba..e53b7f266bd7 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -31,6 +31,7 @@
  *
  */
 #include <linux/kernel.h>
+#include <linux/sched/clock.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
diff --git a/net/rds/recv.c b/net/rds/recv.c
index 5b426dc3634d..c71b923764fd 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -35,6 +35,7 @@
 #include <net/sock.h>
 #include <linux/in.h>
 #include <linux/export.h>
+#include <linux/sched/clock.h>
 #include <linux/time.h>
 #include <linux/rds.h>
 
-- 
2.39.1


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

* [PATCH net-next 06/11] net: skbuff: drop the linux/sched/clock.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (4 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 05/11] net: add missing includes of linux/sched/clock.h Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 07/11] net: skbuff: drop the linux/sched.h include Jakub Kicinski
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

It used to be necessary for skb_mstamp_* static inlines,
but those are gone since we moved to usec timestamps in
TCP, in 2017.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7eeb06f9ca1f..aa920591ba37 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,7 +29,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/netdev_features.h>
 #include <linux/sched.h>
-#include <linux/sched/clock.h>
 #include <net/flow_dissector.h>
 #include <linux/splice.h>
 #include <linux/in6.h>
-- 
2.39.1


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

* [PATCH net-next 07/11] net: skbuff: drop the linux/sched.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (5 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 06/11] net: skbuff: drop the linux/sched/clock.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 08/11] net: add missing includes of linux/splice.h Jakub Kicinski
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

linux/sched.h was added for skb_mstamp_* (all the way back
before linux/sched.h got split and linux/sched/clock.h created).
We don't need it in skbuff.h any more.

Sadly this change is currently a noop because linux/dma-mapping.h
and net/page_pool.h pull in half of the universe.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index aa920591ba37..a1978adc5644 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -28,7 +28,6 @@
 #include <linux/hrtimer.h>
 #include <linux/dma-mapping.h>
 #include <linux/netdev_features.h>
-#include <linux/sched.h>
 #include <net/flow_dissector.h>
 #include <linux/splice.h>
 #include <linux/in6.h>
-- 
2.39.1


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

* [PATCH net-next 08/11] net: add missing includes of linux/splice.h
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (6 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 07/11] net: skbuff: drop the linux/sched.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-27 12:35   ` Wenjia Zhang
  2023-01-26  7:14 ` [PATCH net-next 09/11] net: skbuff: drop the linux/splice.h include Jakub Kicinski
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, kgraul, wenjia, jaka,
	kuniyu, linux-s390

Number of files depend on linux/splice.h getting included
by linux/skbuff.h which soon will no longer be the case.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: kgraul@linux.ibm.com
CC: wenjia@linux.ibm.com
CC: jaka@linux.ibm.com
CC: kuniyu@amazon.com
CC: linux-s390@vger.kernel.org
---
 net/smc/af_smc.c   | 1 +
 net/smc/smc_rx.c   | 1 +
 net/unix/af_unix.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 036532cf39aa..1c0fe9ba5358 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -27,6 +27,7 @@
 #include <linux/if_vlan.h>
 #include <linux/rcupdate_wait.h>
 #include <linux/ctype.h>
+#include <linux/splice.h>
 
 #include <net/sock.h>
 #include <net/tcp.h>
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
index 0a6e615f000c..4380d32f5a5f 100644
--- a/net/smc/smc_rx.c
+++ b/net/smc/smc_rx.c
@@ -13,6 +13,7 @@
 #include <linux/net.h>
 #include <linux/rcupdate.h>
 #include <linux/sched/signal.h>
+#include <linux/splice.h>
 
 #include <net/sock.h>
 #include <trace/events/sock.h>
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 009616fa0256..0be25e712c28 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -112,6 +112,7 @@
 #include <linux/mount.h>
 #include <net/checksum.h>
 #include <linux/security.h>
+#include <linux/splice.h>
 #include <linux/freezer.h>
 #include <linux/file.h>
 #include <linux/btf_ids.h>
-- 
2.39.1


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

* [PATCH net-next 09/11] net: skbuff: drop the linux/splice.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (7 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 08/11] net: add missing includes of linux/splice.h Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 10/11] net: skbuff: drop the linux/hrtimer.h include Jakub Kicinski
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

splice.h is included since commit a60e3cc7c929 ("net: make
skb_splice_bits more configureable") but really even then
all we needed is some forward declarations. Most of that
code is now gone, and remaining has fwd declarations.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a1978adc5644..c6fd5d5b50e0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,7 +29,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/netdev_features.h>
 #include <net/flow_dissector.h>
-#include <linux/splice.h>
 #include <linux/in6.h>
 #include <linux/if_packet.h>
 #include <linux/llist.h>
-- 
2.39.1


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

* [PATCH net-next 10/11] net: skbuff: drop the linux/hrtimer.h include
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (8 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 09/11] net: skbuff: drop the linux/splice.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-26  7:14 ` [PATCH net-next 11/11] net: remove unnecessary includes from net/flow.h Jakub Kicinski
  2023-01-27 12:10 ` [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes patchwork-bot+netdevbpf
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski, imagedong

linux/hrtimer.h include was added because apparently it used
to contain ktime related code. This is no longer the case
and we include linux/time.h explicitly.

Sadly this change is currently a noop because linux/dma-mapping.h
and net/page_pool.h pull in half of the universe.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: imagedong@tencent.com
---
 include/linux/skbuff.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c6fd5d5b50e0..5ba12185f43e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -25,7 +25,6 @@
 #include <linux/spinlock.h>
 #include <net/checksum.h>
 #include <linux/rcupdate.h>
-#include <linux/hrtimer.h>
 #include <linux/dma-mapping.h>
 #include <linux/netdev_features.h>
 #include <net/flow_dissector.h>
-- 
2.39.1


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

* [PATCH net-next 11/11] net: remove unnecessary includes from net/flow.h
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (9 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 10/11] net: skbuff: drop the linux/hrtimer.h include Jakub Kicinski
@ 2023-01-26  7:14 ` Jakub Kicinski
  2023-01-27 12:10 ` [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes patchwork-bot+netdevbpf
  11 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2023-01-26  7:14 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

This file is included by a lot of other commonly included
headers, it doesn't need socket.h or flow_dissector.h.

This reduces the size of this file after pre-processing
from 28165 to 4663.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
---
 include/net/flow.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/net/flow.h b/include/net/flow.h
index 2f0da4f0318b..bb8651a6eaa7 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -8,12 +8,13 @@
 #ifndef _NET_FLOW_H
 #define _NET_FLOW_H
 
-#include <linux/socket.h>
 #include <linux/in6.h>
 #include <linux/atomic.h>
-#include <net/flow_dissector.h>
+#include <linux/container_of.h>
 #include <linux/uidgid.h>
 
+struct flow_keys;
+
 /*
  * ifindex generation is per-net namespace, and loopback is
  * always the 1st device in ns (see net_dev_init), thus any
-- 
2.39.1


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

* Re: [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes
  2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
                   ` (10 preceding siblings ...)
  2023-01-26  7:14 ` [PATCH net-next 11/11] net: remove unnecessary includes from net/flow.h Jakub Kicinski
@ 2023-01-27 12:10 ` patchwork-bot+netdevbpf
  11 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-27 12:10 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni

Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 25 Jan 2023 23:14:13 -0800 you wrote:
> skbuff.h is included in a significant portion of the tree.
> Clean up unused dependencies to speed up builds.
> 
> This set only takes care of the most obvious cases.
> 
> Jakub Kicinski (11):
>   net: add missing includes of linux/net.h
>   net: skbuff: drop the linux/net.h include
>   net: checksum: drop the linux/uaccess.h include
>   net: skbuff: drop the linux/textsearch.h include
>   net: add missing includes of linux/sched/clock.h
>   net: skbuff: drop the linux/sched/clock.h include
>   net: skbuff: drop the linux/sched.h include
>   net: add missing includes of linux/splice.h
>   net: skbuff: drop the linux/splice.h include
>   net: skbuff: drop the linux/hrtimer.h include
>   net: remove unnecessary includes from net/flow.h
> 
> [...]

Here is the summary with links:
  - [net-next,01/11] net: add missing includes of linux/net.h
    https://git.kernel.org/netdev/net-next/c/ac62f60619fa
  - [net-next,02/11] net: skbuff: drop the linux/net.h include
    https://git.kernel.org/netdev/net-next/c/9a859da28787
  - [net-next,03/11] net: checksum: drop the linux/uaccess.h include
    https://git.kernel.org/netdev/net-next/c/68f4eae781dd
  - [net-next,04/11] net: skbuff: drop the linux/textsearch.h include
    https://git.kernel.org/netdev/net-next/c/2195e2a024ae
  - [net-next,05/11] net: add missing includes of linux/sched/clock.h
    https://git.kernel.org/netdev/net-next/c/2870c4d6a5e4
  - [net-next,06/11] net: skbuff: drop the linux/sched/clock.h include
    https://git.kernel.org/netdev/net-next/c/9ac849f2c492
  - [net-next,07/11] net: skbuff: drop the linux/sched.h include
    https://git.kernel.org/netdev/net-next/c/422164224e32
  - [net-next,08/11] net: add missing includes of linux/splice.h
    https://git.kernel.org/netdev/net-next/c/509f15b9c551
  - [net-next,09/11] net: skbuff: drop the linux/splice.h include
    https://git.kernel.org/netdev/net-next/c/5255c0ca7983
  - [net-next,10/11] net: skbuff: drop the linux/hrtimer.h include
    https://git.kernel.org/netdev/net-next/c/9dd0db2b1303
  - [net-next,11/11] net: remove unnecessary includes from net/flow.h
    https://git.kernel.org/netdev/net-next/c/21bf73158fe7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net-next 08/11] net: add missing includes of linux/splice.h
  2023-01-26  7:14 ` [PATCH net-next 08/11] net: add missing includes of linux/splice.h Jakub Kicinski
@ 2023-01-27 12:35   ` Wenjia Zhang
  0 siblings, 0 replies; 14+ messages in thread
From: Wenjia Zhang @ 2023-01-27 12:35 UTC (permalink / raw)
  To: Jakub Kicinski, davem
  Cc: netdev, edumazet, pabeni, kgraul, jaka, kuniyu, linux-s390



On 26.01.23 08:14, Jakub Kicinski wrote:
> Number of files depend on linux/splice.h getting included
> by linux/skbuff.h which soon will no longer be the case.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: kgraul@linux.ibm.com
> CC: wenjia@linux.ibm.com
> CC: jaka@linux.ibm.com
> CC: kuniyu@amazon.com
> CC: linux-s390@vger.kernel.org
> ---
>   net/smc/af_smc.c   | 1 +
>   net/smc/smc_rx.c   | 1 +
>   net/unix/af_unix.c | 1 +
>   3 files changed, 3 insertions(+)
> 
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index 036532cf39aa..1c0fe9ba5358 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -27,6 +27,7 @@
>   #include <linux/if_vlan.h>
>   #include <linux/rcupdate_wait.h>
>   #include <linux/ctype.h>
> +#include <linux/splice.h>
>   
>   #include <net/sock.h>
>   #include <net/tcp.h>
> diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
> index 0a6e615f000c..4380d32f5a5f 100644
> --- a/net/smc/smc_rx.c
> +++ b/net/smc/smc_rx.c
> @@ -13,6 +13,7 @@
>   #include <linux/net.h>
>   #include <linux/rcupdate.h>
>   #include <linux/sched/signal.h>
> +#include <linux/splice.h>
>   

Thank you, Jakub!
Acked-by: Wenjia Zhang <wenjia@linux.ibm.com>

>   #include <net/sock.h>
>   #include <trace/events/sock.h>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 009616fa0256..0be25e712c28 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -112,6 +112,7 @@
>   #include <linux/mount.h>
>   #include <net/checksum.h>
>   #include <linux/security.h>
> +#include <linux/splice.h>
>   #include <linux/freezer.h>
>   #include <linux/file.h>
>   #include <linux/btf_ids.h>



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

end of thread, other threads:[~2023-01-27 12:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26  7:14 [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 01/11] net: add missing includes of linux/net.h Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 02/11] net: skbuff: drop the linux/net.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 03/11] net: checksum: drop the linux/uaccess.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 04/11] net: skbuff: drop the linux/textsearch.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 05/11] net: add missing includes of linux/sched/clock.h Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 06/11] net: skbuff: drop the linux/sched/clock.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 07/11] net: skbuff: drop the linux/sched.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 08/11] net: add missing includes of linux/splice.h Jakub Kicinski
2023-01-27 12:35   ` Wenjia Zhang
2023-01-26  7:14 ` [PATCH net-next 09/11] net: skbuff: drop the linux/splice.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 10/11] net: skbuff: drop the linux/hrtimer.h include Jakub Kicinski
2023-01-26  7:14 ` [PATCH net-next 11/11] net: remove unnecessary includes from net/flow.h Jakub Kicinski
2023-01-27 12:10 ` [PATCH net-next 00/11] net: skbuff: clean up unnecessary includes patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.