net: don't include filter.h from net/sock.h
Subsystems (45)
Jakub Kicinski
maintainerPATCH 1/1 net: don't include filter.h from net/sock.h
sock.h is pretty heavily used (5k objects rebuilt on x86 after it's touched). We can drop the include of filter.h from it and add a forward declaration of struct sk_filter instead. This decreases the number of rebuilt objects when bpf.h is touched from ~5k to ~1k.
There's a lot of missing includes this was masking. Primarily in networking tho, this time.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- drivers/bluetooth/btqca.c | 1 + drivers/infiniband/core/cache.c | 1 + drivers/infiniband/hw/irdma/ctrl.c | 2 ++ drivers/infiniband/hw/irdma/uda.c | 2 ++ drivers/infiniband/hw/mlx5/doorbell.c | 1 + drivers/infiniband/hw/mlx5/qp.c | 1 + drivers/net/amt.c | 1 + drivers/net/appletalk/ipddp.c | 1 + drivers/net/can/usb/peak_usb/pcan_usb.c | 1 + drivers/net/dsa/microchip/ksz8795.c | 1 + drivers/net/dsa/xrs700x/xrs700x.c | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 1 + drivers/net/ethernet/huawei/hinic/hinic_tx.c | 1 + drivers/net/ethernet/intel/ice/ice_devlink.c | 2 ++ drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 2 ++ drivers/net/ethernet/intel/igc/igc_xdp.c | 1 + drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 1 + drivers/net/ethernet/sfc/efx.c | 1 + drivers/net/ethernet/sfc/efx_channels.c | 1 + drivers/net/ethernet/sfc/efx_common.c | 1 + drivers/net/hamradio/hdlcdrv.c | 1 + drivers/net/hamradio/scc.c | 1 + drivers/net/loopback.c | 1 + drivers/net/vrf.c | 1 + drivers/net/wireless/ath/ath11k/debugfs.c | 2 ++ drivers/net/wireless/realtek/rtw89/debug.c | 2 ++ fs/nfs/dir.c | 1 + fs/nfs/fs_context.c | 1 + fs/select.c | 1 + include/linux/bpf_local_storage.h | 1 + include/linux/dsa/loop.h | 1 + include/net/ipv6.h | 2 ++ include/net/route.h | 1 + include/net/sock.h | 2 +- include/net/xdp_sock.h | 1 + kernel/sysctl.c | 1 + net/bluetooth/bnep/sock.c | 1 + net/bluetooth/eir.h | 2 ++ net/bluetooth/hidp/sock.c | 1 + net/bluetooth/l2cap_sock.c | 1 + net/bridge/br_ioctl.c | 1 + net/caif/caif_socket.c | 1 + net/core/devlink.c | 1 + net/core/flow_dissector.c | 1 + net/core/lwt_bpf.c | 1 + net/core/sock_diag.c | 1 + net/core/sysctl_net_core.c | 1 + net/decnet/dn_nsp_in.c | 1 + net/dsa/dsa_priv.h | 1 + net/ethtool/ioctl.c | 1 + net/ipv4/nexthop.c | 1 + net/ipv6/seg6_local.c | 1 + net/iucv/af_iucv.c | 1 + net/kcm/kcmsock.c | 1 + net/netfilter/nfnetlink_hook.c | 1 + net/netfilter/nft_reject_netdev.c | 1 + net/netlink/af_netlink.c | 2 ++ net/packet/af_packet.c | 1 + net/rose/rose_in.c | 1 + net/sched/sch_frag.c | 1 + net/smc/smc_ib.c | 2 ++ net/smc/smc_ism.c | 1 + net/unix/af_unix.c | 1 + net/vmw_vsock/af_vsock.c | 1 + net/xdp/xskmap.c | 1 + net/xfrm/xfrm_state.c | 1 + net/xfrm/xfrm_user.c | 1 + 68 files changed, 78 insertions(+), 1 deletion(-)
drivers/bluetooth/btqca.c +1 -0
@@ -6,6 +6,7 @@*/ #include <linux/module.h> #include <linux/firmware.h> +#include <linux/vmalloc.h> #include <net/bluetooth/bluetooth.h> #include <net/bluetooth/hci_core.h>
drivers/infiniband/core/cache.c +1 -0
@@ -33,6 +33,7 @@* SOFTWARE. */ +#include <linux/if_vlan.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/slab.h>
drivers/infiniband/hw/irdma/ctrl.c +2 -0
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB /* Copyright (c) 2015 - 2021 Intel Corporation */ +#include <linux/etherdevice.h> +#include "osdep.h" #include "status.h" #include "hmc.h"
drivers/infiniband/hw/irdma/uda.c +2 -0
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB /* Copyright (c) 2016 - 2021 Intel Corporation */ +#include <linux/etherdevice.h> +#include "osdep.h" #include "status.h" #include "hmc.h"
drivers/infiniband/hw/mlx5/doorbell.c +1 -0
@@ -32,6 +32,7 @@#include <linux/kref.h> #include <linux/slab.h> +#include <linux/sched/mm.h> #include <rdma/ib_umem.h> #include "mlx5_ib.h"
drivers/infiniband/hw/mlx5/qp.c +1 -0
@@ -30,6 +30,7 @@* SOFTWARE. */ +#include <linux/etherdevice.h> #include <linux/module.h> #include <rdma/ib_umem.h> #include <rdma/ib_cache.h>
drivers/net/amt.c +1 -0
@@ -11,6 +11,7 @@#include <linux/net.h> #include <linux/igmp.h> #include <linux/workqueue.h> +#include <net/sch_generic.h> #include <net/net_namespace.h> #include <net/ip.h> #include <net/udp.h>
drivers/net/appletalk/ipddp.c +1 -0
@@ -23,6 +23,7 @@* of the GNU General Public License, incorporated herein by reference. */ +#include <linux/compat.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h>
drivers/net/can/usb/peak_usb/pcan_usb.c +1 -0
@@ -8,6 +8,7 @@* * Many thanks to Klaus Hitschler <[email protected]> */ +#include <asm/unaligned.h> #include <linux/netdevice.h> #include <linux/usb.h> #include <linux/module.h>
drivers/net/dsa/microchip/ksz8795.c +1 -0
@@ -10,6 +10,7 @@#include <linux/delay.h> #include <linux/export.h> #include <linux/gpio.h> +#include <linux/if_vlan.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_data/microchip-ksz.h>
drivers/net/dsa/xrs700x/xrs700x.c +1 -0
@@ -5,6 +5,7 @@*/ #include <net/dsa.h> +#include <linux/etherdevice.h> #include <linux/if_bridge.h> #include <linux/of_device.h> #include <linux/netdev_features.h>
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +1 -0
@@ -9,6 +9,7 @@#include <linux/pci.h> #include <linux/netdevice.h> +#include <linux/vmalloc.h> #include <net/devlink.h> #include "bnxt_hsi.h" #include "bnxt.h"
drivers/net/ethernet/huawei/hinic/hinic_tx.c +1 -0
@@ -4,6 +4,7 @@* Copyright(c) 2017 Huawei Technologies Co., Ltd */ +#include <linux/if_vlan.h> #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/u64_stats_sync.h>
drivers/net/ethernet/intel/ice/ice_devlink.c +2 -0
@@ -1,6 +1,8 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020, Intel Corporation. */ +#include <linux/vmalloc.h> +#include "ice.h" #include "ice_lib.h" #include "ice_devlink.h"
drivers/net/ethernet/intel/ice/ice_txrx_lib.c +2 -0
@@ -1,6 +1,8 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2019, Intel Corporation. */ +#include <linux/filter.h> +#include "ice_txrx_lib.h" #include "ice_eswitch.h" #include "ice_lib.h"
drivers/net/ethernet/intel/igc/igc_xdp.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020, Intel Corporation. */ +#include <linux/if_vlan.h> #include <net/xdp_sock_drv.h> #include "igc.h"
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 -0
@@ -33,6 +33,7 @@#include <linux/bpf.h> #include <linux/etherdevice.h> +#include <linux/filter.h> #include <linux/tcp.h> #include <linux/if_vlan.h> #include <linux/delay.h>
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */ +#include <net/sch_generic.h> #include "en.h" #include "params.h"
drivers/net/ethernet/sfc/efx.c +1 -0
@@ -5,6 +5,7 @@* Copyright 2005-2013 Solarflare Communications Inc. */ +#include <linux/filter.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/netdevice.h>
drivers/net/ethernet/sfc/efx_channels.c +1 -0
@@ -10,6 +10,7 @@#include "net_driver.h" #include <linux/module.h> +#include <linux/filter.h> #include "efx_channels.h" #include "efx.h" #include "efx_common.h"
drivers/net/ethernet/sfc/efx_common.c +1 -0
@@ -9,6 +9,7 @@*/ #include "net_driver.h" +#include <linux/filter.h> #include <linux/module.h> #include <linux/netdevice.h> #include <net/gre.h>
drivers/net/hamradio/hdlcdrv.c +1 -0
@@ -30,6 +30,7 @@/*****************************************************************************/ #include <linux/capability.h> +#include <linux/compat.h> #include <linux/module.h> #include <linux/types.h> #include <linux/net.h>
drivers/net/hamradio/scc.c +1 -0
@@ -148,6 +148,7 @@/* ----------------------------------------------------------------------- */ +#include <linux/compat.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/signal.h>
drivers/net/loopback.c +1 -0
@@ -44,6 +44,7 @@#include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/ethtool.h> +#include <net/sch_generic.h> #include <net/sock.h> #include <net/checksum.h> #include <linux/if_ether.h> /* For the statistics structure. */
drivers/net/vrf.c +1 -0
@@ -34,6 +34,7 @@#include <net/addrconf.h> #include <net/l3mdev.h> #include <net/fib_rules.h> +#include <net/sch_generic.h> #include <net/netns/generic.h> #include <net/netfilter/nf_conntrack.h>
drivers/net/wireless/ath/ath11k/debugfs.c +2 -0
@@ -3,6 +3,8 @@* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. */ +#include <linux/vmalloc.h> +#include "debugfs.h" #include "core.h"
drivers/net/wireless/realtek/rtw89/debug.c +2 -0
@@ -2,6 +2,8 @@/* Copyright(c) 2019-2020 Realtek Corporation */ +#include <linux/vmalloc.h> +#include "coex.h" #include "debug.h" #include "fw.h"
fs/nfs/dir.c +1 -0
@@ -18,6 +18,7 @@* 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM */ +#include <linux/compat.h> #include <linux/module.h> #include <linux/time.h> #include <linux/errno.h>
fs/nfs/fs_context.c +1 -0
@@ -10,6 +10,7 @@* Split from fs/nfs/super.c by David Howells <[email protected]> */ +#include <linux/compat.h> #include <linux/module.h> #include <linux/fs.h> #include <linux/fs_context.h>
fs/select.c +1 -0
@@ -15,6 +15,7 @@* of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian). */ +#include <linux/compat.h> #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/sched/rt.h>
include/linux/bpf_local_storage.h +1 -0
@@ -8,6 +8,7 @@#define _BPF_LOCAL_STORAGE_H#include <linux/bpf.h> +#include <linux/filter.h> #include <linux/rculist.h> #include <linux/list.h> #include <linux/hash.h>
include/linux/dsa/loop.h +1 -0
@@ -2,6 +2,7 @@#ifndef DSA_LOOP_H #define DSA_LOOP_H +#include <linux/if_vlan.h> #include <linux/types.h> #include <linux/ethtool.h> #include <net/dsa.h>
include/net/ipv6.h +2 -0
@@ -21,6 +21,8 @@#include <net/snmp.h> #include <net/netns/hash.h> +struct ip_tunnel_info ; +#define SIN6_LEN_RFC2133 24#define IPV6_MAXPLEN 65535
include/net/route.h +1 -0
@@ -43,6 +43,7 @@#define RT_CONN_FLAGS (sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE))#define RT_CONN_FLAGS_TOS (sk,tos) (RT_TOS(tos) | sock_flag(sk, SOCK_LOCALROUTE)) +struct ip_tunnel_info ;struct fib_nh ;struct fib_info ;struct uncached_list ;
include/net/sock.h +1 -1
@@ -56,7 +56,6 @@#include <linux/wait.h> #include <linux/cgroup-defs.h> #include <linux/rbtree.h> -#include <linux/filter.h> #include <linux/rculist_nulls.h> #include <linux/poll.h> #include <linux/sockptr.h>
@@ -249,6 +248,7 @@ struct sock_common { };struct bpf_local_storage ; +struct sk_filter ;/** * struct sock - network layer representation of sockets
include/net/xdp_sock.h +1 -0
@@ -6,6 +6,7 @@#ifndef _LINUX_XDP_SOCK_H#define _LINUX_XDP_SOCK_H +#include <linux/bpf.h> #include <linux/workqueue.h> #include <linux/if_xdp.h> #include <linux/mutex.h>
kernel/sysctl.c +1 -0
@@ -33,6 +33,7 @@#include <linux/security.h> #include <linux/ctype.h> #include <linux/kmemleak.h> +#include <linux/filter.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kernel.h>
net/bluetooth/bnep/sock.c +1 -0
@@ -24,6 +24,7 @@SOFTWARE IS DISCLAIMED. */ +#include <linux/compat.h> #include <linux/export.h> #include <linux/file.h>
net/bluetooth/eir.h +2 -0
@@ -5,6 +5,8 @@* Copyright (C) 2021 Intel Corporation */ +#include <asm/unaligned.h> +void eir_create (struct hci_dev *hdev,u8 *data);u8 eir_create_adv_data (struct hci_dev *hdev,u8 instance,u8 *ptr);
net/bluetooth/hidp/sock.c +1 -0
@@ -20,6 +20,7 @@SOFTWARE IS DISCLAIMED. */ +#include <linux/compat.h> #include <linux/export.h> #include <linux/file.h>
net/bluetooth/l2cap_sock.c +1 -0
@@ -29,6 +29,7 @@#include <linux/module.h> #include <linux/export.h> +#include <linux/filter.h> #include <linux/sched/signal.h> #include <net/bluetooth/bluetooth.h>
net/bridge/br_ioctl.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/capability.h> +#include <linux/compat.h> #include <linux/kernel.h> #include <linux/if_bridge.h> #include <linux/netdevice.h>
net/caif/caif_socket.c +1 -0
@@ -6,6 +6,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ":%s(): " fmt, __func__ +#include <linux/filter.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/module.h>
net/core/devlink.c +1 -0
@@ -7,6 +7,7 @@* Copyright (c) 2016 Jiri Pirko <[email protected]> */ +#include <linux/etherdevice.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/types.h>
net/core/flow_dissector.c +1 -0
@@ -5,6 +5,7 @@#include <linux/ip.h> #include <linux/ipv6.h> #include <linux/if_vlan.h> +#include <linux/filter.h> #include <net/dsa.h> #include <net/dst_metadata.h> #include <net/ip.h>
net/core/lwt_bpf.c +1 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2016 Thomas Graf <[email protected]> */ +#include <linux/filter.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/skbuff.h>
net/core/sock_diag.c +1 -0
@@ -1,5 +1,6 @@/* License: GPL */ +#include <linux/filter.h> #include <linux/mutex.h> #include <linux/socket.h> #include <linux/skbuff.h>
net/core/sysctl_net_core.c +1 -0
@@ -6,6 +6,7 @@* Added /proc/sys/net/core directory entry (empty =) ). [MS] */ +#include <linux/filter.h> #include <linux/mm.h> #include <linux/sysctl.h> #include <linux/module.h>
net/decnet/dn_nsp_in.c +1 -0
@@ -38,6 +38,7 @@*******************************************************************************/ #include <linux/errno.h> +#include <linux/filter.h> #include <linux/types.h> #include <linux/socket.h> #include <linux/in.h>
net/dsa/dsa_priv.h +1 -0
@@ -8,6 +8,7 @@#define __DSA_PRIV_H#include <linux/if_bridge.h> +#include <linux/if_vlan.h> #include <linux/phy.h> #include <linux/netdevice.h> #include <linux/netpoll.h>
net/ethtool/ioctl.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/compat.h> +#include <linux/etherdevice.h> #include <linux/module.h> #include <linux/types.h> #include <linux/capability.h>
net/ipv4/nexthop.c +1 -0
@@ -8,6 +8,7 @@#include <linux/nexthop.h> #include <linux/rtnetlink.h> #include <linux/slab.h> +#include <linux/vmalloc.h> #include <net/arp.h> #include <net/ipv6_stubs.h> #include <net/lwtunnel.h>
net/ipv6/seg6_local.c +1 -0
@@ -7,6 +7,7 @@* eBPF support: Mathieu Xhonneux <[email protected]> */ +#include <linux/filter.h> #include <linux/types.h> #include <linux/skbuff.h> #include <linux/net.h>
net/iucv/af_iucv.c +1 -0
@@ -13,6 +13,7 @@#define KMSG_COMPONENT "af_iucv"#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt +#include <linux/filter.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/types.h>
net/kcm/kcmsock.c +1 -0
@@ -9,6 +9,7 @@#include <linux/errno.h> #include <linux/errqueue.h> #include <linux/file.h> +#include <linux/filter.h> #include <linux/in.h> #include <linux/kernel.h> #include <linux/module.h>
net/netfilter/nfnetlink_hook.c +1 -0
@@ -6,6 +6,7 @@*/ #include <linux/module.h> +#include <linux/kallsyms.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/skbuff.h>
net/netfilter/nft_reject_netdev.c +1 -0
@@ -4,6 +4,7 @@* Copyright (c) 2020 Jose M. Guisado <[email protected]> */ +#include <linux/etherdevice.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h>
net/netlink/af_netlink.c +2 -0
@@ -20,8 +20,10 @@#include <linux/module.h> +#include <linux/bpf.h> #include <linux/capability.h> #include <linux/kernel.h> +#include <linux/filter.h> #include <linux/init.h> #include <linux/signal.h> #include <linux/sched.h>
net/packet/af_packet.c +1 -0
@@ -49,6 +49,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/ethtool.h> +#include <linux/filter.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/capability.h>
net/rose/rose_in.c +1 -0
@@ -9,6 +9,7 @@* diagrams as the code is not obvious and probably very easy to break. */ #include <linux/errno.h> +#include <linux/filter.h> #include <linux/types.h> #include <linux/socket.h> #include <linux/in.h>
net/sched/sch_frag.c +1 -0
@@ -1,4 +1,5 @@// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB +#include <linux/if_vlan.h> #include <net/netlink.h> #include <net/sch_generic.h> #include <net/dst.h>
net/smc/smc_ib.c +2 -0
@@ -12,6 +12,8 @@* Author(s): Ursula Braun <[email protected]> */ +#include <linux/etherdevice.h> +#include <linux/if_vlan.h> #include <linux/random.h> #include <linux/workqueue.h> #include <linux/scatterlist.h>
net/smc/smc_ism.c +1 -0
@@ -6,6 +6,7 @@* Copyright IBM Corp. 2018 */ +#include <linux/if_vlan.h> #include <linux/spinlock.h> #include <linux/mutex.h> #include <linux/slab.h>
net/unix/af_unix.c +1 -0
@@ -89,6 +89,7 @@#include <linux/socket.h> #include <linux/un.h> #include <linux/fcntl.h> +#include <linux/filter.h> #include <linux/termios.h> #include <linux/sockios.h> #include <linux/net.h>
net/vmw_vsock/af_vsock.c +1 -0
@@ -85,6 +85,7 @@* TCP_LISTEN - listening */ +#include <linux/compat.h> #include <linux/types.h> #include <linux/bitops.h> #include <linux/cred.h>
net/xdp/xskmap.c +1 -0
@@ -4,6 +4,7 @@*/ #include <linux/bpf.h> +#include <linux/filter.h> #include <linux/capability.h> #include <net/xdp_sock.h> #include <linux/slab.h>
net/xfrm/xfrm_state.c +1 -0
@@ -14,6 +14,7 @@* */ +#include <linux/compat.h> #include <linux/workqueue.h> #include <net/xfrm.h> #include <linux/pfkeyv2.h>
net/xfrm/xfrm_user.c +1 -0
@@ -11,6 +11,7 @@* */ +#include <linux/compat.h> #include <linux/crypto.h> #include <linux/module.h> #include <linux/kernel.h>
Signature · 1 line
2.31.1
Quoted 10 lines · Jakub Kicinski
sock.his pretty heavily used (5k objects rebuilt on x86 after it's touched). We can drop the include offilter.hfrom it and add a forward declaration of structsk_filterinstead. This decreases the number of rebuilt objects whenbpf.his touched from ~5k to ~1k.There's a lot of missing includes this was masking. Primarily in networking tho, this time.
Signed-off-by Jakub Kicinski <[email protected]>
[...]
Quoted 1 line
drivers/net/can/usb/peak_usb/pcan_usb.c | 1 +
For the CAN driver:
regards,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
kernel test robot
build botI love your patch! Yet something to improve:
Hi Jakub,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/net-don-t-include-filter-h-from-net-sock-h/20211229-032712 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master config: ia64-randconfig-r024-20211228 (https://download.01.org/0day-ci/archive/20211229/202112290510.oNkRIfJG-lkp(a)intel.com/config) compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/655ad46a9ed1d3185292e9e8e545887d781d06d7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jakub-Kicinski/net-don-t-include-filter-h-from-net-sock-h/20211229-032712 git checkout 655ad46a9ed1d3185292e9e8e545887d781d06d7
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/net/bonding/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/net/bonding/bond_main.c: In function 'bond_enslave':
>> drivers/net/bonding/bond_main.c:2195:25: error: implicit declaration of function 'bpf_prog_inc' [-Werror=implicit-function-declaration]
2195 | bpf_prog_inc(bond->xdp_prog);
| ^~~~~~~~~~~~
In file included from include/linux/module.h:23,
from drivers/net/bonding/bond_main.c:35:
drivers/net/bonding/bond_main.c: In function 'bond_xdp_set':
>> drivers/net/bonding/bond_main.c:5249:36: error: 'bpf_master_redirect_enabled_key' undeclared (first use in this function)
5249 | static_branch_inc(&bpf_master_redirect_enabled_key);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/jump_label.h:520:63: note: in definition of macro 'static_branch_inc'
520 | #define static_branch_inc(x) static_key_slow_inc(&(x)->key)
| ^
drivers/net/bonding/bond_main.c:5249:36: note: each undeclared identifier is reported only once for each function it appears in
5249 | static_branch_inc(&bpf_master_redirect_enabled_key);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/jump_label.h:520:63: note: in definition of macro 'static_branch_inc'
520 | #define static_branch_inc(x) static_key_slow_inc(&(x)->key)
| ^
>> drivers/net/bonding/bond_main.c:5251:17: error: implicit declaration of function 'bpf_prog_put' [-Werror=implicit-function-declaration]
5251 | bpf_prog_put(old_prog);
| ^~~~~~~~~~~~cc1: some warnings being treated as errors
vim +/bpf_prog_inc +2195 drivers/net/bonding/bond_main.c
8a8efa22f51b3c Amerigo Wang 2011-02-17 2092
fbe168ba91f7c3 Michal Kubeček 2014-11-13 2093 if (!(bond_dev->features & NETIF_F_LRO))
fbe168ba91f7c3 Michal Kubeček 2014-11-13 2094 dev_disable_lro(slave_dev);
fbe168ba91f7c3 Michal Kubeček 2014-11-13 2095
35d48903e97819 Jiri Pirko 2011-03-22 2096 res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
35d48903e97819 Jiri Pirko 2011-03-22 2097 new_slave);
35d48903e97819 Jiri Pirko 2011-03-22 2098 if (res) {
e2a7420df2e013 Jarod Wilson 2019-06-07 2099 slave_dbg(bond_dev, slave_dev, "Error %d calling netdev_rx_handler_register\n", res);
5831d66e8097ae Veaceslav Falico 2013-09-25 2100 goto err_detach;
35d48903e97819 Jiri Pirko 2011-03-22 2101 }
35d48903e97819 Jiri Pirko 2011-03-22 2102
42ab19ee902929 David Ahern 2017-10-04 2103 res = bond_master_upper_dev_link(bond, new_slave, extack);
1f718f0f4f9714 Veaceslav Falico 2013-09-25 2104 if (res) {
e2a7420df2e013 Jarod Wilson 2019-06-07 2105 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_master_upper_dev_link\n", res);
1f718f0f4f9714 Veaceslav Falico 2013-09-25 2106 goto err_unregister;
1f718f0f4f9714 Veaceslav Falico 2013-09-25 2107 }
1f718f0f4f9714 Veaceslav Falico 2013-09-25 2108
32d4c5647aad13 Tobias Waldekranz 2021-01-13 2109 bond_lower_state_changed(new_slave);
32d4c5647aad13 Tobias Waldekranz 2021-01-13 2110
07699f9a7c8d10 sfeldma(a)cumulusnetworks.com 2014-01-16 2111 res = bond_sysfs_slave_add(new_slave);
07699f9a7c8d10 sfeldma(a)cumulusnetworks.com 2014-01-16 2112 if (res) {
e2a7420df2e013 Jarod Wilson 2019-06-07 2113 slave_dbg(bond_dev, slave_dev, "Error %d calling bond_sysfs_slave_add\n", res);
07699f9a7c8d10 sfeldma(a)cumulusnetworks.com 2014-01-16 2114 goto err_upper_unlink;
07699f9a7c8d10 sfeldma(a)cumulusnetworks.com 2014-01-16 2115 }
07699f9a7c8d10 sfeldma(a)cumulusnetworks.com 2014-01-16 2116
ae42cc62a9f07f Xin Long 2018-03-26 2117 /* If the mode uses primary, then the following is handled by
ae42cc62a9f07f Xin Long 2018-03-26 2118 * bond_change_active_slave().
ae42cc62a9f07f Xin Long 2018-03-26 2119 */
ae42cc62a9f07f Xin Long 2018-03-26 2120 if (!bond_uses_primary(bond)) {
ae42cc62a9f07f Xin Long 2018-03-26 2121 /* set promiscuity level to new slave */
ae42cc62a9f07f Xin Long 2018-03-26 2122 if (bond_dev->flags & IFF_PROMISC) {
ae42cc62a9f07f Xin Long 2018-03-26 2123 res = dev_set_promiscuity(slave_dev, 1);
ae42cc62a9f07f Xin Long 2018-03-26 2124 if (res)
ae42cc62a9f07f Xin Long 2018-03-26 2125 goto err_sysfs_del;
ae42cc62a9f07f Xin Long 2018-03-26 2126 }
ae42cc62a9f07f Xin Long 2018-03-26 2127
ae42cc62a9f07f Xin Long 2018-03-26 2128 /* set allmulti level to new slave */
ae42cc62a9f07f Xin Long 2018-03-26 2129 if (bond_dev->flags & IFF_ALLMULTI) {
ae42cc62a9f07f Xin Long 2018-03-26 2130 res = dev_set_allmulti(slave_dev, 1);
9f5a90c107741b Xin Long 2018-03-26 2131 if (res) {
9f5a90c107741b Xin Long 2018-03-26 2132 if (bond_dev->flags & IFF_PROMISC)
9f5a90c107741b Xin Long 2018-03-26 2133 dev_set_promiscuity(slave_dev, -1);
ae42cc62a9f07f Xin Long 2018-03-26 2134 goto err_sysfs_del;
ae42cc62a9f07f Xin Long 2018-03-26 2135 }
9f5a90c107741b Xin Long 2018-03-26 2136 }
ae42cc62a9f07f Xin Long 2018-03-26 2137
ae42cc62a9f07f Xin Long 2018-03-26 2138 netif_addr_lock_bh(bond_dev);
ae42cc62a9f07f Xin Long 2018-03-26 2139 dev_mc_sync_multiple(slave_dev, bond_dev);
ae42cc62a9f07f Xin Long 2018-03-26 2140 dev_uc_sync_multiple(slave_dev, bond_dev);
ae42cc62a9f07f Xin Long 2018-03-26 2141 netif_addr_unlock_bh(bond_dev);
ae42cc62a9f07f Xin Long 2018-03-26 2142
ae42cc62a9f07f Xin Long 2018-03-26 2143 if (BOND_MODE(bond) == BOND_MODE_8023AD) {
ae42cc62a9f07f Xin Long 2018-03-26 2144 /* add lacpdu mc addr to mc list */
ae42cc62a9f07f Xin Long 2018-03-26 2145 u8 lacpdu_multicast[ETH_ALEN] = MULTICAST_LACPDU_ADDR;
ae42cc62a9f07f Xin Long 2018-03-26 2146
ae42cc62a9f07f Xin Long 2018-03-26 2147 dev_mc_add(slave_dev, lacpdu_multicast);
ae42cc62a9f07f Xin Long 2018-03-26 2148 }
ae42cc62a9f07f Xin Long 2018-03-26 2149 }
ae42cc62a9f07f Xin Long 2018-03-26 2150
5378c2e6ea236d Veaceslav Falico 2013-10-21 2151 bond->slave_cnt++;
5378c2e6ea236d Veaceslav Falico 2013-10-21 2152 bond_compute_features(bond);
5378c2e6ea236d Veaceslav Falico 2013-10-21 2153 bond_set_carrier(bond);
5378c2e6ea236d Veaceslav Falico 2013-10-21 2154
ec0865a94991d1 Veaceslav Falico 2014-05-15 2155 if (bond_uses_primary(bond)) {
f80889a5b79cae dingtianhong 2014-02-12 2156 block_netpoll_tx();
5378c2e6ea236d Veaceslav Falico 2013-10-21 2157 bond_select_active_slave(bond);
f80889a5b79cae dingtianhong 2014-02-12 2158 unblock_netpoll_tx();
5378c2e6ea236d Veaceslav Falico 2013-10-21 2159 }
1f718f0f4f9714 Veaceslav Falico 2013-09-25 2160
e79c1055749e31 Debabrata Banerjee 2018-05-14 2161 if (bond_mode_can_use_xmit_hash(bond))
ee6377147409a0 Mahesh Bandewar 2014-10-04 2162 bond_update_slave_arr(bond, NULL);
ee6377147409a0 Mahesh Bandewar 2014-10-04 2163
21706ee8a47d3e Debabrata Banerjee 2018-05-09 2164
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2165 if (!slave_dev->netdev_ops->ndo_bpf ||
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2166 !slave_dev->netdev_ops->ndo_xdp_xmit) {
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2167 if (bond->xdp_prog) {
6569fa2d4e0147 Jonathan Toppins 2021-08-10 2168 SLAVE_NL_ERR(bond_dev, slave_dev, extack,
6569fa2d4e0147 Jonathan Toppins 2021-08-10 2169 "Slave does not support XDP");
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2170 res = -EOPNOTSUPP;
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2171 goto err_sysfs_del;
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2172 }
6d5f1ef838683e Jussi Maki 2021-09-06 2173 } else if (bond->xdp_prog) {
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2174 struct netdev_bpf xdp = {
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2175 .command = XDP_SETUP_PROG,
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2176 .flags = 0,
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2177 .prog = bond->xdp_prog,
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2178 .extack = extack,
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2179 };
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2180
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2181 if (dev_xdp_prog_count(slave_dev) > 0) {
6569fa2d4e0147 Jonathan Toppins 2021-08-10 2182 SLAVE_NL_ERR(bond_dev, slave_dev, extack,
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2183 "Slave has XDP program loaded, please unload before enslaving");
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2184 res = -EOPNOTSUPP;
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2185 goto err_sysfs_del;
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2186 }
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2187
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2188 res = slave_dev->netdev_ops->ndo_bpf(slave_dev, &xdp);
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2189 if (res < 0) {
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2190 /* ndo_bpf() sets extack error message */
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2191 slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res);
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2192 goto err_sysfs_del;
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2193 }
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2194 if (bond->xdp_prog)
9e2ee5c7e7c35d Jussi Maki 2021-07-31 @2195 bpf_prog_inc(bond->xdp_prog);
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2196 }
9e2ee5c7e7c35d Jussi Maki 2021-07-31 2197
e2a7420df2e013 Jarod Wilson 2019-06-07 2198 slave_info(bond_dev, slave_dev, "Enslaving as %s interface with %s link\n",
90194264ceffdf Joe Perches 2014-02-15 2199 bond_is_active_slave(new_slave) ? "an active" : "a backup",
90194264ceffdf Joe Perches 2014-02-15 2200 new_slave->link != BOND_LINK_DOWN ? "an up" : "a down");
^1da177e4c3f41 Linus Torvalds 2005-04-16 2201
^1da177e4c3f41 Linus Torvalds 2005-04-16 2202 /* enslave is successful */
69e6113343cfe9 Moni Shoua 2015-02-03 2203 bond_queue_slave_event(new_slave);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2204 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2205 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botI love your patch! Yet something to improve:
Hi Jakub,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/net-don-t-include-filter-h-from-net-sock-h/20211229-032712 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master config: i386-randconfig-m021-20211228 (https://download.01.org/0day-ci/archive/20211229/202112290523.IciwiUz8-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/655ad46a9ed1d3185292e9e8e545887d781d06d7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jakub-Kicinski/net-don-t-include-filter-h-from-net-sock-h/20211229-032712 git checkout 655ad46a9ed1d3185292e9e8e545887d781d06d7
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
net/ipv6/ip6_fib.c: In function 'fib6_add':
net/ipv6/ip6_fib.c:1377:25: warning: variable 'pn' set but not used [-Wunused-but-set-variable]
1377 | struct fib6_node *fn, *pn = NULL;
| ^~
net/ipv6/ip6_fib.c: In function 'ipv6_route_prog_seq_show':
>> net/ipv6/ip6_fib.c:2665:9: error: implicit declaration of function 'bpf_iter_run_prog' [-Werror=implicit-function-declaration]
2665 | return bpf_iter_run_prog(prog, &ctx);
| ^~~~~~~~~~~~~~~~~
net/ipv6/ip6_fib.c: In function 'ipv6_route_seq_show':
>> net/ipv6/ip6_fib.c:2671:23: error: storage size of 'meta' isn't known
2671 | struct bpf_iter_meta meta;
| ^~~~
>> net/ipv6/ip6_fib.c:2676:9: error: implicit declaration of function 'bpf_iter_get_info' [-Werror=implicit-function-declaration]
2676 | prog = bpf_iter_get_info(&meta, false);
| ^~~~~~~~~~~~~~~~~
net/ipv6/ip6_fib.c:2671:23: warning: unused variable 'meta' [-Wunused-variable]
2671 | struct bpf_iter_meta meta;
| ^~~~
net/ipv6/ip6_fib.c: In function 'ipv6_route_seq_stop':
net/ipv6/ip6_fib.c:2688:23: error: storage size of 'meta' isn't known
2688 | struct bpf_iter_meta meta;
| ^~~~ net/ipv6/ip6_fib.c:2688:23: warning: unused variable 'meta' [-Wunused-variable]
cc1: some warnings being treated as errors
vim +/bpf_iter_run_prog +2665 net/ipv6/ip6_fib.c
8d2ca1d7b5c3e6 Hannes Frederic Sowa 2013-09-21 2655
138d0be35b141e Yonghong Song 2020-05-09 2656 #if IS_BUILTIN(CONFIG_IPV6) && defined(CONFIG_BPF_SYSCALL)
138d0be35b141e Yonghong Song 2020-05-09 2657 static int ipv6_route_prog_seq_show(struct bpf_prog *prog,
138d0be35b141e Yonghong Song 2020-05-09 2658 struct bpf_iter_meta *meta,
138d0be35b141e Yonghong Song 2020-05-09 2659 void *v)
138d0be35b141e Yonghong Song 2020-05-09 2660 {
138d0be35b141e Yonghong Song 2020-05-09 2661 struct bpf_iter__ipv6_route ctx;
138d0be35b141e Yonghong Song 2020-05-09 2662
138d0be35b141e Yonghong Song 2020-05-09 2663 ctx.meta = meta;
138d0be35b141e Yonghong Song 2020-05-09 2664 ctx.rt = v;
138d0be35b141e Yonghong Song 2020-05-09 @2665 return bpf_iter_run_prog(prog, &ctx);
138d0be35b141e Yonghong Song 2020-05-09 2666 }
138d0be35b141e Yonghong Song 2020-05-09 2667
138d0be35b141e Yonghong Song 2020-05-09 2668 static int ipv6_route_seq_show(struct seq_file *seq, void *v)
138d0be35b141e Yonghong Song 2020-05-09 2669 {
138d0be35b141e Yonghong Song 2020-05-09 2670 struct ipv6_route_iter *iter = seq->private;
138d0be35b141e Yonghong Song 2020-05-09 @2671 struct bpf_iter_meta meta;
138d0be35b141e Yonghong Song 2020-05-09 2672 struct bpf_prog *prog;
138d0be35b141e Yonghong Song 2020-05-09 2673 int ret;
138d0be35b141e Yonghong Song 2020-05-09 2674
138d0be35b141e Yonghong Song 2020-05-09 2675 meta.seq = seq;
138d0be35b141e Yonghong Song 2020-05-09 @2676 prog = bpf_iter_get_info(&meta, false);
138d0be35b141e Yonghong Song 2020-05-09 2677 if (!prog)
138d0be35b141e Yonghong Song 2020-05-09 2678 return ipv6_route_native_seq_show(seq, v);
138d0be35b141e Yonghong Song 2020-05-09 2679
138d0be35b141e Yonghong Song 2020-05-09 2680 ret = ipv6_route_prog_seq_show(prog, &meta, v);
138d0be35b141e Yonghong Song 2020-05-09 2681 iter->w.leaf = NULL;
138d0be35b141e Yonghong Song 2020-05-09 2682
138d0be35b141e Yonghong Song 2020-05-09 2683 return ret;
138d0be35b141e Yonghong Song 2020-05-09 2684 }
138d0be35b141e Yonghong Song 2020-05-09 2685 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org