diff mbox series

[net,7/7] ionic: Re-arrange ionic_intr_info struct for cache perf

Message ID 20231201000519.13363-8-shannon.nelson@amd.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series ionic: small driver fixes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success SINGLE THREAD; Generated files up to date; no warnings/errors;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 1 maintainers not CCed: allen.hubbe@amd.com
netdev/build_clang success Errors and warnings before: 1142 this patch: 1142
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1143 this patch: 1143
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Nelson, Shannon Dec. 1, 2023, 12:05 a.m. UTC
From: Brett Creeley <brett.creeley@amd.com>

dim_coal_hw is accessed in the hotpath along with other values
from the first cacheline of ionic_intr_info. So, re-arrange
the structure so the hot path variables are on the first
cacheline.

Before:

struct ionic_intr_info {
	char                       name[32];             /*     0    32 */
	unsigned int               index;                /*    32     4 */
	unsigned int               vector;               /*    36     4 */
	u64                        rearm_count;          /*    40     8 */
	unsigned int               cpu;                  /*    48     4 */

	/* XXX 4 bytes hole, try to pack */

	cpumask_t                  affinity_mask;        /*    56  1024 */
	/* --- cacheline 16 boundary (1024 bytes) was 56 bytes ago --- */
	u32                        dim_coal_hw;          /*  1080     4 */

	/* size: 1088, cachelines: 17, members: 7 */
	/* sum members: 1080, holes: 1, sum holes: 4 */
	/* padding: 4 */
};

After:

struct ionic_intr_info {
	char                       name[32];             /*     0    32 */
	u64                        rearm_count;          /*    32     8 */
	unsigned int               index;                /*    40     4 */
	unsigned int               vector;               /*    44     4 */
	unsigned int               cpu;                  /*    48     4 */
	u32                        dim_coal_hw;          /*    52     4 */
	cpumask_t                  affinity_mask;        /*    56  1024 */

	/* size: 1080, cachelines: 17, members: 7 */
	/* last cacheline: 56 bytes */
};


Fixes: 04a834592bf5 ("ionic: dynamic interrupt moderation")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_dev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
index 745a3292be92..c47c059465ae 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
@@ -269,12 +269,12 @@  struct ionic_queue {
 
 struct ionic_intr_info {
 	char name[IONIC_INTR_NAME_MAX_SZ];
+	u64 rearm_count;
 	unsigned int index;
 	unsigned int vector;
-	u64 rearm_count;
 	unsigned int cpu;
-	cpumask_t affinity_mask;
 	u32 dim_coal_hw;
+	cpumask_t affinity_mask;
 };
 
 struct ionic_cq {