From: steiner@sgi.com
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, tglx@linutronix.de, holt@sgi.com, andrea@qumranet.com
Subject: [patch 04/13] GRU Driver V3 - kernel services header files
Date: Thu, 03 Jul 2008 16:33:52 -0500 [thread overview]
Message-ID: <20080703213632.088730973@attica.americas.sgi.com> (raw)
In-Reply-To: <20080703213348.489120321@attica.americas.sgi.com>
[-- Attachment #1: gru_services_header --]
[-- Type: text/plain, Size: 4777 bytes --]
This patch contains the header file used to export GRU services to other
kernel drivers such as XPMEM or XPNET.
Signed-off-by: Jack Steiner <steiner@sgi.com>
---
drivers/misc/sgi-gru/grukservices.h | 134 ++++++++++++++++++++++++++++++++++++
1 file changed, 134 insertions(+)
Index: linux-2.6.26-rc8/drivers/misc/sgi-gru/grukservices.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.26-rc8/drivers/misc/sgi-gru/grukservices.h 2008-07-03 16:16:28.000000000 -0500
@@ -0,0 +1,134 @@
+
+/*
+ * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __GRU_KSERVICES_H_
+#define __GRU_KSERVICES_H_
+
+
+/*
+ * Message queues using the GRU to send/receive messages.
+ *
+ * These function allow the user to create a message queue for
+ * sending/receiving 1 or 2 cacheline messages using the GRU.
+ *
+ * Processes SENDING messages will use a kernel CBR/DSR to send
+ * the message. This is transparent to the caller.
+ *
+ * The receiver does not use any GRU resources.
+ *
+ * The functions support:
+ * - single receiver
+ * - multiple senders
+ * - cross partition message
+ *
+ * Missing features ZZZ:
+ * - user options for dealing with timeouts, queue full, etc.
+ * - gru_create_message_queue() needs interrupt vector info
+ */
+
+/*
+ * Initialize a user allocated chunk of memory to be used as
+ * a message queue. The caller must ensure that the queue is
+ * in contiguous physical memory and is cacheline aligned.
+ *
+ * Message queue size is the total number of bytes allocated
+ * to the queue including a 2 cacheline header that is used
+ * to manage the queue.
+ *
+ * Input:
+ * p pointer to user allocated memory.
+ * bytes size of message queue in bytes
+ *
+ * Errors:
+ * 0 OK
+ * >0 error
+ */
+extern int gru_create_message_queue(void *p, unsigned int bytes);
+
+/*
+ * Send a message to a message queue.
+ *
+ * Note: The message queue transport mechanism uses the first 32
+ * bits of the message. Users should avoid using these bits.
+ *
+ *
+ * Input:
+ * xmq message queue - must be a UV global physical address
+ * mesg pointer to message. Must be 64-bit aligned
+ * bytes size of message in bytes
+ *
+ * Output:
+ * 0 message sent
+ * >0 Send failure - see error codes below
+ *
+ */
+extern int gru_send_message_gpa(unsigned long mq_gpa, void *mesg,
+ unsigned int bytes);
+
+/* Status values for gru_send_message() */
+#define MQE_OK 0 /* message sent successfully */
+#define MQE_CONGESTION 1 /* temporary congestion, try again */
+#define MQE_QUEUE_FULL 2 /* queue is full */
+#define MQE_UNEXPECTED_CB_ERR 3 /* unexpected CB error */
+#define MQE_PAGE_OVERFLOW 10 /* BUG - queue overflowed a page */
+#define MQE_BUG_NO_RESOURCES 11 /* BUG - could not alloc GRU cb/dsr */
+
+/*
+ * Advance the receive pointer for the message queue to the next message.
+ * Note: current API requires messages to be gotten & freed in order. Future
+ * API extensions may allow for out-of-order freeing.
+ *
+ * Input
+ * mq message queue
+ * mesq message being freed
+ */
+extern void gru_free_message(void *mq, void *mesq);
+
+/*
+ * Get next message from message queue. Returns pointer to
+ * message OR NULL if no message present.
+ * User must call gru_free_message() after message is processed
+ * in order to move the queue pointers to next message.
+ *
+ * Input
+ * mq message queue
+ *
+ * Output:
+ * p pointer to message
+ * NULL no message available
+ */
+extern void *gru_get_next_message(void *mq);
+
+
+/*
+ * Copy data using the GRU. Source or destination can be located in a remote
+ * partition.
+ *
+ * Input:
+ * dest_gpa destination global physical address
+ * src_gpa source global physical address
+ * bytes number of bytes to copy
+ *
+ * Output:
+ * 0 OK
+ * >0 error
+ */
+extern int gru_copy_gpa(unsigned long dest_gpa, unsigned long src_gpa,
+ unsigned int bytes);
+
+#endif /* __GRU_KSERVICES_H_ */
--
next prev parent reply other threads:[~2008-07-03 21:37 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 21:33 [patch 00/13] GRU Driver V3 - Overview steiner
2008-07-03 21:33 ` [patch 01/13] GRU Driver V3 - hardware data structures steiner
2008-07-03 21:33 ` [patch 02/13] GRU Driver V3 - GRU instructions & macros steiner
2008-07-03 21:33 ` [patch 03/13] GRU Driver V3 - driver internal header files steiner
2008-07-03 21:33 ` steiner [this message]
2008-07-03 21:33 ` [patch 05/13] GRU Driver V3 - driver initialization, file & vma ops steiner
2008-07-03 21:33 ` [patch 06/13] GRU Driver V3 - page faults & exceptions steiner
2008-07-03 21:33 ` [patch 07/13] GRU Driver V3 - kernel services provide by driver steiner
2008-07-03 21:33 ` [patch 08/13] GRU Driver V3 - resource management steiner
2008-07-03 21:33 ` [patch 09/13] GRU Driver V3 - /proc interfaces steiner
2008-07-03 21:33 ` [patch 10/13] GRU Driver V3 - TLB flushing, MMUOPS callouts steiner
2008-07-03 21:33 ` [patch 11/13] GRU Driver V3 - driver makefile steiner
2008-07-03 21:34 ` [patch 12/13] GRU Driver V3 - export is_uv_system(), zap_page_range() & follow_page() steiner
2008-07-04 7:39 ` Christoph Hellwig
2008-07-07 14:39 ` Jack Steiner
2008-07-07 14:54 ` Andrea Arcangeli
2008-07-07 16:29 ` Hugh Dickins
2008-07-07 16:53 ` Jack Steiner
2008-07-08 2:16 ` Nick Piggin
2008-07-09 19:11 ` Jack Steiner
2008-07-10 7:31 ` Nick Piggin
2008-07-10 13:29 ` Jack Steiner
2008-07-10 14:21 ` Nick Piggin
2008-07-10 16:33 ` Jack Steiner
2008-07-10 16:52 ` Nick Piggin
2008-07-10 17:20 ` Jack Steiner
2008-07-11 3:30 ` Nick Piggin
2008-07-07 18:58 ` Arjan van de Ven
2008-07-07 19:29 ` Jack Steiner
2008-07-07 21:03 ` Andrea Arcangeli
2008-07-07 14:45 ` Christoph Lameter
2008-07-07 17:58 ` Jack Steiner
2008-07-03 21:34 ` [patch 13/13] GRU Driver V3 - driver/misc Makefile & Kconfig changes steiner
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=20080703213632.088730973@attica.americas.sgi.com \
--to=steiner@sgi.com \
--cc=akpm@osdl.org \
--cc=andrea@qumranet.com \
--cc=holt@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®