]> err.no Git - linux-2.6/commitdiff
[BNX2]: Separate tx producer and consumer fields
authorMichael Chan <mchan@broadcom.com>
Thu, 23 Mar 2006 09:13:43 +0000 (01:13 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Mar 2006 09:13:43 +0000 (01:13 -0800)
Put the tx producer and consumer fields in separate cache lines in
the device structure, similar to the VJ net channel queue structure.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c
drivers/net/bnx2.h

index 3f2eaf52d1971ca10eca6de5a62188bd8a685866..6ccacb5f2545cb43dab58431c5fc8080c4534a20 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/workqueue.h>
 #include <linux/crc32.h>
 #include <linux/prefetch.h>
+#include <linux/cache.h>
 
 #include "bnx2.h"
 #include "bnx2_fw.h"
index 60598849acd47674c5011418d4033b4124b59cf4..b87925f6a2283582b19a57fcb4e3b4fcece0b927 100644 (file)
@@ -3877,15 +3877,17 @@ struct bnx2 {
 #define USING_MSI_FLAG                 0x20
 #define ASF_ENABLE_FLAG                        0x40
 
-       struct tx_bd            *tx_desc_ring;
-       struct sw_bd            *tx_buf_ring;
-       u32                     tx_prod_bseq;
-       u16                     tx_prod;
-       u16                     tx_cons;
-       int                     tx_ring_size;
-
-       u16                     hw_tx_cons;
-       u16                     hw_rx_cons;
+       /* Put tx producer and consumer fields in separate cache lines. */
+
+       u32             tx_prod_bseq __attribute__((aligned(L1_CACHE_BYTES)));
+       u16             tx_prod;
+
+       struct tx_bd    *tx_desc_ring;
+       struct sw_bd    *tx_buf_ring;
+       int             tx_ring_size;
+
+       u16             tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
+       u16             hw_tx_cons;
 
 #ifdef BCM_VLAN 
        struct                  vlan_group *vlgrp;
@@ -3899,6 +3901,7 @@ struct bnx2 {
        u32                     rx_prod_bseq;
        u16                     rx_prod;
        u16                     rx_cons;
+       u16                     hw_rx_cons;
 
        u32                     rx_csum;