All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] zero-copy extensions for rsockets
@ 2012-07-31 18:18 Hefty, Sean
       [not found] ` <1828884A29C6694DAF28B7E6B8A8237346A6E8D5-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Hefty, Sean @ 2012-07-31 18:18 UTC (permalink / raw)
  To: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)
  Cc: Christoph Lameter (christoph-zt5rKe7wo/JBDgjK7y7TUQ@public.gmane.org),
	Greg KH (gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org)

Before implementing this, I'm looking for feedback.  The following proposal defines user-space APIs to support zero-copy.  The intent is that the use of these extensions is fully compatible with existing calls, allowing applications to make selective use of them.  Although I'm specifically looking at these calls for rsockets, I tried to make these generic enough that they could apply to a wider variety of technologies.

- Sean

--

/* Define option/flag to indicate asynchronous operation */
#define O_ASYNC ...	/* fcntl option */
#define MSG_ASYNC ...	/* send/recv flag */

/*
 * ioq - fd used to report asynchronous completions.
 * sockets/fd's report asynchronous events through an associated ioq
 * ioq is usable with standard calls - fcntl, select, poll, read, etc.
 */
int ioq_create(int flags);
int ioq_add(int ioq, int fd, int flags);
int ioq_del(int ioq, int fd);

/* Reading from an ioq returns this structure */
struct ioq_event {
	int fd;
	int operation;	/* IOREAD, IOWRITE, etc. */
	int result;		/* e.g. bytes transferred */
	int errno;
	void *ptr;		/* context, e.g. address */
};

/* Register memory for zero-copy. */
off_t iomap(int fd, void *addr, size_t len, int prot, int flags, off_t offset);
int iounmap(int fd, off_t offset, size_t len);

/*
 * Zero-copy read and write calls.
 * If fd is nonblocking, then the operation must as asynchronous.
 */
size_t get(int fd, void *buf, size_t count, off_t offset, int flags);
size_t put(int fd, const void *buf, size_t count, off_t offset, int flags);

/* Technology specific operation */
int submit(int fd,
           int operation,	/* IOREAD, IOWRITE, vendor defined, etc. */
           void *context,
           void *request,	/* request structures varies by operation */
           size_t len,		/* size of request structure */
           int flags);

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-01  0:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 18:18 [RFC] zero-copy extensions for rsockets Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A8237346A6E8D5-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-07-31 18:32   ` Jason Gunthorpe
     [not found]     ` <20120731183243.GA4755-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-07-31 20:33       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A8237346A6E926-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-07-31 21:34           ` Jason Gunthorpe
     [not found]             ` <20120731213450.GA5787-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-07-31 22:46               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237346A6E9E6-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-07-31 23:15                   ` Jason Gunthorpe
     [not found]                     ` <20120731231557.GA6956-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-08-01  0:15                       ` Hefty, Sean

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.