All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
To: ahmad omary <ahmad151084-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Ahmad Omary <ahmad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tzahi Oved <tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Alex Rosenbaum <Alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Ariel Levkovich <lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Stephen Bates <sbates-pv7U853sEMVWk0Htik3J/w@public.gmane.org>,
	Logan Gunthorpe <logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
Subject: Re: [RFC] libibverbs IB Device Memory support
Date: Tue, 6 Jun 2017 10:35:12 +0300	[thread overview]
Message-ID: <46b1a06d-5936-799c-7743-097c579971ef@grimberg.me> (raw)
In-Reply-To: <CADWppnpd9Up7wUTxRgSinhgx3kt3+0bKwgt6P_d3CV1oA90isQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>



On 10/05/17 14:25, ahmad omary wrote:
> Introduction
> -------------------------------------------------------------------------------
> 
> Many types of user space application can get a real performance gain by using
> the internal memory of an IB device. This can be useful to decrease latency of
> a trading operation where data is already allocated in the device memory, to
> save the PCI round trip when doing atomic operations on semaphores remotely
> and also to save the PCI round trip when performing modification by the device
> on received traffic that should be transmitted directly after this modification.
> 
> The problem
> -------------------------------------------------------------------------------
> 
> Today there is no API in libibverbs that allow user space application to manage
> internal memory of IB devices.
> 
> We have considered using mmap(), but As the size of device memory may be limited
> ,the way to access it from host cpu may differ from vendor to vendor, due to
> the 4K (page) aligment limitation of mmap() and the need not to directly
> allow user to access the device memory, there is a need for a wrapper access
> methods API that allows allocating and managing chunks that are smaller than
> 4KB and not necessarily aligned to 4KB (page size).
> 
> Suggested Solution
> -------------------------------------------------------------------------------
> 
> In order for user space applications to use the internal device memory, we
> suggest to update libibverbs so it provides these applications access to
> allocate, free, register and memcopy operations from/to host memory.
> After the device memory is allocated for a process, it can be registered
> using ibv_reg_mr_ex. The registered memory can be used to process any operation
> like if it was registered on host memory mkey. It can be used for post_send,
> post_receive, RDMA WRITE/READ and atomic operations.
> 
> New suggested verbs:
> 
> ibv_alloc_dm: allocates device memory and returns an identifier structure that
> identify and define the allocated device memory
> 
> ibv_free_dm: free device memory.
> 
> ibv_memcpy_dm: Copy from device memory to host memory and from host memory
> to device memory.
> 
> ibv_reg_mr_ex: Extended to ibv_reg_mr that allow registering device memory.
> 
> 

This is useful to kernel consumers too, Adding Stephen and Logan to the
party.

Personally I agree with Christoph Lamater that we are far better off
sticking to standard mmap to expose it to user-space.

 From the thread I don't really understand the problem the API is trying
to solve, AFAICT it boils down to a plain bar, and as such it needs to
be treated as such.
--
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-06-06  7:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 11:25 [RFC] libibverbs IB Device Memory support ahmad omary
     [not found] ` <CADWppnpd9Up7wUTxRgSinhgx3kt3+0bKwgt6P_d3CV1oA90isQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-05 16:44   ` Christoph Lameter
     [not found]     ` <alpine.DEB.2.20.1706051141230.26831-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-05 17:08       ` Leon Romanovsky
     [not found]         ` <20170605170825.GP6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05 17:17           ` Jason Gunthorpe
     [not found]             ` <20170605171749.GA20477-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-05 17:41               ` Leon Romanovsky
     [not found]                 ` <20170605174151.GR6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05 22:11                   ` Christoph Lameter
     [not found]                     ` <alpine.DEB.2.20.1706051705350.886-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-06 11:51                       ` Ahmad Omary
     [not found]                         ` <AM4PR0501MB1956B596450F3BC38806E775C4CB0-dp/nxUn679ggcKT3UpMsY8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-06 15:25                           ` Liran Liss
2017-06-06 15:30                           ` Christoph Lameter
     [not found]                             ` <alpine.DEB.2.20.1706061022270.16819-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-08 13:10                               ` Liran Liss
2017-06-06  7:10       ` Christoph Hellwig
2017-06-05 17:20   ` Jason Gunthorpe
     [not found]     ` <20170605172058.GB20477-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-06  5:52       ` Leon Romanovsky
     [not found]         ` <20170606055229.GT6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-06  6:31           ` Leon Romanovsky
2017-06-06 16:34           ` Jason Gunthorpe
2017-06-06  7:35   ` Sagi Grimberg [this message]
     [not found]     ` <46b1a06d-5936-799c-7743-097c579971ef-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2017-06-06 16:49       ` Logan Gunthorpe

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=46b1a06d-5936-799c-7743-097c579971ef@grimberg.me \
    --to=sagi-nqwnxtmzq1alnmji0ikvqw@public.gmane.org \
    --cc=Alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ahmad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ahmad151084-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org \
    --cc=sbates-pv7U853sEMVWk0Htik3J/w@public.gmane.org \
    --cc=tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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.