LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.25] RDMA/cxgb3: Shift calculation wrong for single sge entries.
@ 2008-02-20 23:31 Steve Wise
  2008-02-25 22:29 ` [ofa-general] " Roland Dreier
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Wise @ 2008-02-20 23:31 UTC (permalink / raw)
  To: rdreier; +Cc: netdev, general, linux-kernel


RDMA/cxgb3: Shift calculation wrong for single sge entries.

A single entry (addr 0x10001000, size 0x2000) will get converted to
page address 0x10000000 with a page size of 0x4000.  The code as it
stands doesn't address the single buffer case, but in fact it allows
the subsequent single-buffer special case to be eliminated entirely.
Because the mask now includes the (page adjusted) starting and ending
addresses, the general case works for the single buffer case as well.

Signed-off-by: Bryan Rosenburg <rosnbrg@us.ibm.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/iwch_mem.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_mem.c b/drivers/infiniband/hw/cxgb3/iwch_mem.c
index 73bfd16..b8797c6 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_mem.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_mem.c
@@ -136,14 +136,8 @@ int build_phys_page_list(struct ib_phys_buf *buffer_list,
 
 	/* Find largest page shift we can use to cover buffers */
 	for (*shift = PAGE_SHIFT; *shift < 27; ++(*shift))
-		if (num_phys_buf > 1) {
-			if ((1ULL << *shift) & mask)
-				break;
-		} else
-			if (1ULL << *shift >=
-			    buffer_list[0].size +
-			    (buffer_list[0].addr & ((1ULL << *shift) - 1)))
-				break;
+		if ((1ULL << *shift) & mask)
+			break;
 
 	buffer_list[0].size += buffer_list[0].addr & ((1ULL << *shift) - 1);
 	buffer_list[0].addr &= ~0ull << *shift;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ofa-general] [PATCH 2.6.25] RDMA/cxgb3: Shift calculation wrong for single sge entries.
  2008-02-20 23:31 [PATCH 2.6.25] RDMA/cxgb3: Shift calculation wrong for single sge entries Steve Wise
@ 2008-02-25 22:29 ` Roland Dreier
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2008-02-25 22:29 UTC (permalink / raw)
  To: Steve Wise; +Cc: netdev, linux-kernel, general

Thanks, applied, although I assume based on the Signed-off-by line
that you left out a

  From: Bryan Rosenburg <rosnbrg@us.ibm.com>

at the top (to get the authorship in git correctly).

 > RDMA/cxgb3: Shift calculation wrong for single sge entries.

BTW, there's no need to duplicate the subject line in the message
body, but if you are going to do it, please put a "Subject:" before
it.  Otherwise I just have to edit it out by hand to avoid git putting
the subject in twice.

 - R.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-25 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 23:31 [PATCH 2.6.25] RDMA/cxgb3: Shift calculation wrong for single sge entries Steve Wise
2008-02-25 22:29 ` [ofa-general] " Roland Dreier

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).