Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33117
b: refs/heads/master
c: 559ce8f
h: refs/heads/master
i:
  33115: e95bd19
v: v3
  • Loading branch information
Ishai Rabinovitz authored and Roland Dreier committed Aug 3, 2006
1 parent 2d6b849 commit 2aac7dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d916a8f1b43b358685b1672390ead11f2d3b74c6
refs/heads/master: 559ce8f150d7d031c79c4d79173860f1bdfe3ce4
17 changes: 15 additions & 2 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ MODULE_PARM_DESC(topspin_workarounds,

static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };

static int mellanox_workarounds = 1;

module_param(mellanox_workarounds, int, 0444);
MODULE_PARM_DESC(mellanox_workarounds,
"Enable workarounds for Mellanox SRP target bugs if != 0");

static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };

static void srp_add_one(struct ib_device *device);
static void srp_remove_one(struct ib_device *device);
static void srp_completion(struct ib_cq *cq, void *target_ptr);
Expand Down Expand Up @@ -569,7 +577,7 @@ static int srp_reconnect_target(struct srp_target_port *target)
return ret;
}

static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
int sg_cnt, struct srp_request *req,
struct srp_direct_buf *buf)
{
Expand All @@ -579,10 +587,15 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,
int page_cnt;
int i, j;
int ret;
struct srp_device *dev = target->srp_host->dev;

if (!dev->fmr_pool)
return -ENODEV;

if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) &&
mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))
return -EINVAL;

len = page_cnt = 0;
for (i = 0; i < sg_cnt; ++i) {
if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) {
Expand Down Expand Up @@ -685,7 +698,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
buf->va = cpu_to_be64(sg_dma_address(scat));
buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey);
buf->len = cpu_to_be32(sg_dma_len(scat));
} else if (srp_map_fmr(target->srp_host->dev, scat, count, req,
} else if (srp_map_fmr(target, scat, count, req,
(void *) cmd->add_data)) {
/*
* FMR mapping failed, and the scatterlist has more
Expand Down

0 comments on commit 2aac7dd

Please sign in to comment.