public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Shamir Rabinovitch <shamir.rabinovitch-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v2 1/1] IB/mlx4: Unaligned access in send_reply_to_slave
Date: Wed, 18 May 2016 11:39:04 +0300	[thread overview]
Message-ID: <20160518083904.GA13184@shamir-linux.uk.oracle.com> (raw)
In-Reply-To: <20160517170733.GD19976-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Tue, May 17, 2016 at 11:07:33AM -0600, Jason Gunthorpe wrote:
> On Tue, May 17, 2016 at 11:37:11AM +0300, Shamir Rabinovitch wrote:
> 
> > Comments are more then welcome..
> 
> Something like this should fix it with less overhead:
> 
> struct ib_sa_mcmember_data {
> [..]
> } __packed __aligned(4);
> 
> Which tells the compiler the structure is only aligned on dword
> boundaries. It will then emit the proper architecture dependent
> unaligned read for the 8 byte values.
> 
> Jason

Thanks Jason. I considered to un-optimize this memcp line but
your idea is more clean. Gave quick look on the assembly and
it seems that you are correct. I could not find the 'ldx' around
the location where I had the memcpy. I do full test with this 
kernel hope it could confirm the fix. If all well I will re post
the updated patch to mailing list.

BR, Shamir

--
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-05-18  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  5:16 [PATCH v2 1/1] IB/mlx4: Unaligned access in send_reply_to_slave shamir.rabinovitch-QHcLZuEGTsvQT0dZR+AlfA
     [not found] ` <1463462198-15674-1-git-send-email-shamir.rabinovitch-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-05-17  7:39   ` Leon Romanovsky
     [not found]     ` <20160517073940.GF4662-2ukJVAZIZ/Y@public.gmane.org>
2016-05-17  8:37       ` Shamir Rabinovitch
     [not found]         ` <20160517083710.GA14673-wNzywhU3BCWJbeQQAEUYZUB3C2bhBk7L0E9HWUfgJXw@public.gmane.org>
2016-05-17 17:07           ` Jason Gunthorpe
     [not found]             ` <20160517170733.GD19976-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-18  8:39               ` Shamir Rabinovitch [this message]

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=20160518083904.GA13184@shamir-linux.uk.oracle.com \
    --to=shamir.rabinovitch-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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