linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
To: v9fs-developer@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org,
	"Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>,
	Badari Pulavarty <pbadari@us.ibm.com>
Subject: [PATCH 1/5] [net/9p] Add capability() to p9_trans_module
Date: Tue, 17 Aug 2010 10:27:21 -0700	[thread overview]
Message-ID: <1282066045-3945-2-git-send-email-jvrao@linux.vnet.ibm.com> (raw)
In-Reply-To: <1282066045-3945-1-git-send-email-jvrao@linux.vnet.ibm.com>

Every transport layer may have unique capabilities. This function is employed
to query and make use of those special/unique cabailities.
To start with we will be defining P9_CAP_GET_MAX_SG_PAGES.
If capability(P9_CAP_GET_MAX_SG_PAGES) exists AND returns a value greater
than 0, it means that the transport can support the transportation
of that many mapped pages between the client and server.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
---
 include/net/9p/transport.h |    2 ++
 net/9p/trans_virtio.c      |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 6d5886e..495a118 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -25,6 +25,7 @@
 
 #ifndef NET_9P_TRANSPORT_H
 #define NET_9P_TRANSPORT_H
+#define P9_CAP_GET_MAX_SG_PAGES 0x01
 
 /**
  * struct p9_trans_module - transport module interface
@@ -53,6 +54,7 @@ struct p9_trans_module {
 	void (*close) (struct p9_client *);
 	int (*request) (struct p9_client *, struct p9_req_t *req);
 	int (*cancel) (struct p9_client *, struct p9_req_t *req);
+	int (*capability) (int req);
 };
 
 void v9fs_register_trans(struct p9_trans_module *m);
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index dcfbe99..762c19f 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -374,6 +374,18 @@ static void p9_virtio_remove(struct virtio_device *vdev)
 
 }
 
+/**
+ * p9_virtio_capability - Return the queried capability related information.
+ *
+ */
+static int p9_virtio_capability(int req)
+{
+	int ret = 0;
+	if (req == P9_CAP_GET_MAX_SG_PAGES)
+		ret = VIRTQUEUE_NUM - 8; /* Keep 8 for in/out headers */
+	return ret;
+}
+
 static struct virtio_device_id id_table[] = {
 	{ VIRTIO_ID_9P, VIRTIO_DEV_ANY_ID },
 	{ 0 },
@@ -400,6 +412,7 @@ static struct p9_trans_module p9_virtio_trans = {
 	.close = p9_virtio_close,
 	.request = p9_virtio_request,
 	.cancel = p9_virtio_cancel,
+	.capability = p9_virtio_capability,
 	.maxsize = PAGE_SIZE*16,
 	.def = 0,
 	.owner = THIS_MODULE,
-- 
1.6.5.2


  reply	other threads:[~2010-08-17 17:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 17:27 [00/05] Add zero copy capability to virtio transport Venkateswararao Jujjuri (JV)
2010-08-17 17:27 ` Venkateswararao Jujjuri (JV) [this message]
2010-08-17 20:43   ` [V9fs-developer] [PATCH 1/5] [net/9p] Add capability() to p9_trans_module Eric Van Hensbergen
2010-08-17 20:46     ` Latchesar Ionkov
2010-08-17 23:31       ` Venkateswararao Jujjuri (JV)
2010-08-18 15:16         ` Eric Van Hensbergen
2010-08-18 16:56           ` Venkateswararao Jujjuri (JV)
2010-08-18 18:26             ` Eric Van Hensbergen
2010-08-17 17:27 ` [PATCH 2/5] [net/9p] Pass p9_client structure to pdu perpartion routines Venkateswararao Jujjuri (JV)
2010-08-17 17:27 ` [PATCH 3/5] [net/9p] Add support for placing page addresses directly on the sg list Venkateswararao Jujjuri (JV)
2010-08-18 20:50   ` [V9fs-developer] " Latchesar Ionkov
2010-08-19 18:28     ` Venkateswararao Jujjuri (JV)
2010-08-19 18:49       ` Latchesar Ionkov
2010-08-19 20:47         ` Venkateswararao Jujjuri (JV)
2010-08-19 21:07           ` Latchesar Ionkov
2010-08-19 21:26             ` Eric Van Hensbergen
2010-08-19 23:35               ` Venkateswararao Jujjuri (JV)
2010-08-20  0:27                 ` Eric Van Hensbergen
2010-08-17 17:27 ` [PATCH 4/5] [net/9p] Achieve zero copy on write path Venkateswararao Jujjuri (JV)
2010-08-19 19:30   ` [V9fs-developer] " Latchesar Ionkov
2010-08-19 20:55     ` Venkateswararao Jujjuri (JV)
2010-08-17 17:27 ` [PATCH 5/5] [net/9p] Achieve zero copy on read path Venkateswararao Jujjuri (JV)

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=1282066045-3945-2-git-send-email-jvrao@linux.vnet.ibm.com \
    --to=jvrao@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).