public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: "Amrani, Ram" <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: "dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Elior,
	Ariel" <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"Kalderon,
	Michal" <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH rdma-core RESEND] libqedr: Add iWARP support for user-space lib
Date: Wed, 6 Sep 2017 09:19:44 -0600	[thread overview]
Message-ID: <20170906151944.GA6262@obsidianresearch.com> (raw)
In-Reply-To: <BN3PR07MB2578B8F3480B5218A06F2167F8970-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

On Wed, Sep 06, 2017 at 09:18:58AM +0000, Amrani, Ram wrote:
> > On Tue, Sep 05, 2017 at 05:36:54PM +0300, Ram Amrani wrote:
> > > +		if (iwarp) {
> > > +			writel(qp->rq.iwarp_db2_data.raw, qp->rq.iwarp_db2);
> > > +			mmio_flush_writes();
> > > +		}
> > 
> > Can you update this driver to use the macros in util/mmio.h and
> > discard this writel thing?
> 
> Sure. I can write a dedicated patch to convert all of the locations at once.
> 
> A couple of questions -
> 
> I see that for 16, as an example, there are three functions:
> 1) mmio_write16_le()
> 2) mmio_write16_be()
> 3) mmio_write16()
> Per my understanding the first two do not manipulate the data and are only intended to
> allow sparse to pass (and protect us).

Yes..

> However the 3rd performs htole. Is this correct?

Yes, if necessary it performs the swap to create the defined TLP on
any arches that require it.

It is basically equivalent to the kernel's writel_relaxed

> #define MAKE_WRITE(_NAME_, _SZ_)                                               \
>         static inline void _NAME_##_be(void *addr, __be##_SZ_ value)           \
>         {                                                                      \
>                 atomic_store_explicit((_Atomic(uint##_SZ_##_t) *)addr,         \
>                                       (__force uint##_SZ_##_t)value,           \
>                                       memory_order_relaxed);                   \
>         }                                                                      \
> What is the effect of the "relaxed ordering" if we use a non-WC BUS?

memory_order_relaxed tells the compiler to WRITE_ONCE but otherwise
not concern it self with ordering of stores.

eg

 *foo = 1
  mmio_write16(bar, 12);

Can be freely re-ordered during compilation and during execution.

Code needs to insert a util/barrier.h if it requires ordering.

But qedr is using WC right?

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

  parent reply	other threads:[~2017-09-06 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 14:36 [PATCH rdma-core RESEND] libqedr: Add iWARP support for user-space lib Ram Amrani
     [not found] ` <1504622214-9730-1-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2017-09-05 15:14   ` Jason Gunthorpe
     [not found]     ` <20170905151412.GA18205-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-06  3:56       ` Leon Romanovsky
2017-09-06  9:18       ` Amrani, Ram
     [not found]         ` <BN3PR07MB2578B8F3480B5218A06F2167F8970-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-09-06 15:19           ` Jason Gunthorpe [this message]
     [not found]             ` <20170906151944.GA6262-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-07  6:45               ` Amrani, Ram

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=20170906151944.GA6262@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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