net: don't include ethtool.h from netdevice.h
Subsystems (37)
Jakub Kicinski
maintainerPATCH v2 1/1 net: don't include ethtool.h from netdevice.h
linux/netdevice.h is included in very many places, touching any of its dependecies causes large incremental builds.
Drop the linux/ethtool.h include, linux/netdevice.h just needs a forward declaration of struct ethtool_ops.
Fix all the places which made use of this implicit include.
Acked-by Johannes Berg <[email protected]>
Signed-off-by Jakub Kicinski <[email protected]>
---
v2:
- fix a warning in mlxsw
- fix a warning in bnx2fc
drivers/isdn/capi/capi.c | 1 + drivers/media/pci/ttpci/av7110_av.c | 1 + drivers/net/bonding/bond_procfs.c | 1 + drivers/net/can/usb/gs_usb.c | 1 + drivers/net/ethernet/amazon/ena/ena_ethtool.c | 1 + drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 2 ++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_ethtool.c | 1 + drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 + drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c | 1 + drivers/net/ethernet/google/gve/gve_ethtool.c | 1 + drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + drivers/net/ethernet/huawei/hinic/hinic_port.h | 1 + drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 1 + drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 1 + drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 1 + drivers/net/ethernet/mellanox/mlxsw/core_env.h | 3 +++ drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 1 + drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 1 + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 + drivers/net/ethernet/pensando/ionic/ionic_stats.c | 1 + drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c | 1 + drivers/net/geneve.c | 1 + drivers/net/hyperv/netvsc_drv.c | 1 + drivers/net/hyperv/rndis_filter.c | 1 + drivers/net/ipvlan/ipvlan_main.c | 2 ++ drivers/net/nlmon.c | 1 + drivers/net/team/team.c | 1 + drivers/net/vrf.c | 1 + drivers/net/vsockmon.c | 1 + drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 ++ drivers/scsi/fcoe/fcoe_transport.c | 1 + drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c | 2 ++ drivers/staging/wimax/i2400m/usb.c | 1 + include/linux/netdevice.h | 2 +- include/linux/qed/qed_if.h | 1 + include/net/cfg80211.h | 1 + include/rdma/ib_addr.h | 1 + include/rdma/ib_verbs.h | 1 + net/packet/af_packet.c | 1 + net/sched/sch_cbs.c | 1 + net/sched/sch_taprio.c | 1 + net/socket.c | 1 + 45 files changed, 51 insertions(+), 1 deletion(-)
drivers/isdn/capi/capi.c +1 -0
@@ -11,6 +11,7 @@#include <linux/compiler.h> #include <linux/module.h> +#include <linux/ethtool.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/major.h>
drivers/media/pci/ttpci/av7110_av.c +1 -0
@@ -11,6 +11,7 @@* the project's page is at https://linuxtv.org */ +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h>
drivers/net/bonding/bond_procfs.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/proc_fs.h> +#include <linux/ethtool.h> #include <linux/export.h> #include <net/net_namespace.h> #include <net/netns/generic.h>
drivers/net/can/usb/gs_usb.c +1 -0
@@ -9,6 +9,7 @@* Many thanks to all socketcan devs! */ +#include <linux/ethtool.h> #include <linux/init.h> #include <linux/signal.h> #include <linux/module.h>
drivers/net/ethernet/amazon/ena/ena_ethtool.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved. */ +#include <linux/ethtool.h> #include <linux/pci.h> #include "ena_netdev.h"
drivers/net/ethernet/aquantia/atlantic/aq_nic.h +2 -0
@@ -10,6 +10,8 @@#ifndef AQ_NIC_H #define AQ_NIC_H +#include <linux/ethtool.h> +#include "aq_common.h" #include "aq_rss.h" #include "aq_hw.h"
drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 -0
@@ -20,6 +20,7 @@#define DRV_VER_MIN 10#define DRV_VER_UPD 1 +#include <linux/ethtool.h> #include <linux/interrupt.h> #include <linux/rhashtable.h> #include <linux/crash_dump.h>
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +1 -0
@@ -8,6 +8,7 @@* the Free Software Foundation. */ +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/netdevice.h>
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +1 -0
@@ -15,6 +15,7 @@* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or * NONINFRINGEMENT. See the GNU General Public License for more details. ***********************************************************************/ +#include <linux/ethtool.h> #include <linux/netdevice.h> #include <linux/net_tstamp.h> #include <linux/pci.h>
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c +1 -0
@@ -5,6 +5,7 @@/* ETHTOOL Support for VNIC_VF Device*/ +#include <linux/ethtool.h> #include <linux/pci.h> #include <linux/net_tstamp.h>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +1 -0
@@ -39,6 +39,7 @@#include <linux/bitops.h> #include <linux/cache.h> +#include <linux/ethtool.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/netdevice.h>
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +1 -0
@@ -33,6 +33,7 @@* SOFTWARE. */ +#include <linux/ethtool.h> #include <linux/pci.h> #include "t4vf_common.h"
drivers/net/ethernet/google/gve/gve_ethtool.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) 2015-2019 Google, Inc. */ +#include <linux/ethtool.h> #include <linux/rtnetlink.h> #include "gve.h" #include "gve_adminq.h"
drivers/net/ethernet/hisilicon/hns3/hnae3.h +1 -0
@@ -25,6 +25,7 @@#include <linux/dcbnl.h> #include <linux/delay.h> #include <linux/device.h> +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/pci.h>
drivers/net/ethernet/huawei/hinic/hinic_port.h +1 -0
@@ -8,6 +8,7 @@#define HINIC_PORT_H #include <linux/types.h> +#include <linux/ethtool.h> #include <linux/etherdevice.h> #include <linux/bitops.h>
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2019 Intel Corporation. */ +#include <linux/ethtool.h> #include <linux/vmalloc.h> #include "fm10k.h"
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 -0
@@ -11,6 +11,7 @@#ifndef OTX2_COMMON_H #define OTX2_COMMON_H +#include <linux/ethtool.h> #include <linux/pci.h> #include <linux/iommu.h> #include <linux/net_tstamp.h>
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +1 -0
@@ -36,6 +36,7 @@#include <linux/bitops.h> #include <linux/compiler.h> +#include <linux/ethtool.h> #include <linux/list.h> #include <linux/mutex.h> #include <linux/netdevice.h>
drivers/net/ethernet/mellanox/mlxsw/core_env.h +3 -0
@@ -4,6 +4,9 @@#ifndef _MLXSW_CORE_ENV_H#define _MLXSW_CORE_ENV_H +struct ethtool_modinfo ; +struct ethtool_eeprom ; +int mlxsw_env_module_temp_thresholds_get (struct mlxsw_core *core,int module,int off,int *temp);
drivers/net/ethernet/mellanox/mlxsw/spectrum.h +1 -0
@@ -4,6 +4,7 @@#ifndef _MLXSW_SPECTRUM_H#define _MLXSW_SPECTRUM_H +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/netdevice.h> #include <linux/rhashtable.h>
drivers/net/ethernet/mellanox/mlxsw/switchx2.c +1 -0
@@ -6,6 +6,7 @@#include <linux/types.h> #include <linux/pci.h> #include <linux/netdevice.h> +#include <linux/ethtool.h> #include <linux/etherdevice.h> #include <linux/slab.h> #include <linux/device.h>
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */ +#include <linux/ethtool.h> #include <linux/printk.h> #include <linux/dynamic_debug.h> #include <linux/netdevice.h>
drivers/net/ethernet/pensando/ionic/ionic_stats.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2017 - 2019 Pensando Systems, Inc */ +#include <linux/ethtool.h> #include <linux/kernel.h> #include <linux/mutex.h> #include <linux/netdevice.h>
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c +1 -0
@@ -5,6 +5,7 @@*/ #include <linux/etherdevice.h> +#include <linux/ethtool.h> #include <linux/if_arp.h> #include <net/pkt_sched.h> #include "rmnet_config.h"
drivers/net/geneve.c +1 -0
@@ -7,6 +7,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/ethtool.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/etherdevice.h>
drivers/net/hyperv/netvsc_drv.c +1 -0
@@ -10,6 +10,7 @@#include <linux/init.h> #include <linux/atomic.h> +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/highmem.h> #include <linux/device.h>
drivers/net/hyperv/rndis_filter.c +1 -0
@@ -6,6 +6,7 @@* Haiyang Zhang <[email protected]> * Hank Janssen <[email protected]> */ +#include <linux/ethtool.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/wait.h>
drivers/net/ipvlan/ipvlan_main.c +2 -0
@@ -2,6 +2,8 @@/* Copyright (c) 2014 Mahesh Bandewar <[email protected]> */ +#include <linux/ethtool.h> +#include "ipvlan.h" static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval,
drivers/net/nlmon.c +1 -0
@@ -1,4 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h>
drivers/net/team/team.c +1 -0
@@ -4,6 +4,7 @@* Copyright (c) 2011 Jiri Pirko <[email protected]> */ +#include <linux/ethtool.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/module.h>
drivers/net/vrf.c +1 -0
@@ -9,6 +9,7 @@* Based on dummy, team and ipvlan drivers */ +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h>
drivers/net/vsockmon.c +1 -0
@@ -1,4 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/if_arp.h>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +2 -0
@@ -16,6 +16,8 @@#include "bnx2fc.h" +#include <linux/ethtool.h> +static struct list_head adapter_list;static struct list_head if_list;static u32 adapter_count;
drivers/scsi/fcoe/fcoe_transport.c +1 -0
@@ -10,6 +10,7 @@#include <linux/kernel.h> #include <linux/list.h> #include <linux/netdevice.h> +#include <linux/ethtool.h> #include <linux/errno.h> #include <linux/crc32.h> #include <scsi/libfcoe.h>
drivers/staging/fsl-dpaa2/ethsw/ethsw-ethtool.c +2 -0
@@ -7,6 +7,8 @@* */ +#include <linux/ethtool.h> +#include "ethsw.h" static struct {
drivers/staging/wimax/i2400m/usb.c +1 -0
@@ -51,6 +51,7 @@#include "i2400m-usb.h" #include "linux-wimax-i2400m.h" #include <linux/debugfs.h> +#include <linux/ethtool.h> #include <linux/slab.h> #include <linux/module.h>
include/linux/netdevice.h +1 -1
@@ -34,7 +34,6 @@#include <linux/workqueue.h> #include <linux/dynamic_queue_limits.h> -#include <linux/ethtool.h> #include <net/net_namespace.h> #ifdef CONFIG_DCB #include <net/dcbnl.h>
@@ -51,6 +50,7 @@struct netpoll_info ;struct device ; +struct ethtool_ops ;struct phy_device ;struct dsa_port ;struct ip_tunnel_parm ;
include/linux/qed/qed_if.h +1 -0
@@ -7,6 +7,7 @@#ifndef _QED_IF_H#define _QED_IF_H +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/netdevice.h>
include/net/cfg80211.h +1 -0
@@ -10,6 +10,7 @@* Copyright (C) 2018-2020 Intel Corporation */ +#include <linux/ethtool.h> #include <linux/netdevice.h> #include <linux/debugfs.h> #include <linux/list.h>
include/rdma/ib_addr.h +1 -0
@@ -7,6 +7,7 @@#ifndef IB_ADDR_H #define IB_ADDR_H +#include <linux/ethtool.h> #include <linux/in.h> #include <linux/in6.h> #include <linux/if_arp.h>
include/rdma/ib_verbs.h +1 -0
@@ -12,6 +12,7 @@#ifndef IB_VERBS_H #define IB_VERBS_H +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/device.h> #include <linux/dma-mapping.h>
net/packet/af_packet.c +1 -0
@@ -46,6 +46,7 @@* Copyright (C) 2011, <[email protected]> */ +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/capability.h>
net/sched/sch_cbs.c +1 -0
@@ -50,6 +50,7 @@* locredit = max_frame_size * (sendslope / port_transmit_rate) */ +#include <linux/ethtool.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h>
net/sched/sch_taprio.c +1 -0
@@ -6,6 +6,7 @@* */ +#include <linux/ethtool.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/kernel.h>
net/socket.c +1 -0
@@ -52,6 +52,7 @@* Based upon Swansea University Computer Society NET3.039 */ +#include <linux/ethtool.h> #include <linux/mm.h> #include <linux/socket.h> #include <linux/file.h>
Signature · 1 line
2.24.1
Quoted 10 lines · Jakub Kicinski
linux/netdevice.his included in very many places, touching any of its dependecies causes large incremental builds.Drop the
linux/ethtool.hinclude,linux/netdevice.hjust needs a forward declaration of structethtool_ops.Fix all the places which made use of this implicit include.
Acked-by Johannes Berg <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>
Reviewed-by Jesse Brandeburg <[email protected]>