All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RESEND rdma-core v4 4/8] libbnxt_re: Add support for posting and polling
Date: Mon, 24 Apr 2017 10:34:16 -0600	[thread overview]
Message-ID: <20170424163416.GA23048@obsidianresearch.com> (raw)
In-Reply-To: <CANjDDBiG_0C1DTYKgwCPuUzs34yb1b-iBpxRpU=XXZnm-JcOfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Apr 24, 2017 at 09:29:11PM +0530, Devesh Sharma wrote:
> On Sat, Apr 22, 2017 at 12:52 AM, Jason Gunthorpe
> <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> > On Fri, Apr 21, 2017 at 02:57:08PM -0400, Devesh Sharma wrote:
> >
> >> +static void bnxt_re_ring_db(struct bnxt_re_dpi *dpi,
> >> +                         struct bnxt_re_db_hdr *hdr)
> >> +{
> >> +     __le64 *dbval;
> >> +
> >> +     pthread_spin_lock(&dpi->db_lock);
> >> +     dbval = (__le64 *)&hdr->indx;
> >> +     udma_to_device_barrier();
> >> +     iowrite64(dpi->dbpage, dbval);
> >> +     pthread_spin_unlock(&dpi->db_lock);
> >> +}
> >
> > What are you expecting this db_lock to do?
> >
> > Is 'dbpage' UC or WC memory?
> 
> Driver re-maps it as "UC-" where strong ordering is guaranteed. How
> system would handle 64-bit writes will it issue two 32-bit consecutive
> writes on the bus?

64 bit systems support 64 bit writes as a single TLP on the PCI-E, so
the lock is not required.

If the write is broken up into two 32 bit transfers (eg as on a 32 bit
processor) then the device usually requires them to be presented in
address increasing order, however the compiler does not guarentee that
with a simple 64 bit store as above.

Going forward we will merge the new shared mmio accessors:

https://github.com/jgunthorpe/rdma-plumbing/blob/mmio/util/mmio.h

Which provides sane common implementations for these operations.

For this reason I don't think there is much point in your spending
time to open code a solution in your driver. Now that I know the lock
is not doing anything it can just be dropped when the mmio accessors
are merged.

Jasn
--
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-04-24 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 18:57 [RESEND rdma-core v4 0/8] Broadcom User Space RoCE Driver Devesh Sharma
     [not found] ` <1492801032-17587-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-04-21 18:57   ` [RESEND rdma-core v4 1/8] libbnxt_re: introduce bnxtre user space RDMA provider Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 2/8] libbnxt_re: Add support for user memory regions Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 3/8] libbnxt_re: Add support for CQ and QP management Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 4/8] libbnxt_re: Add support for posting and polling Devesh Sharma
     [not found]     ` <1492801032-17587-5-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-04-21 19:22       ` Jason Gunthorpe
     [not found]         ` <20170421192255.GA12079-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-04-24 15:59           ` Devesh Sharma
     [not found]             ` <CANjDDBiG_0C1DTYKgwCPuUzs34yb1b-iBpxRpU=XXZnm-JcOfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-24 16:34               ` Jason Gunthorpe [this message]
     [not found]                 ` <20170424163416.GA23048-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-04-24 18:23                   ` Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 5/8] libbnxt_re: Allow apps to poll for flushed completions Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 6/8] libbnxt_re: Enable UD control path and wqe posting Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 7/8] libbnxt_re: Enable polling for UD completions Devesh Sharma
2017-04-21 18:57   ` [RESEND rdma-core v4 8/8] libbnxt_re: Add support for atomic operations Devesh Sharma
     [not found]     ` <1492801032-17587-9-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-04-22 10:33       ` Leon Romanovsky
     [not found]         ` <20170422103309.GX14088-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-04-24 14:43           ` Devesh Sharma

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=20170424163416.GA23048@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@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 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.