IB/srp: always avoid non-zero offsets into an FMR
authorDavid Dillow <dillowda@ornl.gov>
Fri, 14 Jan 2011 22:02:23 +0000 (17:02 -0500)
committerDavid Dillow <dillowda@ornl.gov>
Tue, 15 Mar 2011 23:34:28 +0000 (19:34 -0400)
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>
drivers/infiniband/ulp/srp/ib_srp.c

index 83664ed2804f995ac2576e1b7c5c0e5d88b32ad6..197e26cc2b0bd0ac0794b7e246fc68d7ade34685 100644 (file)
@@ -72,12 +72,6 @@ module_param(topspin_workarounds, int, 0444);
 MODULE_PARM_DESC(topspin_workarounds,
                 "Enable workarounds for Topspin/Cisco SRP target bugs if != 0");
 
-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 void srp_add_one(struct ib_device *device);
 static void srp_remove_one(struct ib_device *device);
 static 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)
                 !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui));
 }
 
-static int srp_target_is_mellanox(struct srp_target_port *target)
-{
-       static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };
-
-       return mellanox_workarounds &&
-               !memcmp(&target->ioc_guid, mellanox_oui, sizeof mellanox_oui);
-}
-
 static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size,
                                   gfp_t gfp_mask,
                                   enum dma_data_direction direction)
@@ -662,8 +648,7 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
        if (!dev->fmr_pool)
                return -ENODEV;
 
-       if (srp_target_is_mellanox(target) &&
-           (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask))
+       if (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask)
                return -EINVAL;
 
        len = page_cnt = 0;