public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 2/4] IB/core: Fix atomic regression with ib_hdrs
Date: Fri, 30 Sep 2016 20:11:04 -0700	[thread overview]
Message-ID: <20161001031103.15264.95520.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20161001030935.15264.34730.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

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

  parent reply	other threads:[~2016-10-01  3:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Dennis Dalessandro [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161001031103.15264.95520.stgit@scvm10.sc.intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox