netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3][net-next] gianfar: Optimize struct gfar_priv_tx_q for two cache lines
@ 2013-01-29 13:55 Claudiu Manoil
  2013-01-29 13:55 ` [PATCH 2/3][net-next] gianfar: Cleanup gfar_parse_group() code Claudiu Manoil
  2013-01-29 20:22 ` [PATCH 1/3][net-next] gianfar: Optimize struct gfar_priv_tx_q for two cache lines David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Claudiu Manoil @ 2013-01-29 13:55 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

Resize and regroup structure members to eliminate memory holes and
to pack the structure into 2 cache lines (from 3).
tx_ring_size was resized from 4 to 2 bytes and few members were re-grouped
in order to eliminate byte holes and achieve compactness.
Where possible, few members were grouped according to their usage and access
order (i.e. start_xmit vs. clean_tx_ring members), less important members
were pushed at the end.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.h |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 91bb2de..045c0d2 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -935,26 +935,25 @@ struct tx_q_stats {
  *	@txtime: coalescing value if based on time
  */
 struct gfar_priv_tx_q {
+	/* cacheline 1 */
 	spinlock_t txlock __attribute__ ((aligned (SMP_CACHE_BYTES)));
-	struct sk_buff ** tx_skbuff;
-	/* Buffer descriptor pointers */
-	dma_addr_t tx_bd_dma_base;
 	struct	txbd8 *tx_bd_base;
 	struct	txbd8 *cur_tx;
-	struct	txbd8 *dirty_tx;
+	unsigned int num_txbdfree;
+	unsigned short skb_curtx;
+	unsigned short tx_ring_size;
 	struct tx_q_stats stats;
-	struct	net_device *dev;
 	struct gfar_priv_grp *grp;
-	u16	skb_curtx;
-	u16	skb_dirtytx;
-	u16	qindex;
-	unsigned int tx_ring_size;
-	unsigned int num_txbdfree;
+	/* cacheline 2 */
+	struct net_device *dev;
+	struct sk_buff **tx_skbuff;
+	struct	txbd8 *dirty_tx;
+	unsigned short skb_dirtytx;
+	unsigned short qindex;
 	/* Configuration info for the coalescing features */
-	unsigned char txcoalescing;
+	unsigned int txcoalescing;
 	unsigned long txic;
-	unsigned short txcount;
-	unsigned short txtime;
+	dma_addr_t tx_bd_dma_base;
 };
 
 /*
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-29 20:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 13:55 [PATCH 1/3][net-next] gianfar: Optimize struct gfar_priv_tx_q for two cache lines Claudiu Manoil
2013-01-29 13:55 ` [PATCH 2/3][net-next] gianfar: Cleanup gfar_parse_group() code Claudiu Manoil
2013-01-29 13:55   ` [PATCH 3/3][net-next] gianfar: Pack struct gfar_priv_grp into three cachelines Claudiu Manoil
2013-01-29 14:35     ` David Laight
2013-01-29 15:19       ` Claudiu Manoil
2013-01-29 20:22     ` David Miller
2013-01-29 20:22   ` [PATCH 2/3][net-next] gianfar: Cleanup gfar_parse_group() code David Miller
2013-01-29 20:22 ` [PATCH 1/3][net-next] gianfar: Optimize struct gfar_priv_tx_q for two cache lines David Miller

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).