Skip to content

Commit

Permalink
IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
Browse files Browse the repository at this point in the history
Make the rxe and rdmavt drivers use dma_virt_ops. Update the
comments that refer to the source files removed by this patch.
Remove struct ib_dma_mapping_ops. Remove ib_device.dma_ops.

Signed-off-by: Bart Van Assche <[email protected]>
Cc: Andrew Boyer <[email protected]>
Cc: Dennis Dalessandro <[email protected]>
Cc: Jonathan Toppins <[email protected]>
Cc: Alex Estrin <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
Bart Van Assche authored and dledford committed Jan 24, 2017
1 parent 99db949 commit 0bbb3b7
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 542 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/sw/rdmavt/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config INFINIBAND_RDMAVT
tristate "RDMA verbs transport library"
depends on 64BIT
select DMA_VIRT_OPS
---help---
This is a common software verbs provider for RDMA networks.
2 changes: 1 addition & 1 deletion drivers/infiniband/sw/rdmavt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt.o

rdmavt-y := vt.o ah.o cq.o dma.o mad.o mcast.o mmap.o mr.o pd.o qp.o srq.o \
rdmavt-y := vt.o ah.o cq.o mad.o mcast.o mmap.o mr.o pd.o qp.o srq.o \
trace.o

CFLAGS_trace.o = -I$(src)
198 changes: 0 additions & 198 deletions drivers/infiniband/sw/rdmavt/dma.c

This file was deleted.

53 changes: 0 additions & 53 deletions drivers/infiniband/sw/rdmavt/dma.h

This file was deleted.

8 changes: 4 additions & 4 deletions drivers/infiniband/sw/rdmavt/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ static void __rvt_free_mr(struct rvt_mr *mr)
* @acc: access flags
*
* Return: the memory region on success, otherwise returns an errno.
* Note that all DMA addresses should be created via the
* struct ib_dma_mapping_ops functions (see dma.c).
* Note that all DMA addresses should be created via the functions in
* struct dma_virt_ops.
*/
struct ib_mr *rvt_get_dma_mr(struct ib_pd *pd, int acc)
{
Expand Down Expand Up @@ -782,7 +782,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,

/*
* We use LKEY == zero for kernel virtual addresses
* (see rvt_get_dma_mr and dma.c).
* (see rvt_get_dma_mr() and dma_virt_ops).
*/
rcu_read_lock();
if (sge->lkey == 0) {
Expand Down Expand Up @@ -880,7 +880,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,

/*
* We use RKEY == zero for kernel virtual addresses
* (see rvt_get_dma_mr and dma.c).
* (see rvt_get_dma_mr() and dma_virt_ops).
*/
rcu_read_lock();
if (rkey == 0) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/sw/rdmavt/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/dma-mapping.h>
#include "vt.h"
#include "trace.h"

Expand Down Expand Up @@ -777,8 +778,7 @@ int rvt_register_device(struct rvt_dev_info *rdi)
}

/* DMA Operations */
rdi->ibdev.dma_ops =
rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;
rdi->ibdev.dev.dma_ops = rdi->ibdev.dev.dma_ops ? : &dma_virt_ops;

/* Protection Domain */
spin_lock_init(&rdi->n_pds_lock);
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/sw/rdmavt/vt.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

#include <rdma/rdma_vt.h>
#include <linux/pci.h>
#include "dma.h"
#include "pd.h"
#include "qp.h"
#include "ah.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/sw/rxe/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ config RDMA_RXE
tristate "Software RDMA over Ethernet (RoCE) driver"
depends on INET && PCI && INFINIBAND
depends on NET_UDP_TUNNEL
select DMA_VIRT_OPS
---help---
This driver implements the InfiniBand RDMA transport over
the Linux network stack. It enables a system with a
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/sw/rxe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ rdma_rxe-y := \
rxe_qp.o \
rxe_cq.o \
rxe_mr.o \
rxe_dma.o \
rxe_opcode.o \
rxe_mmap.o \
rxe_icrc.o \
Expand Down
Loading

0 comments on commit 0bbb3b7

Please sign in to comment.