Netdev List
 help / color / mirror / Atom feed
From: Ivan Vecera <cera@cera.cz>
To: netdev@vger.kernel.org
Cc: sathya.perla@broadcom.com, ajit.khaparde@broadcom.com,
	sriharsha.basavapatna@broadcom.com, somnath.kotur@broadcom.com
Subject: [PATCH net-next 8/8] be2net: move rss_flags field in rss_info to ensure proper alignment
Date: Thu, 21 Jun 2018 16:43:30 +0200	[thread overview]
Message-ID: <20180621144330.12297-9-cera@cera.cz> (raw)
In-Reply-To: <20180621144330.12297-1-cera@cera.cz>

The current position of .rss_flags field in struct rss_info causes
that fields .rsstable and .rssqueue (both 128 bytes long) crosses
cache-line boundaries. Moving it at the end properly align all fields.

Before patch:
struct rss_info {
        u64                        rss_flags;            /*     0     8 */
        u8                         rsstable[128];        /*     8   128 */
        /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
        u8                         rss_queue[128];       /*   136   128 */
        /* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */
        u8                         rss_hkey[40];         /*   264    40 */
};

After patch:
struct rss_info {
        u8                         rsstable[128];        /*     0   128 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        u8                         rss_queue[128];       /*   128   128 */
        /* --- cacheline 4 boundary (256 bytes) --- */
        u8                         rss_hkey[40];         /*   256    40 */
        u64                        rss_flags;            /*   296     8 */
};

Signed-off-by: Ivan Vecera <cera@cera.cz>
---
 drivers/net/ethernet/emulex/benet/be.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 4f805be43180..7005949dc17b 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -436,10 +436,10 @@ struct be_port_resources {
 #define be_is_os2bmc_enabled(adapter) (adapter->flags & BE_FLAGS_OS2BMC)
 
 struct rss_info {
-	u64 rss_flags;
 	u8 rsstable[RSS_INDIR_TABLE_LEN];
 	u8 rss_queue[RSS_INDIR_TABLE_LEN];
 	u8 rss_hkey[RSS_HASH_KEY_LEN];
+	u64 rss_flags;
 };
 
 #define BE_INVALID_DIE_TEMP	0xFF
-- 
2.16.4

      parent reply	other threads:[~2018-06-21 14:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 14:43 [PATCH net-next 0/8] be2net: small structures clean-up Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 1/8] be2net: remove unused old AIC info Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 2/8] be2net: remove unused old custom busy-poll fields Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 3/8] be2net: remove desc field from be_eq_obj Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 4/8] be2net: reorder fields in be_eq_obj structure Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 5/8] be2net: move txcp field in be_tx_obj to eliminate holes in the struct Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 6/8] be2net: remove unused tx_jiffies field from be_tx_stats Ivan Vecera
2018-06-21 14:43 ` [PATCH net-next 7/8] be2net: re-order fields in be_error_recovert to avoid hole Ivan Vecera
2018-06-21 14:43 ` Ivan Vecera [this message]

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=20180621144330.12297-9-cera@cera.cz \
    --to=cera@cera.cz \
    --cc=ajit.khaparde@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=sathya.perla@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.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