From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: Steve Wise
<swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
'Tatyana Nikolova'
<Tatyana.E.Nikolova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
'Hal Rosenstock'
<hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
'Doug Ledford' <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
'Yishai Hadas'
<yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
'Devesh Sharma'
<Devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
'Sean Hefty' <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
'Bart Van Assche' <bvanassche-HInyCGIudOg@public.gmane.org>
Subject: Re: [PATCH 8/9] Remove most checks of __BYTE_ORDER
Date: Wed, 5 Oct 2016 11:33:59 -0600 [thread overview]
Message-ID: <20161005173359.GF18636@obsidianresearch.com> (raw)
In-Reply-To: <20161005153701.GA12295-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
On Wed, Oct 05, 2016 at 08:37:01AM -0700, Christoph Hellwig wrote:
> On Thu, Sep 29, 2016 at 04:28:02PM -0600, Jason Gunthorpe wrote:
> > In the kernel the swapping behavior of 'writel' is architecture (and
> > sometimes even platform) specific. Looking at the kernel headers
> > suggests that BE PPC needs an explicit swap and BE ARM does not (eg
> > the hardware swaps). Maybe. There are a lot of layers of macros in
> > this area..
>
> read{s,l,q} and write{s,l,q} in the kernel always perform an implicit
> bytestap, that is the device is expected to use a LE layout. This
> is not architecture specific, otherwise hell would break lose.
Right, stated differently, the kernel requires that writel()/etc
always produce the same PCI-E packet on the wire. (eg writel(1)
produces a TLP with bit 0 of the data payload set)
But each arch implements its own set of instructions to get there,
that is what I mean by architecture specific.
> But none of this has an affect on userspace mappings of registers, as
> those don't go through the kernel read{s,l,q} and write{s,l,q}
> helpers,
Not going through the kernel's writel is the whole problem. The writel
helper generates the arch-specific instruction sequence required to
issue generate the required PCI-E packet.
Today (at best, some drivers do not even do this) our userspace
assumes all archs implement writel as:
*(u32 *)reg = cpu_to_le32(val);
Which is a good start, but not portable to every arch the kernel
supports.
> Btw, one thing that would be useful is to introduce endiane annoatations
> for sparse in rdma-core. I've added these to a few userspace projects
> already, here is the most recent example:
>
> https://github.com/linux-nvme/nvme-cli/commit/126b8beb35b76fe9f61b137e34aea66b64c07b25
Yeah, it would be nice to get that working too. I guess we need to
standardize on the cpu_to_xx macro style as a first step?
The __iomem annotation would be nice as well.
Jason
--
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
next prev parent reply other threads:[~2016-10-05 17:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 20:47 [PATCH rdma-core 0/9] Dead Code Removal Jason Gunthorpe
[not found] ` <1475182076-5411-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 20:47 ` [PATCH 1/9] Remove HAVE_CONFIG_H Jason Gunthorpe
[not found] ` <1475182076-5411-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 21:22 ` Steve Wise
2016-09-30 17:02 ` Hal Rosenstock
2016-09-29 20:47 ` [PATCH 2/9] Remove HAVE_VALGRIND_MEMCHECK_H/INCLUDE_VALGRIND Jason Gunthorpe
[not found] ` <1475182076-5411-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 21:01 ` Bart Van Assche
[not found] ` <aef5ce41-14bf-9869-88c8-ab5796634a8c-HInyCGIudOg@public.gmane.org>
2016-09-29 22:34 ` Jason Gunthorpe
[not found] ` <20160929223415.GD27229-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 23:48 ` Bart Van Assche
[not found] ` <610a3086-07bd-baa7-11e2-88642c0e2297-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-09-30 0:15 ` Jason Gunthorpe
2016-09-30 16:49 ` Bart Van Assche
2016-09-30 17:02 ` Hal Rosenstock
2016-09-29 20:47 ` [PATCH 3/9] Remove HAVE_IBV_* Jason Gunthorpe
2016-09-29 20:47 ` [PATCH 4/9] Do not use IBV_CMD_(REG_MR|RESIZE_CQ)_HAS_RESP_PARAMS Jason Gunthorpe
[not found] ` <1475182076-5411-5-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-30 13:07 ` Dalessandro, Dennis
2016-09-29 20:47 ` [PATCH 5/9] Remove HAVE_SYMVER_SUPPORT Jason Gunthorpe
2016-09-29 20:47 ` [PATCH 6/9] Remove old compat definitions of wmb/rmb/etc Jason Gunthorpe
2016-09-29 20:47 ` [PATCH 7/9] Remove old MADV_DONTFORK/DOFORK compat Jason Gunthorpe
2016-09-29 20:47 ` [PATCH 8/9] Remove most checks of __BYTE_ORDER Jason Gunthorpe
[not found] ` <1475182076-5411-9-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 21:26 ` Steve Wise
2016-09-29 22:28 ` Jason Gunthorpe
[not found] ` <20160929222802.GC27229-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-29 23:46 ` Steve Wise
[not found] ` <F2C34CC4-5C7D-4382-873D-9E14B81A44B3-/Yg/VP3ZvrM@public.gmane.org>
2016-09-30 0:08 ` Jason Gunthorpe
[not found] ` <20160930000800.GA7570-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-30 13:32 ` Steve Wise
2016-10-05 15:16 ` Yishai Hadas
[not found] ` <fd7d47c8-6a06-6169-b840-abfbc239ad75-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-10-05 17:44 ` Jason Gunthorpe
[not found] ` <20161005174449.GG18636-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-06 12:09 ` Yishai Hadas
2016-10-05 15:37 ` Christoph Hellwig
[not found] ` <20161005153701.GA12295-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-10-05 17:33 ` Jason Gunthorpe [this message]
[not found] ` <20161005173359.GF18636-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-06 11:40 ` Christoph Hellwig
2016-09-30 16:51 ` Bart Van Assche
2016-09-30 17:02 ` Hal Rosenstock
2016-09-29 20:47 ` [PATCH 9/9] nes: Remove code guarded by HAVE_DECL_IBV_QPT_RAW_ETH Jason Gunthorpe
2016-10-02 12:58 ` [PATCH rdma-core 0/9] Dead Code Removal 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=20161005173359.GF18636@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=Devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=Tatyana.E.Nikolova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=bvanassche-HInyCGIudOg@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
--cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@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 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.