Commit 0cd3fdea authored by Claudiu Manoil's avatar Claudiu Manoil Committed by David S. Miller

gianfar: Optimize struct gfar_priv_tx_q for two cache lines

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: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 243bb4c6
...@@ -935,26 +935,25 @@ struct tx_q_stats { ...@@ -935,26 +935,25 @@ struct tx_q_stats {
* @txtime: coalescing value if based on time * @txtime: coalescing value if based on time
*/ */
struct gfar_priv_tx_q { struct gfar_priv_tx_q {
/* cacheline 1 */
spinlock_t txlock __attribute__ ((aligned (SMP_CACHE_BYTES))); 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 *tx_bd_base;
struct txbd8 *cur_tx; 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 tx_q_stats stats;
struct net_device *dev;
struct gfar_priv_grp *grp; struct gfar_priv_grp *grp;
u16 skb_curtx; /* cacheline 2 */
u16 skb_dirtytx; struct net_device *dev;
u16 qindex; struct sk_buff **tx_skbuff;
unsigned int tx_ring_size; struct txbd8 *dirty_tx;
unsigned int num_txbdfree; unsigned short skb_dirtytx;
unsigned short qindex;
/* Configuration info for the coalescing features */ /* Configuration info for the coalescing features */
unsigned char txcoalescing; unsigned int txcoalescing;
unsigned long txic; unsigned long txic;
unsigned short txcount; dma_addr_t tx_bd_dma_base;
unsigned short txtime;
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment