aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorDavid Dillow <dillowda@ornl.gov>2011-01-14 17:02:23 -0500
committerDavid Dillow <dillowda@ornl.gov>2011-03-15 19:34:28 -0400
commit8c4037b501acd2ec3abc7925e66af8af40a2da9d (patch)
tree49c39371ceef4a32c760a26edcf62f920e4f80f7 /drivers/infiniband/ulp
parent521cb40b0c44418a4fd36dc633f575813d59a43d (diff)
IB/srp: always avoid non-zero offsets into an FMR
It is unclear exactly how this code works around Mellanox SRP targets, or if the problem is on the target side or in the HCA itself. In an abundance of caution, we should always enable the workaround. Signed-off-by: David Dillow <dillowda@ornl.gov>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 83664ed2804f..197e26cc2b0b 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -72,12 +72,6 @@ module_param(topspin_workarounds, int, 0444);
72MODULE_PARM_DESC(topspin_workarounds, 72MODULE_PARM_DESC(topspin_workarounds,
73 "Enable workarounds for Topspin/Cisco SRP target bugs if != 0"); 73 "Enable workarounds for Topspin/Cisco SRP target bugs if != 0");
74 74
75static int mellanox_workarounds = 1;
76
77module_param(mellanox_workarounds, int, 0444);
78MODULE_PARM_DESC(mellanox_workarounds,
79 "Enable workarounds for Mellanox SRP target bugs if != 0");
80
81static void srp_add_one(struct ib_device *device); 75static void srp_add_one(struct ib_device *device);
82static void srp_remove_one(struct ib_device *device); 76static void srp_remove_one(struct ib_device *device);
83static void srp_recv_completion(struct ib_cq *cq, void *target_ptr); 77static void srp_recv_completion(struct ib_cq *cq, void *target_ptr);
@@ -114,14 +108,6 @@ static int srp_target_is_topspin(struct srp_target_port *target)
114 !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui)); 108 !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui));
115} 109}
116 110
117static int srp_target_is_mellanox(struct srp_target_port *target)
118{
119 static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
120
121 return mellanox_workarounds &&
122 !memcmp(&target->ioc_guid, mellanox_oui, sizeof mellanox_oui);
123}
124
125static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, 111static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size,
126 gfp_t gfp_mask, 112 gfp_t gfp_mask,
127 enum dma_data_direction direction) 113 enum dma_data_direction direction)
@@ -662,8 +648,7 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
662 if (!dev->fmr_pool) 648 if (!dev->fmr_pool)
663 return -ENODEV; 649 return -ENODEV;
664 650
665 if (srp_target_is_mellanox(target) && 651 if (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask)
666 (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask))
667 return -EINVAL; 652 return -EINVAL;
668 653
669 len = page_cnt = 0; 654 len = page_cnt = 0;