Re: [PATCH] IB: Refactor umem to use linear SG table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Or,
	umem_get internally calls dma_map_sg, which is punted to Intel's IOMMU driver's dma_map_sg. The Intel's IOMMU driver will program the IOMMU page tables, to monitor DMA's from the addresses in it's page tables to prevent cache coherency issues between DMA devices and CPU's.  usNIC also programs the Intel IOMMU via the API in iommu.h, for translating virtual address to physical address.  As part of programming the translation, the Intel IOMMU automatically will take care of cache coherency issues on these translation entries.  However, if a page is programmed in the IOMMU via the dma_map_sg API and the iommu API, the Intel IOMMU gets confused (confusion is that the cache coherency protocol ceases to work).  Therefore, usNIC cannot call umem_get.

Any particular reason that the code in usNIC that walks the chunk sg's isn't ported to the linear SG table?

Upinder

On Jan 28, 2014, at 5:01 AM, Or Gerlitz <ogerlitz@xxxxxxxxxxxx> wrote:

> On 28/01/2014 13:40, Or Gerlitz wrote:
>> From: Yishai Hadas<yishaih@xxxxxxxxxxxx>
>> 
>> This patch does refactoring of the IB core umem code and vendor drivers to use
>> linear SG table instead of chunk list. With this change the relevant code becomes
>> more clear, no need for nested loops to build and use umem.
>> 
>> The patch includes: umem changes to work with linear SG table and Vendors driver
>> changes to use SG instead of chunk list.
>> 
>> Cc: Faisal Latif<faisal.latif@xxxxxxxxx>
>> Cc: Mike Marciniszyn<infinipath@xxxxxxxxx>
>> Cc: Hoang-Nam Nguyen<hnguyen@xxxxxxxxxx>
>> Cc: Steve Wise<swise@xxxxxxxxxxx>
>> Signed-off-by: Shachar Raindel<raindel@xxxxxxxxxxxx>
>> Signed-off-by: Yishai Hadas<yishaih@xxxxxxxxxxxx>
>> ---
>>  drivers/infiniband/core/umem.c               |  120 ++++++-------
>>  drivers/infiniband/hw/amso1100/c2_provider.c |   23 +--
>>  drivers/infiniband/hw/cxgb3/iwch_provider.c  |   19 +--
>>  drivers/infiniband/hw/cxgb4/mem.c            |   39 ++---
>>  drivers/infiniband/hw/ehca/ehca_classes.h    |    2 +-
>>  drivers/infiniband/hw/ehca/ehca_mrmw.c       |  245 ++++++++++---------------
>>  drivers/infiniband/hw/ipath/ipath_mr.c       |   39 ++---
>>  drivers/infiniband/hw/mlx4/doorbell.c        |    4 +-
>>  drivers/infiniband/hw/mlx4/mr.c              |   39 ++--
>>  drivers/infiniband/hw/mlx5/doorbell.c        |    4 +-
>>  drivers/infiniband/hw/mlx5/mem.c             |   80 ++++----
>>  drivers/infiniband/hw/mthca/mthca_provider.c |   42 ++---
>>  drivers/infiniband/hw/nes/nes_verbs.c        |  253 +++++++++++++-------------
>>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c  |   66 ++++----
>>  drivers/infiniband/hw/qib/qib_mr.c           |   14 +-
>>  include/rdma/ib_umem.h                       |   11 +-
>>  16 files changed, 448 insertions(+), 552 deletions(-)
> 
> While looking on this patch I suddenly noticed that unlike the rest of the hw drivers, the usnic driver doesn't call ib_umem_get but rather implements it -- while duplicating code/functionality which exists in the IB core, agree? why?
> 
> Or.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux