[ofa-general] [PATCH 2/3] RDMA/cxgb3: fix page shift calculation in build_phys_page_list()

Roland Dreier rdreier at cisco.com
Wed Jan 30 08:47:55 PST 2008


Thanks...

 > -       /* First check that we have enough alignment */
 > -       if ((*iova_start & ~PAGE_MASK) != (buffer_list[0].addr &  ~PAGE_MASK))
 > -               return ERR_PTR(-EINVAL);

I don't think we want to remove this check.  It prevents someone from
trying to register a region with a virtual address that the hardware
can't handle.

 > I'm still annoyed by the (num_phys_buf == 1) special case.  I'm wondering 
 > if it's still needed.  If you leave out that if-statement entirely, you 
 > may end up using a page size that is larger (maybe much larger) than 
 > necessary, but I think things will still work, given that the 
 > virtual-to-physical alignment constraints are respected.  If you remove 
 > the special case, you can replace the whole loop with an ffs() call.

Makes sense... let me post a patch for discussion.



More information about the general mailing list