Skip to contentSkip to conversation

Two fixes for prev 4.9 and two new fixes

PATCH In review Dennis Dalessandro 2 participants 6 messages Oct 1, 2016 – Oct 3, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Two fixes for prev 4.9 and two new fixes

Doug,

The first two patches here are fixes for patches you picked up in your hfi1 branch for 4.9. You may want to squash them. The commit SHAs referrenced are from your GitHub repo.

Pathces 3 and 4 are new fixes for 4.9.

Patches can also be viewed in my repo at:
https://github.com/ddalessa/kernel/tree/for-4.9

---

Ira Weiny (1):
IB/hfi1: Fix invalid lockdep assert

Jianxin Xiong (1):
IB/hfi1: Update SMA ingress checks for response packets

Mike Marciniszyn (2):
IB/core: Fix atomic regression with ib_hdrs
IB/hfi1: Fix trace of atomic ack

 drivers/infiniband/hw/hfi1/qp.c    |    1 -
 drivers/infiniband/hw/hfi1/trace.c |    4 +--
 drivers/infiniband/hw/hfi1/ud.c    |   49 ++++++++++++++++++------------------
 drivers/infiniband/hw/hfi1/verbs.c |    2 +
 include/rdma/ib_hdrs.h             |    6 ++--
 5 files changed, 30 insertions(+), 32 deletions(-)

--
-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org

#2 lore raw

PATCH 1/4 IB/hfi1: Fix invalid lockdep assert

From: Ira Weiny <[email protected]>

Commit 548de297734c ("IB/rdmavt, IB/hfi1: Add lockdep asserts for lock debug") improperly asserted that the send lock was taken when the QP was being free'ed.

Fixes 548de297734c ("IB/rdmavt, IB/hfi1: Add lockdep asserts for lock debug")
---
 drivers/infiniband/hw/hfi1/qp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/infiniband/hw/hfi1/qp.c +0 -1
index 04eb0c8..9fc75e7 100644
@@ -824,7 +824,6 @@ void qp_priv_free(struct rvt_dev_info *rdi, struct rvt_qp *qp)
 {
 	struct hfi1_qp_priv *priv = qp->priv;
 
-	lockdep_assert_held(&qp->s_lock);
 	kfree(priv->s_ahg);
 	kfree(priv);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 2/4 IB/core: Fix atomic regression with ib_hdrs

In reply to a message not in the archive

From: Mike Marciniszyn <[email protected]>

The struct containing atomic_ack_eth isn't packed which causes the atomic ack 64 bit values to be offset incorrectly breaking atomic operations for qib and hfi1.

Fix by declaring the struct packed.

There were some inline declarations missing in the new accessors. Add those.

Fixes ea454191a7a9 ("IB/core: Add ib headers for general use")
---
 include/rdma/ib_hdrs.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
include/rdma/ib_hdrs.h +3 -3
index 879faf6..408439f 100644
@@ -100,7 +100,7 @@ union ib_ehdrs {
 	struct {
 		__be32 aeth;
 		__be64 atomic_ack_eth; /* potentially unaligned */
-	} at;
+	} __packed at;
 	__be32 imm_data;
 	__be32 aeth;
 	__be32 ieth;
@@ -125,12 +125,12 @@ struct ib_header {
 
 /* accessors for unaligned __be64 items */
 
-static u64 ib_u64_get(__be64 *p)
+static inline u64 ib_u64_get(__be64 *p)
 {
 	return get_unaligned_be64(p);
 }
 
-static void ib_u64_put(u64 val, __be64 *p)
+static inline void ib_u64_put(u64 val, __be64 *p)
 {
 	put_unaligned_be64(val, p);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 3/4 IB/hfi1: Update SMA ingress checks for response packets

In reply to a message not in the archive

From: Jianxin Xiong <[email protected]>

Fix "unsupported method" error by skipping ingress pkey checks on response SMA packets.

---
 drivers/infiniband/hw/hfi1/ud.c |   49 +++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 25 deletions(-)
drivers/infiniband/hw/hfi1/ud.c +24 -25
index 090e716..97ae24b 100644
@@ -559,8 +559,8 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
 
 /*
  * opa_smp_check() - Do the regular pkey checking, and the additional
- * checks for SMPs specified in OPAv1 rev 0.90, section 9.10.26
- * ("SMA Packet Checks").
+ * checks for SMPs specified in OPAv1 rev 1.0, 9/19/2016 update, section
+ * 9.10.25 ("SMA Packet Checks").
  *
  * Note that:
  *   - Checks are done using the pkey directly from the packet's BTH,
@@ -603,23 +603,28 @@ static int opa_smp_check(struct hfi1_ibport *ibp, u16 pkey, u8 sc5,
 
 	/*
 	 * SMPs fall into one of four (disjoint) categories:
-	 * SMA request, SMA response, trap, or trap repress.
-	 * Our response depends, in part, on which type of
-	 * SMP we're processing.
+	 * SMA request, SMA response, SMA trap, or SMA trap repress.
+	 * Our response depends, in part, on which type of SMP we're
+	 * processing.
 	 *
-	 * If this is not an SMA request, or trap repress:
-	 *   - accept MAD if the port is running an SM
-	 *   - pkey == FULL_MGMT_P_KEY =>
-	 *       reply with unsupported method (i.e., just mark
-	 *       the smp's status field here, and let it be
-	 *       processed normally)
-	 *   - pkey != LIM_MGMT_P_KEY =>
-	 *       increment port recv constraint errors, drop MAD
-	 * If this is an SMA request or trap repress:
+	 * If this is an SMA response, skip the check here.
+	 *
+	 * If this is an SMA request or SMA trap repress:
 	 *   - pkey != FULL_MGMT_P_KEY =>
 	 *       increment port recv constraint errors, drop MAD
+	 *
+	 * Otherwise:
+	 *    - accept if the port is running an SM
+	 *    - drop MAD if it's an SMA trap
+	 *    - pkey == FULL_MGMT_P_KEY =>
+	 *        reply with unsupported method
+	 *    - pkey != FULL_MGMT_P_KEY =>
+	 *	  increment port recv constraint errors, drop MAD
 	 */
 	switch (smp->method) {
+	case IB_MGMT_METHOD_GET_RESP:
+	case IB_MGMT_METHOD_REPORT_RESP:
+		break;
 	case IB_MGMT_METHOD_GET:
 	case IB_MGMT_METHOD_SET:
 	case IB_MGMT_METHOD_REPORT:
@@ -629,23 +634,17 @@ static int opa_smp_check(struct hfi1_ibport *ibp, u16 pkey, u8 sc5,
 			return 1;
 		}
 		break;
-	case IB_MGMT_METHOD_SEND:
-	case IB_MGMT_METHOD_TRAP:
-	case IB_MGMT_METHOD_GET_RESP:
-	case IB_MGMT_METHOD_REPORT_RESP:
+	default:
 		if (ibp->rvp.port_cap_flags & IB_PORT_SM)
 			return 0;
+		if (smp->method == IB_MGMT_METHOD_TRAP)
+			return 1;
 		if (pkey == FULL_MGMT_P_KEY) {
 			smp->status |= IB_SMP_UNSUP_METHOD;
 			return 0;
 		}
-		if (pkey != LIM_MGMT_P_KEY) {
-			ingress_pkey_table_fail(ppd, pkey, slid);
-			return 1;
-		}
-		break;
-	default:
-		break;
+		ingress_pkey_table_fail(ppd, pkey, slid);
+		return 1;
 	}
 	return 0;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

PATCH 4/4 IB/hfi1: Fix trace of atomic ack

In reply to a message not in the archive

From: Mike Marciniszyn <[email protected]>

The length is incorrect, causing the trace data to be truncated.

Add the additional 8 bytes that should have been there. Also trace out the atomic ack in hex to aid debugging.

---
 drivers/infiniband/hw/hfi1/trace.c |    4 ++--
 drivers/infiniband/hw/hfi1/verbs.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/trace.c +2 -2
index 4a0221f..01f525c 100644
@@ -67,8 +67,8 @@ u8 ibhdr_exhdr_len(struct ib_header *hdr)
 #define AETH_PRN "aeth syn 0x%.2x %s msn 0x%.8x"
 #define DETH_PRN "deth qkey 0x%.8x sqpn 0x%.6x"
 #define IETH_PRN "ieth rkey 0x%.8x"
-#define ATOMICACKETH_PRN "origdata %lld"
-#define ATOMICETH_PRN "vaddr 0x%llx rkey 0x%.8x sdata %lld cdata %lld"
+#define ATOMICACKETH_PRN "origdata %llx"
+#define ATOMICETH_PRN "vaddr 0x%llx rkey 0x%.8x sdata %llx cdata %llx"
 
 #define OP(transport, op) IB_OPCODE_## transport ## _ ## op
 
drivers/infiniband/hw/hfi1/verbs.c +1 -1
index 1f19334..f2f6b5a 100644
@@ -335,7 +335,7 @@ const u8 hdr_len_by_opcode[256] = {
 	[IB_OPCODE_RC_RDMA_READ_RESPONSE_LAST]        = 12 + 8 + 4,
 	[IB_OPCODE_RC_RDMA_READ_RESPONSE_ONLY]        = 12 + 8 + 4,
 	[IB_OPCODE_RC_ACKNOWLEDGE]                    = 12 + 8 + 4,
-	[IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE]             = 12 + 8 + 4,
+	[IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE]             = 12 + 8 + 4 + 8,
 	[IB_OPCODE_RC_COMPARE_SWAP]                   = 12 + 8 + 28,
 	[IB_OPCODE_RC_FETCH_ADD]                      = 12 + 8 + 28,
 	[IB_OPCODE_RC_SEND_LAST_WITH_INVALIDATE]      = 12 + 8 + 4,

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to a message not in the archive
Quoted 7 lines · Dennis Dalessandro

Doug,

The first two patches here are fixes for patches you picked up in your hfi1 branch for 4.9. You may want to squash them. The commit SHAs referrenced are from your GitHub repo.

Pathces 3 and 4 are new fixes for 4.9.

Thanks, I squashed the two fixes in and applied the other two.

Quoted 26 lines

Patches can also be viewed in my repo at:
https://github.com/ddalessa/kernel/tree/for-4.9

---

Ira Weiny (1):
IB/hfi1: Fix invalid lockdep assert

Jianxin Xiong (1):
IB/hfi1: Update SMA ingress checks for response packets

Mike Marciniszyn (2):
IB/core: Fix atomic regression with ib_hdrs
IB/hfi1: Fix trace of atomic ack

 drivers/infiniband/hw/hfi1/qp.c    |    1 -
 drivers/infiniband/hw/hfi1/trace.c |    4 +--
 drivers/infiniband/hw/hfi1/ud.c    |   49 ++++++++++++++++++------------------
 drivers/infiniband/hw/hfi1/verbs.c |    2 +
 include/rdma/ib_hdrs.h             |    6 ++--
 5 files changed, 30 insertions(+), 32 deletions(-)

--
-Denny

Signature · 2 lines
Doug Ledford <[email protected]>
    GPG Key ID: 0E572FDD