All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Two fixes for prev 4.9 and two new fixes
@ 2016-10-01  3:10 Dennis Dalessandro
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Dennis Dalessandro @ 2016-10-01  3:10 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn, Ira Weiny,
	Jianxin Xiong

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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] IB/hfi1: Fix invalid lockdep assert
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
@ 2016-10-01  3:10   ` Dennis Dalessandro
  2016-10-01  3:11   ` [PATCH 2/4] IB/core: Fix atomic regression with ib_hdrs Dennis Dalessandro
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2016-10-01  3:10 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Ira Weiny

From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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")
Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/qp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/qp.c b/drivers/infiniband/hw/hfi1/qp.c
index 04eb0c8..9fc75e7 100644
--- a/drivers/infiniband/hw/hfi1/qp.c
+++ b/drivers/infiniband/hw/hfi1/qp.c
@@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] IB/core: Fix atomic regression with ib_hdrs
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
  2016-10-01  3:10   ` [PATCH 1/4] IB/hfi1: Fix invalid lockdep assert Dennis Dalessandro
@ 2016-10-01  3:11   ` Dennis Dalessandro
  2016-10-01  3:11   ` [PATCH 3/4] IB/hfi1: Update SMA ingress checks for response packets Dennis Dalessandro
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2016-10-01  3:11 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn

From: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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")
Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 include/rdma/ib_hdrs.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h
index 879faf6..408439f 100644
--- a/include/rdma/ib_hdrs.h
+++ b/include/rdma/ib_hdrs.h
@@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] IB/hfi1: Update SMA ingress checks for response packets
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
  2016-10-01  3:10   ` [PATCH 1/4] IB/hfi1: Fix invalid lockdep assert Dennis Dalessandro
  2016-10-01  3:11   ` [PATCH 2/4] IB/core: Fix atomic regression with ib_hdrs Dennis Dalessandro
@ 2016-10-01  3:11   ` Dennis Dalessandro
  2016-10-01  3:11   ` [PATCH 4/4] IB/hfi1: Fix trace of atomic ack Dennis Dalessandro
  2016-10-03 15:33   ` [PATCH 0/4] Two fixes for prev 4.9 and two new fixes Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2016-10-01  3:11 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn, Jianxin Xiong

From: Jianxin Xiong <jianxin.xiong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jianxin Xiong <jianxin.xiong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/ud.c |   49 +++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 090e716..97ae24b 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] IB/hfi1: Fix trace of atomic ack
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-10-01  3:11   ` [PATCH 3/4] IB/hfi1: Update SMA ingress checks for response packets Dennis Dalessandro
@ 2016-10-01  3:11   ` Dennis Dalessandro
  2016-10-03 15:33   ` [PATCH 0/4] Two fixes for prev 4.9 and two new fixes Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Dennis Dalessandro @ 2016-10-01  3:11 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn

From: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/hfi1/trace.c |    4 ++--
 drivers/infiniband/hw/hfi1/verbs.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/trace.c b/drivers/infiniband/hw/hfi1/trace.c
index 4a0221f..01f525c 100644
--- a/drivers/infiniband/hw/hfi1/trace.c
+++ b/drivers/infiniband/hw/hfi1/trace.c
@@ -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
 
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index 1f19334..f2f6b5a 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Two fixes for prev 4.9 and two new fixes
       [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-10-01  3:11   ` [PATCH 4/4] IB/hfi1: Fix trace of atomic ack Dennis Dalessandro
@ 2016-10-03 15:33   ` Doug Ledford
  4 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2016-10-03 15:33 UTC (permalink / raw)
  To: Dennis Dalessandro
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Mike Marciniszyn, Ira Weiny,
	Jianxin Xiong


[-- Attachment #1.1: Type: text/plain, Size: 1220 bytes --]

On 9/30/2016 11:10 PM, Dennis Dalessandro wrote:
> 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.

> 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
> 


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-03 15:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-01  3:10 [PATCH 0/4] Two fixes for prev 4.9 and two new fixes Dennis Dalessandro
     [not found] ` <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-10-01  3:10   ` [PATCH 1/4] IB/hfi1: Fix invalid lockdep assert Dennis Dalessandro
2016-10-01  3:11   ` [PATCH 2/4] IB/core: Fix atomic regression with ib_hdrs Dennis Dalessandro
2016-10-01  3:11   ` [PATCH 3/4] IB/hfi1: Update SMA ingress checks for response packets Dennis Dalessandro
2016-10-01  3:11   ` [PATCH 4/4] IB/hfi1: Fix trace of atomic ack Dennis Dalessandro
2016-10-03 15:33   ` [PATCH 0/4] Two fixes for prev 4.9 and two new fixes Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.