From: Ron Mercer <ron.mercer@qlogic.com>
To: davem@davemloft.net, jeff@garzik.org
Cc: netdev@vger.kernel.org, linux-driver@qlogic.com,
ron.mercer@qlogic.com, bhutchings@solarflare.com,
hch@infradead.org
Subject: [PATCH 4/5] qlge: bugfix: Fix ring length setting for rx ring, large/small
Date: Tue, 30 Dec 2008 13:12:24 -0800 [thread overview]
Message-ID: <1230671545-19084-4-git-send-email-ron.mercer@qlogic.com> (raw)
In-Reply-To: <20081230211122.GD16018@susedev.qlogic.org>
The length field for these rings is 16-bits. If the length is
the max supported 65536 then the setting should be zero.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
---
drivers/net/qlge/qlge_main.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c0e43c5..ffa2100 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2491,7 +2491,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
memset((void *)cqicb, 0, sizeof(struct cqicb));
cqicb->msix_vect = rx_ring->irq;
- cqicb->len = cpu_to_le16(rx_ring->cq_len | LEN_V | LEN_CPP_CONT);
+ bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len;
+ cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT);
cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma);
cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32);
@@ -2513,8 +2514,11 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
cpu_to_le32(rx_ring->lbq_base_indirect_dma);
cqicb->lbq_addr_hi =
cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32);
- cqicb->lbq_buf_size = cpu_to_le32(rx_ring->lbq_buf_size);
- bq_len = (u16) rx_ring->lbq_len;
+ bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 :
+ (u16) rx_ring->lbq_buf_size;
+ cqicb->lbq_buf_size = cpu_to_le16(bq_len);
+ bq_len = (rx_ring->lbq_len == 65536) ? 0 :
+ (u16) rx_ring->lbq_len;
cqicb->lbq_len = cpu_to_le16(bq_len);
rx_ring->lbq_prod_idx = rx_ring->lbq_len - 16;
rx_ring->lbq_curr_idx = 0;
@@ -2530,7 +2534,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring)
cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32);
cqicb->sbq_buf_size =
cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8);
- bq_len = (u16) rx_ring->sbq_len;
+ bq_len = (rx_ring->sbq_len == 65536) ? 0 :
+ (u16) rx_ring->sbq_len;
cqicb->sbq_len = cpu_to_le16(bq_len);
rx_ring->sbq_prod_idx = rx_ring->sbq_len - 16;
rx_ring->sbq_curr_idx = 0;
--
1.6.0
next prev parent reply other threads:[~2008-12-30 21:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 21:11 [PATCH 0/5] qlge: Fixes from PPC bringup Ron Mercer
2008-12-30 21:12 ` [PATCH 1/5] qlge: bugfix: Add missing pci_mapping_err checking Ron Mercer
2009-01-05 1:08 ` David Miller
2008-12-30 21:12 ` [PATCH 2/5] qlge: bugfix: Add missing pci_unmap_page call in receive path Ron Mercer
2009-01-05 1:08 ` David Miller
2008-12-30 21:12 ` [PATCH 3/5] qlge: bugfix: Fix shadow register endian issue Ron Mercer
2009-01-05 1:09 ` David Miller
2008-12-30 21:12 ` Ron Mercer [this message]
2009-01-05 1:09 ` [PATCH 4/5] qlge: bugfix: Fix ring length setting for rx ring, large/small David Miller
2008-12-30 21:12 ` [PATCH 5/5] qlge: bugfix: Fix register access error checking Ron Mercer
2009-01-05 1:09 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230671545-19084-4-git-send-email-ron.mercer@qlogic.com \
--to=ron.mercer@qlogic.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=hch@infradead.org \
--cc=jeff@garzik.org \
--cc=linux-driver@qlogic.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).