linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers
@ 2025-07-09  8:37 Andy Shevchenko
  2025-07-09 22:37 ` Jacob Keller
  2025-07-13  2:05 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-07-09  8:37 UTC (permalink / raw)
  To: Leon Romanovsky, Tariq Toukan, Shahar Shitrit, linux-rdma,
	linux-kernel, netdev
  Cc: Jason Gunthorpe, Saeed Mahameed, Mark Bloch, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andy Shevchenko

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

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(-)

diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index a012e24d3afe..3e8c8ddda045 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -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>
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
index 2e02bdea8361..0b2dd9eab6a1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
@@ -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;
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 3475d33c75f4..54b82d55deb6 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -33,28 +33,40 @@
 #ifndef MLX5_DRIVER_H
 #define MLX5_DRIVER_H
 
-#include <linux/kernel.h>
-#include <linux/completion.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/spinlock_types.h>
-#include <linux/semaphore.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/xarray.h>
-#include <linux/workqueue.h>
-#include <linux/mempool.h>
-#include <linux/interrupt.h>
-#include <linux/notifier.h>
-#include <linux/refcount.h>
 #include <linux/auxiliary_bus.h>
-#include <linux/mutex.h>
+#include <linux/completion.h>
+#include <linux/idr.h>
+#include <linux/io.h>
+#include <linux/kref.h>
+#include <linux/lockdep_types.h>
+#include <linux/minmax.h>
+#include <linux/mutex_types.h>
+#include <linux/notifier.h>
+#include <linux/pci.h>
+#include <linux/printk.h>
+#include <linux/refcount.h>
+#include <linux/semaphore.h>
+#include <linux/spinlock_types.h>
+#include <linux/timer_types.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+#include <linux/xarray.h>
+
+#include <net/devlink.h>
+
+#include <rdma/ib_verbs.h>
+
+#include <asm/page.h>
 
 #include <linux/mlx5/device.h>
 #include <linux/mlx5/doorbell.h>
 #include <linux/mlx5/eq.h>
-#include <linux/timecounter.h>
-#include <net/devlink.h>
+
+struct dentry;
+struct device;
+struct dma_pool;
+struct net_device;
+struct pci_dev;
 
 #define MLX5_ADEV_NAME "mlx5_core"
 
@@ -243,6 +255,7 @@ struct mlx5_cmd_first {
 	__be32		data[4];
 };
 
+struct cmd_msg_cache;
 struct mlx5_cmd_msg {
 	struct list_head		list;
 	struct cmd_msg_cache	       *parent;
-- 
2.47.2


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

* Re: [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers
  2025-07-09  8:37 [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers Andy Shevchenko
@ 2025-07-09 22:37 ` Jacob Keller
  2025-07-13  2:05 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2025-07-09 22:37 UTC (permalink / raw)
  To: Andy Shevchenko, Leon Romanovsky, Tariq Toukan, Shahar Shitrit,
	linux-rdma, linux-kernel, netdev
  Cc: Jason Gunthorpe, Saeed Mahameed, Mark Bloch, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni


[-- Attachment #1.1: Type: text/plain, Size: 424 bytes --]



On 7/9/2025 1:37 AM, Andy Shevchenko wrote:
> 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.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> 

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers
  2025-07-09  8:37 [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers Andy Shevchenko
  2025-07-09 22:37 ` Jacob Keller
@ 2025-07-13  2:05 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-07-13  2:05 UTC (permalink / raw)
  To: Andy Shevchenko, Leon Romanovsky, Tariq Toukan, Shahar Shitrit,
	linux-rdma, linux-kernel, netdev
  Cc: oe-kbuild-all, Jason Gunthorpe, Saeed Mahameed, Mark Bloch,
	Andrew Lunn, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andy Shevchenko

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/202507130919.xwitQGtJ-lkp@intel.com/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/202507130919.xwitQGtJ-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507130919.xwitQGtJ-lkp@intel.com/

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  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-07-13  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09  8:37 [PATCH net-next v2 1/1] net/mlx5: Don't use "proxy" headers Andy Shevchenko
2025-07-09 22:37 ` Jacob Keller
2025-07-13  2:05 ` kernel test robot

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).