public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	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: Thu, 6 Oct 2016 04:40:45 -0700	[thread overview]
Message-ID: <20161006114045.GA25762@infradead.org> (raw)
In-Reply-To: <20161005173359.GF18636-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Wed, Oct 05, 2016 at 11:33:59AM -0600, Jason Gunthorpe wrote:
> 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)

Exactly.

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

All the architectures (including your quoted above ARM example) seem
to do the byte swap in software.  That seems to be important for
accesses like memcpy_{to,from}_io, which would be painful to handle.

But yes, in theory an architecture could do it any way it wants.

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

It should do the right thing for every architecture that matters.
Thay beeing said having an iomem abstraction certainly makes sense
for various reasons, and handling any oddball architecture (or rather
PCI hostbridge implemtation, I would not expect something this
broken to be universal) would come as a bonus.

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

Any style will work as long as it separate the swap directions,
but for a low-level Linux projects using the kernel style certainly
makes sene.

> The __iomem annotation would be nice as well.

I can look into that as well.  Usuaully the first step before adding
sparse annotations is fixing all the misc sparse warnings, as typical
userspace projects have a not too stellar code quality.
--
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-06 11:40 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
     [not found]                   ` <20161005173359.GF18636-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-06 11:40                     ` Christoph Hellwig [this message]
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=20161006114045.GA25762@infradead.org \
    --to=hch-wegcikhe2lqwvfeawa7xhq@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=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox