projects/linux·commit 877f075a

Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

877f075a · Linus Torvalds <[email protected]> · 2014-04-03 16:57:19 -07:00

Pull infiniband updates from Roland Dreier:
 "Main batch of InfiniBand/RDMA changes for 3.15:

   - The biggest change is core API extensions and mlx5 low-level driver
     support for handling DIF/DIX-style protection information, and the
     addition of PI support to the iSER initiator.  Target support will
     be arriving shortly through the SCSI target tree.

   - A nice simplification to the "umem" memory pinning library now that
     we have chained sg lists.  Kudos to Yishai Hadas for realizing our
     code didn't have to be so crazy.

   - Another nice simplification to the sg wrappers used by qib, ipath
     and ehca to handle their mapping of memory to adapter.

   - The usual batch of fixes to bugs found by static checkers etc.
     from intrepid people like Dan Carpenter and Yann Droneaud.

   - A large batch of cxgb4, ocrdma, qib driver updates"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (102 commits)
  RDMA/ocrdma: Unregister inet notifier when unloading ocrdma
  RDMA/ocrdma: Fix warnings about pointer <-> integer casts
  RDMA/ocrdma: Code clean-up
  RDMA/ocrdma: Display FW version
  RDMA/ocrdma: Query controller information
  RDMA/ocrdma: Support non-embedded mailbox commands
  RDMA/ocrdma: Handle CQ overrun error
  RDMA/ocrdma: Display proper value for max_mw
  RDMA/ocrdma: Use non-zero tag in SRQ posting
  RDMA/ocrdma: Memory leak fix in ocrdma_dereg_mr()
  RDMA/ocrdma: Increment abi version count
  RDMA/ocrdma: Update version string
  be2net: Add abi version between be2net and ocrdma
  RDMA/ocrdma: ABI versioning between ocrdma and be2net
  RDMA/ocrdma: Allow DPP QP creation
  RDMA/ocrdma: Read ASIC_ID register to select asic_gen
  RDMA/ocrdma: SQ and RQ doorbell offset clean up
  RDMA/ocrdma: EQ full catastrophe avoidance
  RDMA/cxgb4: Disable DSGL use by default
  RDMA/cxgb4: rx_data() needs to hold the ep mutex
  ...
Commit
877f075aac900288ce2e6a64075cceff09210a7e
Parents
3cf59142 · f7eaa7ed

Merge commit. Changes below are compared with the first parent: 3cf59142.

Changes

88 files changed · +4634 −1475

FileStatusAddDelContent
drivers/infiniband/core/cm.cmodified+0−17View file
drivers/infiniband/core/cma.cmodified+0−26View file
drivers/infiniband/core/mad.cmodified+14−0View file
drivers/infiniband/core/umem.cmodified+56−64View file
drivers/infiniband/core/verbs.cmodified+47−0View file
drivers/infiniband/hw/amso1100/c2_provider.cmodified+9−14View file
drivers/infiniband/hw/cxgb3/iwch_provider.cmodified+7−12View file
drivers/infiniband/hw/cxgb4/cm.cmodified+72−38View file
drivers/infiniband/hw/cxgb4/cq.cmodified+24−7View file
drivers/infiniband/hw/cxgb4/device.cmodified+4−2View file
drivers/infiniband/hw/cxgb4/iw_cxgb4.hmodified+2−0View file
drivers/infiniband/hw/cxgb4/mem.cmodified+29−26View file
drivers/infiniband/hw/cxgb4/qp.cmodified+5−3View file
drivers/infiniband/hw/ehca/ehca_classes.hmodified+1−1View file
drivers/infiniband/hw/ehca/ehca_cq.cmodified+1−0View file
drivers/infiniband/hw/ehca/ehca_mrmw.cmodified+94−163View file
drivers/infiniband/hw/ipath/ipath_diag.cmodified+25−41View file
drivers/infiniband/hw/ipath/ipath_dma.cmodified+15−28View file
drivers/infiniband/hw/ipath/ipath_mr.cmodified+17−22View file
drivers/infiniband/hw/mlx4/doorbell.cmodified+1−3View file
drivers/infiniband/hw/mlx4/main.cmodified+6−5View file
drivers/infiniband/hw/mlx4/mr.cmodified+19−20View file
drivers/infiniband/hw/mlx4/qp.cmodified+1−1View file
drivers/infiniband/hw/mlx5/cq.cmodified+62−0View file
drivers/infiniband/hw/mlx5/doorbell.cmodified+1−3View file
drivers/infiniband/hw/mlx5/main.cmodified+12−0View file
drivers/infiniband/hw/mlx5/mem.cmodified+40−40View file
drivers/infiniband/hw/mlx5/mlx5_ib.hmodified+14−0View file
drivers/infiniband/hw/mlx5/mr.cmodified+157−0View file
drivers/infiniband/hw/mlx5/qp.cmodified+499−41View file
drivers/infiniband/hw/mthca/mthca_provider.cmodified+20−23View file
drivers/infiniband/hw/nes/nes_cm.cmodified+91−30View file
drivers/infiniband/hw/nes/nes_cm.hmodified+3−0View file
drivers/infiniband/hw/nes/nes_user.hmodified+3−2View file
drivers/infiniband/hw/nes/nes_verbs.cmodified+131−130View file
drivers/infiniband/hw/nes/nes_verbs.hmodified+1−0View file
drivers/infiniband/hw/ocrdma/Makefilemodified+1−1View file
drivers/infiniband/hw/ocrdma/ocrdma.hmodified+96−14View file
drivers/infiniband/hw/ocrdma/ocrdma_abi.hmodified+3−4View file
drivers/infiniband/hw/ocrdma/ocrdma_ah.cmodified+1−1View file
drivers/infiniband/hw/ocrdma/ocrdma_hw.cmodified+240−59View file
drivers/infiniband/hw/ocrdma/ocrdma_hw.hmodified+4−2View file
drivers/infiniband/hw/ocrdma/ocrdma_main.cmodified+74−7View file
drivers/infiniband/hw/ocrdma/ocrdma_sli.hmodified+254−7View file
drivers/infiniband/hw/ocrdma/ocrdma_stats.cadded+623−0View file
drivers/infiniband/hw/ocrdma/ocrdma_stats.hadded+54−0View file
drivers/infiniband/hw/ocrdma/ocrdma_verbs.cmodified+128−105View file
drivers/infiniband/hw/qib/qib.hmodified+9−3View file
drivers/infiniband/hw/qib/qib_diag.cmodified+26−26View file
drivers/infiniband/hw/qib/qib_dma.cmodified+4−17View file
drivers/infiniband/hw/qib/qib_file_ops.cmodified+3−2View file
drivers/infiniband/hw/qib/qib_fs.cmodified+1−0View file
drivers/infiniband/hw/qib/qib_iba6120.cmodified+6−5View file
drivers/infiniband/hw/qib/qib_iba7220.cmodified+6−6View file
drivers/infiniband/hw/qib/qib_iba7322.cmodified+14−23View file
drivers/infiniband/hw/qib/qib_init.cmodified+67−29View file
drivers/infiniband/hw/qib/qib_mad.cmodified+36−8View file
drivers/infiniband/hw/qib/qib_mr.cmodified+5−9View file
drivers/infiniband/hw/qib/qib_rc.cmodified+1−1View file
drivers/infiniband/hw/qib/qib_ruc.cmodified+1−0View file
drivers/infiniband/hw/qib/qib_ud.cmodified+3−3View file
drivers/infiniband/hw/qib/qib_user_sdma.cmodified+123−13View file
drivers/infiniband/hw/qib/qib_verbs.cmodified+4−4View file
drivers/infiniband/hw/qib/qib_verbs.hmodified+12−4View file
drivers/infiniband/hw/usnic/usnic_uiom.cmodified+1−1View file
drivers/infiniband/ulp/iser/iscsi_iser.cmodified+64−29View file
drivers/infiniband/ulp/iser/iscsi_iser.hmodified+62−23View file
drivers/infiniband/ulp/iser/iser_initiator.cmodified+109−45View file
drivers/infiniband/ulp/iser/iser_memory.cmodified+345−125View file
drivers/infiniband/ulp/iser/iser_verbs.cmodified+235−90View file
drivers/infiniband/ulp/srp/ib_srp.cmodified+55−28View file
drivers/infiniband/ulp/srp/ib_srp.hmodified+1−0View file
drivers/net/ethernet/emulex/benet/be_roce.cmodified+6−0View file
drivers/net/ethernet/emulex/benet/be_roce.hmodified+3−0View file
drivers/net/ethernet/mellanox/mlx5/core/main.cmodified+1−0View file
drivers/net/ethernet/mellanox/mlx5/core/mr.cmodified+85−0View file
drivers/scsi/libiscsi.cmodified+32−0View file
drivers/scsi/scsi_transport_srp.cmodified+1−0View file
include/linux/mlx5/cq.hmodified+1−0View file
include/linux/mlx5/device.hmodified+43−0View file
include/linux/mlx5/driver.hmodified+41−0View file
include/linux/mlx5/qp.hmodified+67−0View file
include/rdma/ib_cm.hmodified+0−1View file
include/rdma/ib_umem.hmodified+3−8View file
include/rdma/ib_verbs.hmodified+192−9View file
include/scsi/libiscsi.hmodified+4−0View file
include/scsi/scsi_transport_iscsi.hmodified+1−0View file
include/scsi/scsi_transport_srp.hmodified+0−1View file

Only the first 600 diff lines are shown. Download the complete patch.

drivers/infiniband/core/cm.c

View file
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 0601b9d..c323917 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -349,23 +349,6 @@ static void cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
grh, &av->ah_attr);
}
-int ib_update_cm_av(struct ib_cm_id *id, const u8 *smac, const u8 *alt_smac)
-{
- struct cm_id_private *cm_id_priv;
-
- cm_id_priv = container_of(id, struct cm_id_private, id);
-
- if (smac != NULL)
- memcpy(cm_id_priv->av.smac, smac, sizeof(cm_id_priv->av.smac));
-
- if (alt_smac != NULL)
- memcpy(cm_id_priv->alt_av.smac, alt_smac,
- sizeof(cm_id_priv->alt_av.smac));
-
- return 0;
-}
-EXPORT_SYMBOL(ib_update_cm_av);
-
static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
{
struct cm_device *cm_dev;

drivers/infiniband/core/cma.c

View file
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 199958d..42c3058 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1284,15 +1284,6 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
struct rdma_id_private *listen_id, *conn_id;
struct rdma_cm_event event;
int offset, ret;
- u8 smac[ETH_ALEN];
- u8 alt_smac[ETH_ALEN];
- u8 *psmac = smac;
- u8 *palt_smac = alt_smac;
- int is_iboe = ((rdma_node_get_transport(cm_id->device->node_type) ==
- RDMA_TRANSPORT_IB) &&
- (rdma_port_get_link_layer(cm_id->device,
- ib_event->param.req_rcvd.port) ==
- IB_LINK_LAYER_ETHERNET));
listen_id = cm_id->context;
if (!cma_check_req_qp_type(&listen_id->id, ib_event))
@@ -1336,28 +1327,11 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
ret = conn_id->id.event_handler(&conn_id->id, &event);
if (ret)
goto err3;
-
- if (is_iboe) {
- if (ib_event->param.req_rcvd.primary_path != NULL)
- rdma_addr_find_smac_by_sgid(
- &ib_event->param.req_rcvd.primary_path->sgid,
- psmac, NULL);
- else
- psmac = NULL;
- if (ib_event->param.req_rcvd.alternate_path != NULL)
- rdma_addr_find_smac_by_sgid(
- &ib_event->param.req_rcvd.alternate_path->sgid,
- palt_smac, NULL);
- else
- palt_smac = NULL;
- }
/*
* Acquire mutex to prevent user executing rdma_destroy_id()
* while we're accessing the cm_id.
*/
mutex_lock(&lock);
- if (is_iboe)
- ib_update_cm_av(cm_id, psmac, palt_smac);
if (cma_comp(conn_id, RDMA_CM_CONNECT) &&
(conn_id->id.qp_type != IB_QPT_UD))
ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0);

drivers/infiniband/core/mad.c

View file
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 4c837e6..ab31f13 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -1022,12 +1022,21 @@ int ib_send_mad(struct ib_mad_send_wr_private *mad_send_wr)
mad_send_wr->send_buf.mad,
sge[0].length,
DMA_TO_DEVICE);
+ if (unlikely(ib_dma_mapping_error(mad_agent->device, sge[0].addr)))
+ return -ENOMEM;
+
mad_send_wr->header_mapping = sge[0].addr;
sge[1].addr = ib_dma_map_single(mad_agent->device,
ib_get_payload(mad_send_wr),
sge[1].length,
DMA_TO_DEVICE);
+ if (unlikely(ib_dma_mapping_error(mad_agent->device, sge[1].addr))) {
+ ib_dma_unmap_single(mad_agent->device,
+ mad_send_wr->header_mapping,
+ sge[0].length, DMA_TO_DEVICE);
+ return -ENOMEM;
+ }
mad_send_wr->payload_mapping = sge[1].addr;
spin_lock_irqsave(&qp_info->send_queue.lock, flags);
@@ -2590,6 +2599,11 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info,
sizeof *mad_priv -
sizeof mad_priv->header,
DMA_FROM_DEVICE);
+ if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device,
+ sg_list.addr))) {
+ ret = -ENOMEM;
+ break;
+ }
mad_priv->header.mapping = sg_list.addr;
recv_wr.wr_id = (unsigned long)&mad_priv->header.mad_list;
mad_priv->header.mad_list.mad_queue = recv_queue;

drivers/infiniband/core/umem.c

View file
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index a841123..a3a2e9c 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -42,29 +42,29 @@
#include "uverbs.h"
-#define IB_UMEM_MAX_PAGE_CHUNK \
- ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) / \
- ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] - \
- (void *) &((struct ib_umem_chunk *) 0)->page_list[0]))
static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty)
{
- struct ib_umem_chunk *chunk, *tmp;
+ struct scatterlist *sg;
+ struct page *page;
int i;
- list_for_each_entry_safe(chunk, tmp, &umem->chunk_list, list) {
- ib_dma_unmap_sg(dev, chunk->page_list,
- chunk->nents, DMA_BIDIRECTIONAL);
- for (i = 0; i < chunk->nents; ++i) {
- struct page *page = sg_page(&chunk->page_list[i]);
+ if (umem->nmap > 0)
+ ib_dma_unmap_sg(dev, umem->sg_head.sgl,
+ umem->nmap,
+ DMA_BIDIRECTIONAL);
- if (umem->writable && dirty)
- set_page_dirty_lock(page);
- put_page(page);
- }
+ for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {
- kfree(chunk);
+ page = sg_page(sg);
+ if (umem->writable && dirty)
+ set_page_dirty_lock(page);
+ put_page(page);
}
+
+ sg_free_table(&umem->sg_head);
+ return;
+
}
/**
@@ -81,15 +81,15 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
struct ib_umem *umem;
struct page **page_list;
struct vm_area_struct **vma_list;
- struct ib_umem_chunk *chunk;
unsigned long locked;
unsigned long lock_limit;
unsigned long cur_base;
unsigned long npages;
int ret;
- int off;
int i;
DEFINE_DMA_ATTRS(attrs);
+ struct scatterlist *sg, *sg_list_start;
+ int need_release = 0;
if (dmasync)
dma_set_attr(DMA_ATTR_WRITE_BARRIER, &attrs);
@@ -97,7 +97,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
if (!can_do_mlock())
return ERR_PTR(-EPERM);
- umem = kmalloc(sizeof *umem, GFP_KERNEL);
+ umem = kzalloc(sizeof *umem, GFP_KERNEL);
if (!umem)
return ERR_PTR(-ENOMEM);
@@ -117,8 +117,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
/* We assume the memory is from hugetlb until proved otherwise */
umem->hugetlb = 1;
- INIT_LIST_HEAD(&umem->chunk_list);
-
page_list = (struct page **) __get_free_page(GFP_KERNEL);
if (!page_list) {
kfree(umem);
@@ -147,7 +145,18 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
cur_base = addr & PAGE_MASK;
- ret = 0;
+ if (npages == 0) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ ret = sg_alloc_table(&umem->sg_head, npages, GFP_KERNEL);
+ if (ret)
+ goto out;
+
+ need_release = 1;
+ sg_list_start = umem->sg_head.sgl;
+
while (npages) {
ret = get_user_pages(current, current->mm, cur_base,
min_t(unsigned long, npages,
@@ -157,54 +166,38 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
if (ret < 0)
goto out;
+ umem->npages += ret;
cur_base += ret * PAGE_SIZE;
npages -= ret;
- off = 0;
-
- while (ret) {
- chunk = kmalloc(sizeof *chunk + sizeof (struct scatterlist) *
- min_t(int, ret, IB_UMEM_MAX_PAGE_CHUNK),
- GFP_KERNEL);
- if (!chunk) {
- ret = -ENOMEM;
- goto out;
- }
-
- chunk->nents = min_t(int, ret, IB_UMEM_MAX_PAGE_CHUNK);
- sg_init_table(chunk->page_list, chunk->nents);
- for (i = 0; i < chunk->nents; ++i) {
- if (vma_list &&
- !is_vm_hugetlb_page(vma_list[i + off]))
- umem->hugetlb = 0;
- sg_set_page(&chunk->page_list[i], page_list[i + off], PAGE_SIZE, 0);
- }
-
- chunk->nmap = ib_dma_map_sg_attrs(context->device,
- &chunk->page_list[0],
- chunk->nents,
- DMA_BIDIRECTIONAL,
- &attrs);
- if (chunk->nmap <= 0) {
- for (i = 0; i < chunk->nents; ++i)
- put_page(sg_page(&chunk->page_list[i]));
- kfree(chunk);
-
- ret = -ENOMEM;
- goto out;
- }
-
- ret -= chunk->nents;
- off += chunk->nents;
- list_add_tail(&chunk->list, &umem->chunk_list);
+ for_each_sg(sg_list_start, sg, ret, i) {
+ if (vma_list && !is_vm_hugetlb_page(vma_list[i]))
+ umem->hugetlb = 0;
+
+ sg_set_page(sg, page_list[i], PAGE_SIZE, 0);
}
- ret = 0;
+ /* preparing for next loop */
+ sg_list_start = sg;
}
+ umem->nmap = ib_dma_map_sg_attrs(context->device,
+ umem->sg_head.sgl,
+ umem->npages,
+ DMA_BIDIRECTIONAL,
+ &attrs);
+
+ if (umem->nmap <= 0) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = 0;
+
out:
if (ret < 0) {
- __ib_umem_release(context->device, umem, 0);
+ if (need_release)
+ __ib_umem_release(context->device, umem, 0);
kfree(umem);
} else
current->mm->pinned_vm = locked;
@@ -278,17 +271,16 @@ EXPORT_SYMBOL(ib_umem_release);
int ib_umem_page_count(struct ib_umem *umem)
{
- struct ib_umem_chunk *chunk;
int shift;
int i;
int n;
+ struct scatterlist *sg;
shift = ilog2(umem->page_size);
n = 0;
- list_for_each_entry(chunk, &umem->chunk_list, list)
- for (i = 0; i < chunk->nmap; ++i)
- n += sg_dma_len(&chunk->page_list[i]) >> shift;
+ for_each_sg(umem->sg_head.sgl, sg, umem->nmap, i)
+ n += sg_dma_len(sg) >> shift;
return n;
}

drivers/infiniband/core/verbs.c

View file
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 3ac7951..92525f8 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1169,6 +1169,45 @@ int ib_dereg_mr(struct ib_mr *mr)
}
EXPORT_SYMBOL(ib_dereg_mr);
+struct ib_mr *ib_create_mr(struct ib_pd *pd,
+ struct ib_mr_init_attr *mr_init_attr)
+{
+ struct ib_mr *mr;
+
+ if (!pd->device->create_mr)
+ return ERR_PTR(-ENOSYS);
+
+ mr = pd->device->create_mr(pd, mr_init_attr);
+
+ if (!IS_ERR(mr)) {
+ mr->device = pd->device;
+ mr->pd = pd;
+ mr->uobject = NULL;
+ atomic_inc(&pd->usecnt);
+ atomic_set(&mr->usecnt, 0);
+ }
+
+ return mr;
+}
+EXPORT_SYMBOL(ib_create_mr);
+
+int ib_destroy_mr(struct ib_mr *mr)
+{
+ struct ib_pd *pd;
+ int ret;
+
+ if (atomic_read(&mr->usecnt))
+ return -EBUSY;
+
+ pd = mr->pd;
+ ret = mr->device->destroy_mr(mr);
+ if (!ret)
+ atomic_dec(&pd->usecnt);
+
+ return ret;
+}
+EXPORT_SYMBOL(ib_destroy_mr);
+
struct ib_mr *ib_alloc_fast_reg_mr(struct ib_pd *pd, int max_page_list_len)
{
struct ib_mr *mr;
@@ -1398,3 +1437,11 @@ int ib_destroy_flow(struct ib_flow *flow_id)
return err;
}
EXPORT_SYMBOL(ib_destroy_flow);
+
+int ib_check_mr_status(struct ib_mr *mr, u32 check_mask,
+ struct ib_mr_status *mr_status)
+{
+ return mr->device->check_mr_status ?
+ mr->device->check_mr_status(mr, check_mask, mr_status) : -ENOSYS;
+}
+EXPORT_SYMBOL(ib_check_mr_status);

drivers/infiniband/hw/amso1100/c2_provider.c

View file
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c
index 07eb3a8..8af33cf 100644
--- a/drivers/infiniband/hw/amso1100/c2_provider.c
+++ b/drivers/infiniband/hw/amso1100/c2_provider.c
@@ -431,9 +431,9 @@ static struct ib_mr *c2_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
u64 *pages;
u64 kva = 0;
int shift, n, len;
- int i, j, k;
+ int i, k, entry;
int err = 0;
- struct ib_umem_chunk *chunk;
+ struct scatterlist *sg;
struct c2_pd *c2pd = to_c2pd(pd);
struct c2_mr *c2mr;
@@ -452,10 +452,7 @@ static struct ib_mr *c2_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
}
shift = ffs(c2mr->umem->page_size) - 1;
-
- n = 0;
- list_for_each_entry(chunk, &c2mr->umem->chunk_list, list)
- n += chunk->nents;
+ n = c2mr->umem->nmap;
pages = kmalloc(n * sizeof(u64), GFP_KERNEL);
if (!pages) {
@@ -464,14 +461,12 @@ static struct ib_mr *c2_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
}
i = 0;
- list_for_each_entry(chunk, &c2mr->umem->chunk_list, list) {
- for (j = 0; j < chunk->nmap; ++j) {
- len = sg_dma_len(&chunk->page_list[j]) >> shift;
- for (k = 0; k < len; ++k) {
- pages[i++] =
- sg_dma_address(&chunk->page_list[j]) +
- (c2mr->umem->page_size * k);
- }
+ for_each_sg(c2mr->umem->sg_head.sgl, sg, c2mr->umem->nmap, entry) {
+ len = sg_dma_len(sg) >> shift;
+ for (k = 0; k < len; ++k) {
+ pages[i++] =
+ sg_dma_address(sg) +
+ (c2mr->umem->page_size * k);
}
}

drivers/infiniband/hw/cxgb3/iwch_provider.c

View file
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index d228383..811b24a 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -618,14 +618,13 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
{
__be64 *pages;
int shift, n, len;
- int i, j, k;
+ int i, k, entry;
int err = 0;
- struct ib_umem_chunk *chunk;
struct iwch_dev *rhp;
struct iwch_pd *php;
struct iwch_mr *mhp;
struct iwch_reg_user_mr_resp uresp;
-
+ struct scatterlist *sg;
PDBG("%s ib_pd %p\n", __func__, pd);
php = to_iwch_pd(pd);
@@ -645,9 +644,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
shift = ffs(mhp->umem->page_size) - 1;
- n = 0;
- list_for_each_entry(chunk, &mhp->umem->chunk_list, list)
- n += chunk->nents;
+ n = mhp->umem->nmap;
err = iwch_alloc_pbl(mhp, n);
if (err)
@@ -661,12 +658,10 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
i = n = 0;
- list_for_each_entry(chunk, &mhp->umem->chunk_list, list)
- for (j = 0; j < chunk->nmap; ++j) {
- len = sg_dma_len(&chunk->page_list[j]) >> shift;
+ for_each_sg(mhp->umem->sg_head.sgl, sg, mhp->umem->nmap, entry) {
+ len = sg_dma_len(sg) >> shift;
for (k = 0; k < len; ++k) {
- pages[i++] = cpu_to_be64(sg_dma_address(
- &chunk->page_list[j]) +
+ pages[i++] = cpu_to_be64(sg_dma_address(sg) +
mhp->umem->page_size * k);
if (i == PAGE_SIZE / sizeof *pages) {
err = iwch_write_pbl(mhp, pages, i, n);
@@ -676,7 +671,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
i = 0;
}
}
- }
+ }
if (i)
err = iwch_write_pbl(mhp, pages, i, n);

drivers/infiniband/hw/cxgb4/cm.c

View file
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 7e98a58..02436d5 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -98,9 +98,9 @@ int c4iw_debug;
module_param(c4iw_debug, int, 0644);
MODULE_PARM_DESC(c4iw_debug, "Enable debug logging (default=0)");
-static int peer2peer;
+static int peer2peer = 1;
module_param(peer2peer, int, 0644);
-MODULE_PARM_DESC(peer2peer, "Support peer2peer ULPs (default=0)");
+MODULE_PARM_DESC(peer2peer, "Support peer2peer ULPs (default=1)");
static int p2p_type = FW_RI_INIT_P2PTYPE_READ_REQ;
module_param(p2p_type, int, 0644);
@@ -400,7 +400,8 @@ static struct dst_entry *find_route(struct c4iw_dev *dev, __be32 local_ip,
n = dst_neigh_lookup(&rt->dst, &peer_ip);
if (!n)
return NULL;
- if (!our_interface(dev, n->dev)) {
+ if (!our_interface(dev, n->dev) &&
+ !(n->dev->flags & IFF_LOOPBACK)) {
dst_release(&rt->dst);
return NULL;
}
@@ -759,8 +760,9 @@ static void send_mpa_req(struct c4iw_ep *ep, struct sk_buff *skb,
ep->mpa_skb = skb;
c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
start_ep_timer(ep);
- state_set(&ep->com, MPA_REQ_SENT);
+ __state_set(&ep->com, MPA_REQ_SENT);
ep->mpa_attr.initiator = 1;
+ ep->snd_seq += mpalen;
return;
}
@@ -840,6 +842,7 @@ static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen)
t4_set_arp_err_handler(skb, NULL, arp_failure_discard);
BUG_ON(ep->mpa_skb);
ep->mpa_skb = skb;
+ ep->snd_seq += mpalen;
return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
}
@@ -923,7 +926,8 @@ static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen)
skb_get(skb);
t4_set_arp_err_handler(skb, NULL, arp_failure_discard);
ep->mpa_skb = skb;
- state_set(&ep->com, MPA_REP_SENT);
+ __state_set(&ep->com, MPA_REP_SENT);
+ ep->snd_seq += mpalen;
return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
}
@@ -940,6 +944,7 @@ static int act_establish(struct c4iw_dev *dev, struct sk_buff *skb)
PDBG("%s ep %p tid %u snd_isn %u rcv_isn %u\n", __func__, ep, tid,
be32_to_cpu(req->snd_isn), be32_to_cpu(req->rcv_isn));
+ mutex_lock(&ep->com.mutex);
dst_confirm(ep->dst);
/* setup the hwtid for this connection */
@@ -963,17 +968,18 @@ static int act_establish(struct c4iw_dev *dev, struct sk_buff *skb)
send_mpa_req(ep, skb, 1);
else
send_mpa_req(ep, skb, mpa_rev);
-
+ mutex_unlock(&ep->com.mutex);
return 0;
}
-static void close_complete_upcall(struct c4iw_ep *ep)
+static void close_complete_upcall(struct c4iw_ep *ep, int status)
{
struct iw_cm_event event;
PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
memset(&event, 0, sizeof(event));
event.event = IW_CM_EVENT_CLOSE;
+ event.status = status;
if (ep->com.cm_id) {
PDBG("close complete delivered ep %p cm_id %p tid %u\n",
ep, ep->com.cm_id, ep->hwtid);
@@ -987,7 +993,6 @@ static void close_complete_upcall(struct c4iw_ep *ep)
static int abort_connection(struct c4iw_ep *ep, struct sk_buff *skb, gfp_t gfp)
{
PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
- close_complete_upcall(ep);
state_set(&ep->com, ABORTING);
set_bit(ABORT_CONN, &ep->com.history);
return send_abort(ep, skb, gfp);
@@ -1066,9 +1071,10 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status)
}
}
-static void connect_request_upcall(struct c4iw_ep *ep)
+static int connect_request_upcall(struct c4iw_ep *ep)
{
struct iw_cm_event event;
+ int ret;
PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
memset(&event, 0, sizeof(event));
@@ -1093,15 +1099,14 @@ static void connect_request_upcall(struct c4iw_ep *ep)
event.private_data_len = ep->plen;
event.private_data = ep->mpa_pkt + sizeof(struct mpa_message);
}
- if (state_read(&ep->parent_ep->com) != DEAD) {
- c4iw_get_ep(&ep->com);
- ep->parent_ep->com.cm_id->event_handler(
- ep->parent_ep->com.cm_id,
- &event);

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/cxgb4/cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/cxgb4/device.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/cxgb4/iw_cxgb4.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/cxgb4/mem.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/cxgb4/qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ehca/ehca_classes.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ehca/ehca_cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ehca/ehca_mrmw.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ipath/ipath_diag.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ipath/ipath_dma.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ipath/ipath_mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx4/doorbell.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx4/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx4/mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx4/qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/cq.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/doorbell.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/mem.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/mlx5_ib.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mlx5/qp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/mthca/mthca_provider.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/nes/nes_cm.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/nes/nes_cm.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/nes/nes_user.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/nes/nes_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/nes/nes_verbs.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_abi.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_ah.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_hw.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_sli.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_stats.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_stats.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_diag.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_dma.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_file_ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_fs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_iba6120.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_iba7220.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_iba7322.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_init.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_mad.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_rc.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_ruc.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_ud.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_user_sdma.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/qib/qib_verbs.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/usnic/usnic_uiom.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iscsi_iser.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iscsi_iser.h

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iser_initiator.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iser_memory.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/iser/iser_verbs.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/srp/ib_srp.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/ulp/srp/ib_srp.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/emulex/benet/be_roce.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/emulex/benet/be_roce.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/mr.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/libiscsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/scsi/scsi_transport_srp.c

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/cq.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/device.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/driver.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mlx5/qp.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/ib_cm.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/ib_umem.h

View file

This diff is incomplete. Download the complete patch.

include/rdma/ib_verbs.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/libiscsi.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_transport_iscsi.h

View file

This diff is incomplete. Download the complete patch.

include/scsi/scsi_transport_srp.h

View file

This diff is incomplete. Download the complete patch.