netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Shay Drory <shayd@nvidia.com>, Parav Pandit <parav@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 04/12] net/mlx5: Align mlx5_irq structure
Date: Wed, 11 Aug 2021 11:16:50 -0700	[thread overview]
Message-ID: <20210811181658.492548-5-saeed@kernel.org> (raw)
In-Reply-To: <20210811181658.492548-1-saeed@kernel.org>

From: Shay Drory <shayd@nvidia.com>

mlx5_irq structure have holes due to incorrect position of fields in it.
Make them naturally align.

pahole output after alignment:
struct mlx5_irq {
        struct atomic_notifier_head nh;                  /*     0    72 */
        /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
        cpumask_var_t              mask;                 /*    72     8 */
        char                       name[32];             /*    80    32 */
        struct mlx5_irq_pool *     pool;                 /*   112     8 */
        struct kref                kref;                 /*   120     4 */
        u32                        index;                /*   124     4 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        int                        irqn;                 /*   128     4 */

        /* size: 136, cachelines: 3, members: 7 */
        /* padding: 4 */
        /* last cacheline: 8 bytes */

};

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
index 9fb75d79bf08..a4f6ba0c91da 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
@@ -28,13 +28,13 @@
 #define MLX5_EQ_REFS_PER_IRQ (2)
 
 struct mlx5_irq {
-	u32 index;
 	struct atomic_notifier_head nh;
 	cpumask_var_t mask;
 	char name[MLX5_MAX_IRQ_NAME];
+	struct mlx5_irq_pool *pool;
 	struct kref kref;
+	u32 index;
 	int irqn;
-	struct mlx5_irq_pool *pool;
 };
 
 struct mlx5_irq_pool {
-- 
2.31.1


  parent reply	other threads:[~2021-08-11 18:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 18:16 [pull request][net-next 00/12] mlx5 updates 2021-08-11 Saeed Mahameed
2021-08-11 18:16 ` [net-next 01/12] net/mlx5: Fix typo in comments Saeed Mahameed
2021-08-12 11:50   ` patchwork-bot+netdevbpf
2021-08-11 18:16 ` [net-next 02/12] net/mlx5: Fix inner TTC table creation Saeed Mahameed
2021-08-11 18:16 ` [net-next 03/12] net/mlx5: Delete impossible dev->state checks Saeed Mahameed
2021-08-11 18:16 ` Saeed Mahameed [this message]
2021-08-11 18:16 ` [net-next 05/12] net/mlx5: Change SF missing dedicated MSI-X err message to dbg Saeed Mahameed
2021-08-12  7:07   ` Leon Romanovsky
2021-08-11 18:16 ` [net-next 06/12] net/mlx5: Refcount mlx5_irq with integer Saeed Mahameed
2021-08-12  7:13   ` Leon Romanovsky
2021-08-11 18:16 ` [net-next 07/12] net/mlx5: SF, use recent sysfs api Saeed Mahameed
2021-08-11 18:16 ` [net-next 08/12] net/mlx5: Reorganize current and maximal capabilities to be per-type Saeed Mahameed
2021-08-11 18:16 ` [net-next 09/12] net/mlx5: Allocate individual capability Saeed Mahameed
2021-08-11 18:16 ` [net-next 10/12] net/mlx5: Initialize numa node for all core devices Saeed Mahameed
2021-08-11 18:16 ` [net-next 11/12] net/mlx5: Fix variable type to match 64bit Saeed Mahameed
2021-08-11 18:16 ` [net-next 12/12] net/mlx5e: Make use of netdev_warn() Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210811181658.492548-5-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).