Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599081

[PATCH 4.10 24/75] IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.10 24/75] IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS
Date 2017-03-13 10:10 +0100
Message-ID <tku9n-6JI-87@gated-at.bofh.it> (permalink)
References <tktPX-6ks-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <bart.vanassche@sandisk.com>

commit d6c58dc40fec35ff6cdb350b53bce0fcf9143709 upstream.

Tests have shown that the following error message is reported when
using SG-GAPS registration with an mlx5 adapter:

scsi host1: ib_srp: failed RECV status WR flushed (5) for CQE ffff880bd4270eb0
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 0f007806 2500002a ad9fafd1
scsi host1: ib_srp: reconnect succeeded
mlx5_0:dump_cqe:262:(pid 7369): dump error cqe
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 0f007806 25000032 00105dd0
scsi host1: ib_srp: failed FAST REG status memory management operation error (6) for CQE ffff880b92860138

Hence avoid using SG-GAPS memory registrations. Additionally,
always configure the blk_queue_virt_boundary() to avoid to trigger
a mapping failure when using adapters that support SG-GAPS (e.g.
mlx5).

Fixes: commit ad8e66b4a801 ("IB/srp: fix mr allocation when the device supports sg gaps")
Fixes: commit 509c5f33f4f6 ("IB/srp: Prevent mapping failures")
Reported-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Israel Rukshin <israelr@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Mark Bloch <markb@mellanox.com>
Cc: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/infiniband/ulp/srp/ib_srp.c |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -371,7 +371,6 @@ static struct srp_fr_pool *srp_create_fr
 	struct srp_fr_desc *d;
 	struct ib_mr *mr;
 	int i, ret = -EINVAL;
-	enum ib_mr_type mr_type;
 
 	if (pool_size <= 0)
 		goto err;
@@ -385,13 +384,9 @@ static struct srp_fr_pool *srp_create_fr
 	spin_lock_init(&pool->lock);
 	INIT_LIST_HEAD(&pool->free_list);
 
-	if (device->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)
-		mr_type = IB_MR_TYPE_SG_GAPS;
-	else
-		mr_type = IB_MR_TYPE_MEM_REG;
-
 	for (i = 0, d = &pool->desc[0]; i < pool->size; i++, d++) {
-		mr = ib_alloc_mr(pd, mr_type, max_page_list_len);
+		mr = ib_alloc_mr(pd, IB_MR_TYPE_MEM_REG,
+				 max_page_list_len);
 		if (IS_ERR(mr)) {
 			ret = PTR_ERR(mr);
 			if (ret == -ENOMEM)
@@ -2664,9 +2659,8 @@ static int srp_slave_alloc(struct scsi_d
 	struct Scsi_Host *shost = sdev->host;
 	struct srp_target_port *target = host_to_target(shost);
 	struct srp_device *srp_dev = target->srp_host->srp_dev;
-	struct ib_device *ibdev = srp_dev->dev;
 
-	if (!(ibdev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG))
+	if (true)
 		blk_queue_virt_boundary(sdev->request_queue,
 					~srp_dev->mr_page_mask);
 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.10 00/75] 4.10.3-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 39/75] nlm: Ensure callback code also checks that the files match Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 12/75] s390: TASK_SIZE for kernel threads Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 04/75] KVM: VMX: use correct vmcs_read/write for guest segment selector/base Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 22/75] IB/IPoIB: Add destination address when re-queue packet Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 50/75] drm/ast: Handle configuration without P2A bridge Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 07/75] phy: qcom-ufs: Fix misplaced jump label Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 58/75] drm/imx: imx-tve: Do not set the regulator voltage Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 53/75] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 02/75] serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 09:50 +0100
  [PATCH 4.10 69/75] x86, mm: fix gup_pte_range() vs DAX mappings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 35/75] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 59/75] drm/atomic: fix an error code in mode_fixup() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 51/75] drm/ast: Fix test for VGA enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 42/75] nfit, libnvdimm: fix interleave set cookie calculation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 33/75] ceph: remove req from unsafe list when unregistering it Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 54/75] drm/radeon: handle vfct with multiple vbios images Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 70/75] x86/tlb: Fix tlb flushing when lguest clears PGE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 63/75] drm/i915: Recreate internal objects with single page segments if dmar fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 60/75] drm/i915/gvt: Disable access to stolen memory as a guest Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 74/75] fat: fix using uninitialized fields of fat_inode/fsinfo_inode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 08/75] s390/qdio: clear DSCI prior to scanning multiple input queues Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 73/75] kasan: resched in quarantine_remove_cache() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 45/75] mac80211: dont handle filtered frames within a BA session Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 10/75] s390/kdump: Use "LINUX" ELF note name instead of "CORE" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 34/75] pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 75/75] drivers: hv: Turn off write permission on the hypercall page Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 06/75] phy: qcom-ufs: Dont kfree devres resource Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 05/75] Bluetooth: Add another AR3012 04ca:3018 device Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 52/75] drm/ast: Call open_key before enable_mmio in POST code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 32/75] ktest: Fix child exit code processing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 40/75] pwm: pca9685: Fix period change with same duty cycle Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 09/75] s390/dcssblk: fix device size calculation in dcssblk_direct_access() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 48/75] drm/amdgpu/pm: check for headless before calling compute_clocks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 49/75] Revert "drm/amdgpu: update tile table for oland/hainan" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 36/75] target: Fix NULL dereference during LUN lookup + active I/O shutdown Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 72/75] mm: do not call mem_cgroup_free() from within mem_cgroup_alloc() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 43/75] mac80211: flush delayed work when entering suspend Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 71/75] thp: fix another corner case of munlock() vs. THPs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 57/75] drm/vmwgfx: Work around drm removal of control nodes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 67/75] drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE_EXT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:00 +0100
  [PATCH 4.10 23/75] IB/mlx5: Fix out-of-bound access Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 20/75] mnt: Tuck mounts under others instead of creating shadow/side mounts. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 11/75] s390/chsc: Add exception handler for CHSC instruction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 31/75] tracing: Fix return value check in trace_benchmark_reg() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 18/75] cxl: fix nested locking hang during EEH hotplug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 29/75] orangefs: Use RCU for destroy_inode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 28/75] Btrfs: fix data loss after truncate when using the no-holes feature Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 25/75] IB/srp: Avoid that duplicate responses trigger a kernel bug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 19/75] brcmfmac: fix incorrect event channel deduction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 30/75] memory/atmel-ebi: Fix ns <-> cycles conversions Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 21/75] IB/ipoib: Fix deadlock between rmmod and set_mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 03/75] KVM: s390: Disable dirty log retrieval for UCONTROL guests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 13/75] s390/topology: correct allocation of topology information Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  [PATCH 4.10 24/75] IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-13 10:10 +0100
  Re: [PATCH 4.10 00/75] 4.10.3-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-13 23:40 +0100

csiph-web