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 7/8] be2net: re-order fields in be_error_recovert to avoid hole
Date: Thu, 21 Jun 2018 16:43:29 +0200	[thread overview]
Message-ID: <20180621144330.12297-8-cera@cera.cz> (raw)
In-Reply-To: <20180621144330.12297-1-cera@cera.cz>

- Unionize two u8 fields where only one of them is used depending on NIC
chipset.
- Move recovery_supported field after that union

These changes eliminate 7-bytes hole in the struct and makes it smaller
by 8 bytes.

Signed-off-by: Ivan Vecera <cera@cera.cz>
---
 drivers/net/ethernet/emulex/benet/be.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index d521364e17cf..4f805be43180 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -522,11 +522,13 @@ enum {
 };
 
 struct be_error_recovery {
-	/* Lancer error recovery variables */
-	u8 recovery_retries;
+	union {
+		u8 recovery_retries;	/* used for Lancer		*/
+		u8 recovery_state;	/* used for BEx and Skyhawk	*/
+	};
 
 	/* BEx/Skyhawk error recovery variables */
-	u8 recovery_state;
+	bool recovery_supported;
 	u16 ue_to_reset_time;		/* Time after UE, to soft reset
 					 * the chip - PF0 only
 					 */
@@ -534,7 +536,6 @@ struct be_error_recovery {
 					 * of SLIPORT_SEMAPHORE reg
 					 */
 	u16 last_err_code;
-	bool recovery_supported;
 	unsigned long probe_time;
 	unsigned long last_recovery_time;
 
-- 
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 ` Ivan Vecera [this message]
2018-06-21 14:43 ` [PATCH net-next 8/8] be2net: move rss_flags field in rss_info to ensure proper alignment Ivan Vecera

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-8-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