net/mlx5: Don't use "proxy" headers
Subsystems (5)
PATCH v2 1/1 net/mlx5: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use) principle.
Note that kernel.h is discouraged to be included as it's written at the top of that file.
While doing that, sort headers alphabetically.
---
v2: fixed a few compilation issues in some cases (LKP)
drivers/infiniband/hw/mlx5/mlx5_ib.h | 17 ++++--- .../ethernet/mellanox/mlx5/core/mlx5_core.h | 12 +++-- include/linux/mlx5/driver.h | 47 ++++++++++++------- 3 files changed, 48 insertions(+), 28 deletions(-)
drivers/infiniband/hw/mlx5/mlx5_ib.h +10 -7
@@ -7,20 +7,23 @@#ifndef MLX5_IB_H #define MLX5_IB_H -#include <linux/kernel.h> +#include <linux/mempool.h> #include <linux/sched.h> -#include <rdma/ib_verbs.h> -#include <rdma/ib_umem.h> +#include <linux/types.h> +#include <rdma/ib_smi.h> -#include <linux/mlx5/driver.h> +#include <rdma/ib_umem.h> +#include <rdma/ib_user_verbs.h> +#include <rdma/ib_verbs.h> +#include <rdma/uverbs_ioctl.h> +#include <linux/mlx5/cq.h> +#include <linux/mlx5/driver.h> #include <linux/mlx5/fs.h> #include <linux/mlx5/qp.h> -#include <linux/types.h> #include <linux/mlx5/transobj.h> -#include <rdma/ib_user_verbs.h> +#include <rdma/mlx5-abi.h> -#include <rdma/uverbs_ioctl.h> #include <rdma/mlx5_user_ioctl_cmds.h> #include <rdma/mlx5_user_ioctl_verbs.h>
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +8 -4
@@ -33,14 +33,18 @@#ifndef __MLX5_CORE_H__#define __MLX5_CORE_H__ -#include <linux/types.h> +#include <linux/firmware.h> +#include <linux/if_link.h> #include <linux/kernel.h> #include <linux/sched.h> -#include <linux/if_link.h> -#include <linux/firmware.h> +#include <linux/types.h> + +#include <net/devlink.h> +#include <linux/mlx5/cq.h> -#include <linux/mlx5/fs.h> #include <linux/mlx5/driver.h> +#include <linux/mlx5/fs.h> +#include "lib/devcom.h" extern uint mlx5_core_debug_mask;
include/linux/mlx5/driver.h +30 -17
64 lines not on this page · raw message
Signature · 1 line
2.47.2
Quoted 11 lines · Andy Shevchenko
Update header inclusions to follow IWYU (Include What You Use) principle.
Note that
kernel.his discouraged to be included as it's written at the top of that file.While doing that, sort headers alphabetically.
Signed-off-by Andy Shevchenko <[email protected]>---
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Andy,
kernel test robot noticed the following build errors:
[auto build test ERROR on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/net-mlx5-Don-t-use-proxy-headers/20250709-163919 base: net-next/main patch link: https://lore.kernel.org/r/20250709083757.181265-1-andriy.shevchenko%40linux.intel.com patch subject: [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20250713/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250713/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 'mlx5e_open_channel':
>> drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2766:23: error: implicit declaration of function 'irq_get_effective_affinity_mask'; did you mean 'irq_create_affinity_masks'? [-Werror=implicit-function-declaration]
2766 | c->aff_mask = irq_get_effective_affinity_mask(irq);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| irq_create_affinity_masks
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2766:21: warning: assignment to 'const struct cpumask *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2766 | c->aff_mask = irq_get_effective_affinity_mask(irq);
| ^cc1: some warnings being treated as errors
vim +2766 drivers/net/ethernet/mellanox/mlx5/core/en_main.c
2e642afb61b244 Maxim Mikityanskiy 2022-04-15 2714
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2715 static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2716 struct mlx5e_params *params,
1742b3d528690a Magnus Karlsson 2020-08-28 2717 struct xsk_buff_pool *xsk_pool,
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2718 struct mlx5e_channel **cp)
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2719 {
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2720 struct net_device *netdev = priv->netdev;
31f114c3d158da Tariq Toukan 2024-12-03 2721 struct mlx5e_channel_param *cparam;
67936e13858699 Tariq Toukan 2024-02-14 2722 struct mlx5_core_dev *mdev;
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2723 struct mlx5e_xsk_param xsk;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2724 struct mlx5e_channel *c;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2725 unsigned int irq;
67936e13858699 Tariq Toukan 2024-02-14 2726 int vec_ix;
67936e13858699 Tariq Toukan 2024-02-14 2727 int cpu;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2728 int err;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2729
67936e13858699 Tariq Toukan 2024-02-14 2730 mdev = mlx5_sd_ch_ix_get_dev(priv->mdev, ix);
67936e13858699 Tariq Toukan 2024-02-14 2731 vec_ix = mlx5_sd_ch_ix_get_vec_ix(mdev, ix);
67936e13858699 Tariq Toukan 2024-02-14 2732 cpu = mlx5_comp_vector_get_cpu(mdev, vec_ix);
67936e13858699 Tariq Toukan 2024-02-14 2733
67936e13858699 Tariq Toukan 2024-02-14 2734 err = mlx5_comp_irqn_get(mdev, vec_ix, &irq);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2735 if (err)
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2736 return err;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2737
fa691d0c9c0812 Lama Kayal 2021-09-22 2738 err = mlx5e_channel_stats_alloc(priv, ix, cpu);
fa691d0c9c0812 Lama Kayal 2021-09-22 2739 if (err)
fa691d0c9c0812 Lama Kayal 2021-09-22 2740 return err;
fa691d0c9c0812 Lama Kayal 2021-09-22 2741
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2742 c = kvzalloc_node(sizeof(*c), GFP_KERNEL, cpu_to_node(cpu));
31f114c3d158da Tariq Toukan 2024-12-03 2743 cparam = kvzalloc(sizeof(*cparam), GFP_KERNEL);
31f114c3d158da Tariq Toukan 2024-12-03 2744 if (!c || !cparam) {
31f114c3d158da Tariq Toukan 2024-12-03 2745 err = -ENOMEM;
31f114c3d158da Tariq Toukan 2024-12-03 2746 goto err_free;
31f114c3d158da Tariq Toukan 2024-12-03 2747 }
31f114c3d158da Tariq Toukan 2024-12-03 2748
31f114c3d158da Tariq Toukan 2024-12-03 2749 err = mlx5e_build_channel_param(mdev, params, cparam);
31f114c3d158da Tariq Toukan 2024-12-03 2750 if (err)
31f114c3d158da Tariq Toukan 2024-12-03 2751 goto err_free;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2752
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2753 c->priv = priv;
67936e13858699 Tariq Toukan 2024-02-14 2754 c->mdev = mdev;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2755 c->tstamp = &priv->tstamp;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2756 c->ix = ix;
67936e13858699 Tariq Toukan 2024-02-14 2757 c->vec_ix = vec_ix;
7f525acbccdf7e Tariq Toukan 2024-02-14 2758 c->sd_ix = mlx5_sd_ch_ix_get_dev_ix(mdev, ix);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2759 c->cpu = cpu;
67936e13858699 Tariq Toukan 2024-02-14 2760 c->pdev = mlx5_core_dma_dev(mdev);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2761 c->netdev = priv->netdev;
67936e13858699 Tariq Toukan 2024-02-14 2762 c->mkey_be = cpu_to_be32(mdev->mlx5e_res.hw_objs.mkey);
86d747a3f9697a Tariq Toukan 2021-07-06 2763 c->num_tc = mlx5e_get_dcb_num_tc(params);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2764 c->xdp = !!params->xdp_prog;
be98737a4faa3a Tariq Toukan 2021-12-05 2765 c->stats = &priv->channel_stats[ix]->ch;
ec7b37b6f08fac Thomas Gleixner 2020-12-10 @2766 c->aff_mask = irq_get_effective_affinity_mask(irq);
67936e13858699 Tariq Toukan 2024-02-14 2767 c->lag_port = mlx5e_enumerate_lag_port(mdev, ix);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2768
8f7b00307bf146 Cosmin Ratiu 2025-05-21 2769 netif_napi_add_config_locked(netdev, &c->napi, mlx5e_napi_poll, ix);
8f7b00307bf146 Cosmin Ratiu 2025-05-21 2770 netif_napi_set_irq_locked(&c->napi, irq);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2771
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2772 err = mlx5e_open_queues(c, params, cparam);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2773 if (unlikely(err))
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2774 goto err_napi_del;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2775
1742b3d528690a Magnus Karlsson 2020-08-28 2776 if (xsk_pool) {
1742b3d528690a Magnus Karlsson 2020-08-28 2777 mlx5e_build_xsk_param(xsk_pool, &xsk);
1742b3d528690a Magnus Karlsson 2020-08-28 2778 err = mlx5e_open_xsk(priv, params, &xsk, xsk_pool, c);
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2779 if (unlikely(err))
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2780 goto err_close_queues;
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2781 }
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2782
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2783 *cp = c;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2784
31f114c3d158da Tariq Toukan 2024-12-03 2785 kvfree(cparam);
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2786 return 0;
0a06382fa40601 Maxim Mikityanskiy 2019-06-26 2787
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2788 err_close_queues:
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2789 mlx5e_close_queues(c);
db05815b36cbd4 Maxim Mikityanskiy 2019-06-26 2790
f62b8bb8f2d305 Amir Vadai 2015-05-28 2791 err_napi_del:
8f7b00307bf146 Cosmin Ratiu 2025-05-21 2792 netif_napi_del_locked(&c->napi);
149e566fef8120 Moshe Shemesh 2018-10-25 2793
31f114c3d158da Tariq Toukan 2024-12-03 2794 err_free:
31f114c3d158da Tariq Toukan 2024-12-03 2795 kvfree(cparam);
ca11b798998a62 Tariq Toukan 2018-06-05 2796 kvfree(c);
f62b8bb8f2d305 Amir Vadai 2015-05-28 2797
f62b8bb8f2d305 Amir Vadai 2015-05-28 2798 return err;
f62b8bb8f2d305 Amir Vadai 2015-05-28 2799 }
f62b8bb8f2d305 Amir Vadai 2015-05-28 2800 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki