summaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge.h
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-06-10 15:49:34 +0000
committerDavid S. Miller <davem@davemloft.net>2009-06-11 02:37:05 -0700
commitb8facca01ba381c3f8ff2391fbe3860ebc6a6bdc (patch)
tree11e7b481ab9436d5cbaf616101b46aa67cb4bc36 /drivers/net/qlge/qlge.h
parent88c55e3cbd1bd4e8f52dcda67456763710a025a5 (diff)
downloadblackbird-op-linux-b8facca01ba381c3f8ff2391fbe3860ebc6a6bdc.tar.gz
blackbird-op-linux-b8facca01ba381c3f8ff2391fbe3860ebc6a6bdc.zip
qlge: Allow RX buf rings to be > than 4096 bytes.
RX buffer rings can be comprised of non-contiguous fixed size chunks of memory. The ring is given to the hardware as a pointer to a location that stores the location of the queue. If the queue is greater than 4096 bytes then the hardware gets a list of said pointers. This patch addes the necessary logic to generate the list if the queue size exceeds 4096. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge.h')
-rw-r--r--drivers/net/qlge/qlge.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index b1ddfd1b8d53..156e02e8905d 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -41,7 +41,18 @@
#define NUM_SMALL_BUFFERS 512
#define NUM_LARGE_BUFFERS 512
+#define DB_PAGE_SIZE 4096
+
+/* Calculate the number of (4k) pages required to
+ * contain a buffer queue of the given length.
+ */
+#define MAX_DB_PAGES_PER_BQ(x) \
+ (((x * sizeof(u64)) / DB_PAGE_SIZE) + \
+ (((x * sizeof(u64)) % DB_PAGE_SIZE) ? 1 : 0))
+#define RX_RING_SHADOW_SPACE (sizeof(u64) + \
+ MAX_DB_PAGES_PER_BQ(NUM_SMALL_BUFFERS) * sizeof(u64) + \
+ MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64))
#define SMALL_BUFFER_SIZE 256
#define LARGE_BUFFER_SIZE PAGE_SIZE
#define MAX_SPLIT_SIZE 1023
@@ -65,8 +76,6 @@
#define TX_DESC_PER_OAL 0
#endif
-#define DB_PAGE_SIZE 4096
-
/* MPI test register definitions. This register
* is used for determining alternate NIC function's
* PCI->func number.
OpenPOWER on IntegriCloud