diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-10 05:35:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-12 02:16:16 -0400 |
commit | 52e55f3cde3ac3c7982dbc0cc67075456b135a31 (patch) | |
tree | 7f4c05309ca7d3a101db55ee5b1ae50b1d6fbdef /drivers/net/qlge | |
parent | 88051b4e4f270966b9e2ec070822513c46083fe1 (diff) |
qlge: Remove inline math for small rx buf mapping.
rx_ring->sbq_buf_len now holds the length of the mapped portion of the
buffer rather than the overall length.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r-- | drivers/net/qlge/qlge.h | 3 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 14 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index f6bd22495f55..cef930bfcc79 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -54,7 +54,8 @@ | |||
54 | #define RX_RING_SHADOW_SPACE (sizeof(u64) + \ | 54 | #define RX_RING_SHADOW_SPACE (sizeof(u64) + \ |
55 | MAX_DB_PAGES_PER_BQ(NUM_SMALL_BUFFERS) * sizeof(u64) + \ | 55 | MAX_DB_PAGES_PER_BQ(NUM_SMALL_BUFFERS) * sizeof(u64) + \ |
56 | MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64)) | 56 | MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64)) |
57 | #define SMALL_BUFFER_SIZE 256 | 57 | #define SMALL_BUFFER_SIZE 512 |
58 | #define SMALL_BUF_MAP_SIZE (SMALL_BUFFER_SIZE / 2) | ||
58 | #define LARGE_BUFFER_SIZE PAGE_SIZE | 59 | #define LARGE_BUFFER_SIZE PAGE_SIZE |
59 | #define MAX_SPLIT_SIZE 1023 | 60 | #define MAX_SPLIT_SIZE 1023 |
60 | #define QLGE_SB_PAD 32 | 61 | #define QLGE_SB_PAD 32 |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 20a118dc62e6..644077e7b549 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -1147,7 +1147,7 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
1147 | sbq_desc->index); | 1147 | sbq_desc->index); |
1148 | sbq_desc->p.skb = | 1148 | sbq_desc->p.skb = |
1149 | netdev_alloc_skb(qdev->ndev, | 1149 | netdev_alloc_skb(qdev->ndev, |
1150 | rx_ring->sbq_buf_size); | 1150 | SMALL_BUFFER_SIZE); |
1151 | if (sbq_desc->p.skb == NULL) { | 1151 | if (sbq_desc->p.skb == NULL) { |
1152 | QPRINTK(qdev, PROBE, ERR, | 1152 | QPRINTK(qdev, PROBE, ERR, |
1153 | "Couldn't get an skb.\n"); | 1153 | "Couldn't get an skb.\n"); |
@@ -1157,8 +1157,8 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
1157 | skb_reserve(sbq_desc->p.skb, QLGE_SB_PAD); | 1157 | skb_reserve(sbq_desc->p.skb, QLGE_SB_PAD); |
1158 | map = pci_map_single(qdev->pdev, | 1158 | map = pci_map_single(qdev->pdev, |
1159 | sbq_desc->p.skb->data, | 1159 | sbq_desc->p.skb->data, |
1160 | rx_ring->sbq_buf_size / | 1160 | rx_ring->sbq_buf_size, |
1161 | 2, PCI_DMA_FROMDEVICE); | 1161 | PCI_DMA_FROMDEVICE); |
1162 | if (pci_dma_mapping_error(qdev->pdev, map)) { | 1162 | if (pci_dma_mapping_error(qdev->pdev, map)) { |
1163 | QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n"); | 1163 | QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n"); |
1164 | rx_ring->sbq_clean_idx = clean_idx; | 1164 | rx_ring->sbq_clean_idx = clean_idx; |
@@ -1168,7 +1168,7 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
1168 | } | 1168 | } |
1169 | pci_unmap_addr_set(sbq_desc, mapaddr, map); | 1169 | pci_unmap_addr_set(sbq_desc, mapaddr, map); |
1170 | pci_unmap_len_set(sbq_desc, maplen, | 1170 | pci_unmap_len_set(sbq_desc, maplen, |
1171 | rx_ring->sbq_buf_size / 2); | 1171 | rx_ring->sbq_buf_size); |
1172 | *sbq_desc->addr = cpu_to_le64(map); | 1172 | *sbq_desc->addr = cpu_to_le64(map); |
1173 | } | 1173 | } |
1174 | 1174 | ||
@@ -2693,7 +2693,7 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2693 | cqicb->sbq_addr = | 2693 | cqicb->sbq_addr = |
2694 | cpu_to_le64(rx_ring->sbq_base_indirect_dma); | 2694 | cpu_to_le64(rx_ring->sbq_base_indirect_dma); |
2695 | cqicb->sbq_buf_size = | 2695 | cqicb->sbq_buf_size = |
2696 | cpu_to_le16((u16)(rx_ring->sbq_buf_size/2)); | 2696 | cpu_to_le16((u16)(rx_ring->sbq_buf_size)); |
2697 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : | 2697 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : |
2698 | (u16) rx_ring->sbq_len; | 2698 | (u16) rx_ring->sbq_len; |
2699 | cqicb->sbq_len = cpu_to_le16(bq_len); | 2699 | cqicb->sbq_len = cpu_to_le16(bq_len); |
@@ -3269,7 +3269,7 @@ static int ql_adapter_initialize(struct ql_adapter *qdev) | |||
3269 | ql_write32(qdev, FSC, mask | value); | 3269 | ql_write32(qdev, FSC, mask | value); |
3270 | 3270 | ||
3271 | ql_write32(qdev, SPLT_HDR, SPLT_HDR_EP | | 3271 | ql_write32(qdev, SPLT_HDR, SPLT_HDR_EP | |
3272 | min(SMALL_BUFFER_SIZE, MAX_SPLIT_SIZE)); | 3272 | min(SMALL_BUF_MAP_SIZE, MAX_SPLIT_SIZE)); |
3273 | 3273 | ||
3274 | /* Set RX packet routing to use port/pci function on which the | 3274 | /* Set RX packet routing to use port/pci function on which the |
3275 | * packet arrived on in addition to usual frame routing. | 3275 | * packet arrived on in addition to usual frame routing. |
@@ -3549,7 +3549,7 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3549 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; | 3549 | rx_ring->sbq_len = NUM_SMALL_BUFFERS; |
3550 | rx_ring->sbq_size = | 3550 | rx_ring->sbq_size = |
3551 | rx_ring->sbq_len * sizeof(__le64); | 3551 | rx_ring->sbq_len * sizeof(__le64); |
3552 | rx_ring->sbq_buf_size = SMALL_BUFFER_SIZE * 2; | 3552 | rx_ring->sbq_buf_size = SMALL_BUF_MAP_SIZE; |
3553 | rx_ring->type = RX_Q; | 3553 | rx_ring->type = RX_Q; |
3554 | } else { | 3554 | } else { |
3555 | /* | 3555 | /* |