Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-25 Thread Jason Gunthorpe
On Fri, Jul 12, 2019 at 10:51:23AM +0200, Arnd Bergmann wrote: > The new siw driver fails to build on i386 with > > drivers/infiniband/sw/siw/siw_qp.c:1025:3: error: invalid output size for > constraint '+q' > smp_store_mb(*cq->notify, SIW_NOTIFY_NOT); > ^ > includ

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Arnd Bergmann
On Fri, Jul 12, 2019 at 5:14 PM Jason Gunthorpe wrote: > On Fri, Jul 12, 2019 at 03:22:35PM +0200, Arnd Bergmann wrote: > > On Fri, Jul 12, 2019 at 3:05 PM Bernard Metzler wrote: > > Since this is coming up so late in the merge window, I'm inclined to > take the simple path while Bernard makes a

Re: Re: Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
-"Jason Gunthorpe" wrote: - >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 07/12/2019 07:45PM >Cc: "Arnd Bergmann" , "Doug Ledford" >, "Peter Zijlstra" , >linux-r...@vger.kernel.org, linux-kernel@vg

Re: Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
On Fri, Jul 12, 2019 at 05:40:43PM +, Bernard Metzler wrote: > It is because there are two levels a CQ can be armed: > >#include > >int ibv_req_notify_cq(struct ibv_cq *cq, int solicited_only); > > If we kick the CQ handler, we have to clear the whole > thing. The user lat

Re: Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
gt; >Date: 07/12/2019 04:43PM >> >Cc: "Arnd Bergmann" , "Doug Ledford" >> >, "Peter Zijlstra" , >> >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org >> >Subject: [EXTERNAL] Re: Re: Re: [PATCH] rdma/siw: avoid >> >smp_store_mb(

Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 03:24:09PM +, Bernard Metzler wrote: > -"Jason Gunthorpe" wrote: - > Hmmm, I don't yet get why we should test and clear atomically, if we > clear anyway - is it because we want to avoid clearing a re-arm which > happens just after testing and before clearing? >

Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
, > >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org > >Subject: [EXTERNAL] Re: Re: Re: [PATCH] rdma/siw: avoid > >smp_store_mb() on a u64 > > > >On Fri, Jul 12, 2019 at 02:35:50PM +, Bernard Metzler wrote: > > > >> >This looks

Re: Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
-"Jason Gunthorpe" wrote: - >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 07/12/2019 04:43PM >Cc: "Arnd Bergmann" , "Doug Ledford" >, "Peter Zijlstra" , >linux-r...@vger.kernel.org, linux-k

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
On Fri, Jul 12, 2019 at 03:22:35PM +0200, Arnd Bergmann wrote: > On Fri, Jul 12, 2019 at 3:05 PM Bernard Metzler wrote: > > > > > We share CQ (completion queue) notification flags between application > > (which may be user land) and producer (kernel QP's (queue pairs)). > > Those flags can be wri

Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
On Fri, Jul 12, 2019 at 02:35:50PM +, Bernard Metzler wrote: > >This looks wrong to me.. a userspace notification re-arm cannot be > >lost, so have a split READ/TEST/WRITE sequence can't possibly work? > > > >I'd expect an atomic test and clear here? > > We cannot avoid the case that the appl

Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
/12/2019 02:03PM >> >Cc: "Arnd Bergmann" , "Doug Ledford" >> >, "Peter Zijlstra" , >> >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org >> >Subject: [EXTERNAL] Re: [PATCH] rdma/siw: avoid smp_store_mb() on >a >> >u

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
, > >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org > >Subject: [EXTERNAL] Re: [PATCH] rdma/siw: avoid smp_store_mb() on a > >u64 > > > >On Fri, Jul 12, 2019 at 11:33:46AM +, Bernard Metzler wrote: > >> >diff --git a/drivers/infiniband/sw/si

Re: Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
-"Peter Zijlstra" wrote: - >To: "Bernard Metzler" >From: "Peter Zijlstra" >Date: 07/12/2019 03:19PM >Cc: "Jason Gunthorpe" , "Arnd Bergmann" >, "Doug Ledford" , >linux-r...@vger.kernel.org, linux-kernel@vge

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Arnd Bergmann
On Fri, Jul 12, 2019 at 3:05 PM Bernard Metzler wrote: > > We share CQ (completion queue) notification flags between application > (which may be user land) and producer (kernel QP's (queue pairs)). > Those flags can be written by both application and QP's. The application > writes those flags to

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 01:05:14PM +, Bernard Metzler wrote: > @@ -1131,6 +1131,10 @@ int siw_poll_cq(struct ib_cq *base_cq, int num_cqe, > struct ib_wc *wc) > * number of not reaped CQE's regardless of its notification > * type and current or new CQ notification settings. > * > + *

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
-"Jason Gunthorpe" wrote: - >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 07/12/2019 02:03PM >Cc: "Arnd Bergmann" , "Doug Ledford" >, "Peter Zijlstra" , >linux-r...@vger.kernel.org, linux-kernel@vger

Re: Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
-"Jason Gunthorpe" wrote: - >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 07/12/2019 02:03PM >Cc: "Arnd Bergmann" , "Doug Ledford" >, "Peter Zijlstra" , >linux-r...@vger.kernel.org, linux-kernel@vger

Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Jason Gunthorpe
On Fri, Jul 12, 2019 at 11:33:46AM +, Bernard Metzler wrote: > >diff --git a/drivers/infiniband/sw/siw/siw_verbs.c > >b/drivers/infiniband/sw/siw/siw_verbs.c > >index 32dc79d0e898..41c5ab293fe1 100644 > >+++ b/drivers/infiniband/sw/siw/siw_verbs.c > >@@ -1142,10 +1142,11 @@ int siw_req_notify_c

Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Peter Zijlstra
On Fri, Jul 12, 2019 at 11:33:46AM +, Bernard Metzler wrote: > Many thanks for pointing that out! Indeed, this CQ notification > mechanism does not take 32 bit architectures into account. > Since we have only three flags to hold here, it's probably better > to make it a 32bit value. That would

Re: [PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Bernard Metzler
orpe" , >linux-r...@vger.kernel.org, linux-kernel@vger.kernel.org >Subject: [EXTERNAL] [PATCH] rdma/siw: avoid smp_store_mb() on a u64 > >The new siw driver fails to build on i386 with > >drivers/infiniband/sw/siw/siw_qp.c:1025:3: error: invalid output size >for constraint &#

[PATCH] rdma/siw: avoid smp_store_mb() on a u64

2019-07-12 Thread Arnd Bergmann
The new siw driver fails to build on i386 with drivers/infiniband/sw/siw/siw_qp.c:1025:3: error: invalid output size for constraint '+q' smp_store_mb(*cq->notify, SIW_NOTIFY_NOT); ^ include/asm-generic/barrier.h:141:35: note: expanded from macro 'smp_store_mb' #de