From 12c56d7dc48821d84cc29e66f5d7f45e2ed8fd11 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 1 Feb 2022 11:49:42 +0100 Subject: [PATCH] mlx5: idiomatic use of preprocessor, in particular paths MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_core/mlx5_alloc.c | 3 +-- sys/dev/mlx5/mlx5_core/mlx5_cmd.c | 3 +-- sys/dev/mlx5/mlx5_core/mlx5_cq.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_eq.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_eswitch.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_fw.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_health.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_mad.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_main.c | 6 +++--- sys/dev/mlx5/mlx5_core/mlx5_mcg.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_mpfs.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_mr.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_pd.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_port.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_qp.c | 6 ++---- sys/dev/mlx5/mlx5_core/mlx5_rl.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_srq.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_tls.c | 5 ++--- sys/dev/mlx5/mlx5_core/mlx5_transobj.c | 5 ++--- sys/dev/mlx5/mlx5_core/mlx5_uar.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_vport.c | 2 +- sys/dev/mlx5/mlx5_core/mlx5_wq.c | 4 ++-- 25 files changed, 36 insertions(+), 42 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_alloc.c b/sys/dev/mlx5/mlx5_core/mlx5_alloc.c index 097e1c90207..79aecb8aa25 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_alloc.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_alloc.c @@ -34,8 +34,7 @@ #include #include #include - -#include "mlx5_core.h" +#include /* Handling for queue buffers -- we allocate a bunch of memory and * register it in a memory region at HCA virtual address 0. If the diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c index 2eaca4d83c6..b2aec33e55c 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cmd.c @@ -40,8 +40,7 @@ #include #include #include - -#include "mlx5_core.h" +#include static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size); static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c index 50da5ec0ae3..8f873bde607 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c @@ -34,7 +34,7 @@ #include #include #include -#include "mlx5_core.h" +#include #include diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eq.c b/sys/dev/mlx5/mlx5_core/mlx5_eq.c index 9339b4cb8ec..d51e97cd3e9 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eq.c @@ -33,8 +33,8 @@ #include #include #include -#include "mlx5_core.h" -#include "eswitch.h" +#include +#include #ifdef RSS #include diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c index eff46501089..6d3be72427c 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c @@ -34,8 +34,8 @@ #include #include #include -#include "mlx5_core.h" -#include "eswitch.h" +#include +#include #define UPLINK_VPORT 0xFFFF diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c index e44feacf687..1985bc97ce9 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c @@ -34,8 +34,8 @@ #include #include -#include "fs_core.h" -#include "mlx5_core.h" +#include +#include int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev, enum fs_ft_type type, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c index f01b96fcb5a..860c2331f03 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c @@ -30,8 +30,8 @@ #include #include -#include "mlx5_core.h" -#include "fs_core.h" +#include +#include #include #include diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fw.c b/sys/dev/mlx5/mlx5_core/mlx5_fw.c index 3980c0a7640..c6118a6dbb2 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fw.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fw.c @@ -30,7 +30,7 @@ #include #include -#include "mlx5_core.h" +#include static int mlx5_cmd_query_adapter(struct mlx5_core_dev *dev, u32 *out, int outlen) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_health.c b/sys/dev/mlx5/mlx5_core/mlx5_health.c index 8f0565b2ed0..f75093b1d9d 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_health.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_health.c @@ -36,7 +36,7 @@ #include #include #include -#include "mlx5_core.h" +#include #define MLX5_HEALTH_POLL_INTERVAL (2 * HZ) #define MAX_MISSES 3 diff --git a/sys/dev/mlx5/mlx5_core/mlx5_mad.c b/sys/dev/mlx5/mlx5_core/mlx5_mad.c index 18b2b902e2b..e4bb111d565 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_mad.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_mad.c @@ -31,7 +31,7 @@ #include #include #include -#include "mlx5_core.h" +#include int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb, u16 opmod, u8 port) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 57ef629223d..0745d19b272 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -47,9 +47,9 @@ #include #include #include -#include "mlx5_core.h" -#include "eswitch.h" -#include "fs_core.h" +#include +#include +#include #ifdef PCI_IOV #include #include diff --git a/sys/dev/mlx5/mlx5_core/mlx5_mcg.c b/sys/dev/mlx5/mlx5_core/mlx5_mcg.c index 2b791978e7f..aa9c94a843b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_mcg.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_mcg.c @@ -32,7 +32,7 @@ #include #include #include -#include "mlx5_core.h" +#include int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c b/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c index b18ae211d37..4d59c739105 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_mpfs.c @@ -36,7 +36,7 @@ #include #include -#include "mlx5_core.h" +#include #define MPFS_LOCK(dev) spin_lock(&(dev)->mpfs.spinlock) #define MPFS_UNLOCK(dev) spin_unlock(&(dev)->mpfs.spinlock) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_mr.c b/sys/dev/mlx5/mlx5_core/mlx5_mr.c index 21a982f6b55..e9534db24dc 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_mr.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_mr.c @@ -31,7 +31,7 @@ #include #include #include -#include "mlx5_core.h" +#include static int mlx5_relaxed_ordering_write; SYSCTL_INT(_hw_mlx5, OID_AUTO, relaxed_ordering_write, CTLFLAG_RWTUN, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c index 5f649ff16ce..d298da67057 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c @@ -32,7 +32,7 @@ #include #include #include -#include "mlx5_core.h" +#include CTASSERT((uintptr_t)PAGE_MASK > (uintptr_t)PAGE_SIZE); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pd.c b/sys/dev/mlx5/mlx5_core/mlx5_pd.c index 5628aa64d5a..9ee8ccf8406 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_pd.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_pd.c @@ -31,7 +31,7 @@ #include #include #include -#include "mlx5_core.h" +#include int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn, u16 uid) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_port.c b/sys/dev/mlx5/mlx5_core/mlx5_port.c index 173990843ee..2ee6dffd643 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_port.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_port.c @@ -30,7 +30,7 @@ #include #include -#include "mlx5_core.h" +#include int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, int size_in, void *data_out, int size_out, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_qp.c b/sys/dev/mlx5/mlx5_core/mlx5_qp.c index 4b5055a7883..c284efedbe4 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_qp.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_qp.c @@ -31,10 +31,8 @@ #include #include #include - -#include "mlx5_core.h" - -#include "transobj.h" +#include +#include static struct mlx5_core_rsc_common *mlx5_get_rsc(struct mlx5_core_dev *dev, u32 rsn) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_rl.c b/sys/dev/mlx5/mlx5_core/mlx5_rl.c index 2f66ab4748e..aa8f351e0fc 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_rl.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_rl.c @@ -31,7 +31,7 @@ #include #include #include -#include "mlx5_core.h" +#include #ifdef RATELIMIT diff --git a/sys/dev/mlx5/mlx5_core/mlx5_srq.c b/sys/dev/mlx5/mlx5_core/mlx5_srq.c index 6deae4e0fee..c59544f38b0 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_srq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_srq.c @@ -33,8 +33,8 @@ #include #include #include -#include "mlx5_core.h" -#include "transobj.h" +#include +#include void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_tls.c b/sys/dev/mlx5/mlx5_core/mlx5_tls.c index 9fbcaa9aebb..b8de7acd927 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_tls.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_tls.c @@ -32,9 +32,8 @@ #include #include #include - -#include "mlx5_core.h" -#include "transobj.h" +#include +#include int mlx5_encryption_key_create(struct mlx5_core_dev *mdev, u32 pdn, const void *p_key, u32 key_len, u32 *p_obj_id) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_transobj.c b/sys/dev/mlx5/mlx5_core/mlx5_transobj.c index 1586223adcf..27e56b8acb8 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_transobj.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_transobj.c @@ -29,9 +29,8 @@ #include "opt_ratelimit.h" #include - -#include "mlx5_core.h" -#include "transobj.h" +#include +#include int mlx5_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn, u32 uid) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_uar.c b/sys/dev/mlx5/mlx5_core/mlx5_uar.c index eb67c3c98f5..ef92e58064f 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_uar.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_uar.c @@ -32,7 +32,7 @@ #include #include #include -#include "mlx5_core.h" +#include int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_vport.c b/sys/dev/mlx5/mlx5_core/mlx5_vport.c index d3d4b805247..4c90c3ddf4b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_vport.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_vport.c @@ -31,7 +31,7 @@ #include #include #include -#include "mlx5_core.h" +#include static int mlx5_modify_nic_vport_context(struct mlx5_core_dev *mdev, void *in, int inlen); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_wq.c b/sys/dev/mlx5/mlx5_core/mlx5_wq.c index 41cb05366ca..87334f17193 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_wq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_wq.c @@ -29,8 +29,8 @@ #include "opt_ratelimit.h" #include -#include "wq.h" -#include "mlx5_core.h" +#include +#include u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq) {