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>
Subject: [PATCH 6/7] [net/9p] Write side zerocopy changes for 9P2000.L protocol.
Date: Sun, 13 Feb 2011 18:21:32 -0800 [thread overview]
Message-ID: <1297650093-10508-7-git-send-email-jvrao@linux.vnet.ibm.com> (raw)
In-Reply-To: <1297650093-10508-1-git-send-email-jvrao@linux.vnet.ibm.com>
Modify p9_client_write() to check the transport preference and act accordingly.
If the preference is P9_TRANS_PREF_PAYLOAD_SEP, send the payload
separately instead of putting it directly on PDU.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
---
net/9p/client.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/net/9p/client.c b/net/9p/client.c
index 82079f9..412c52e 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1333,12 +1333,21 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
if (count < rsize)
rsize = count;
- if (data)
- req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, offset,
- rsize, data);
- else
- req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, offset,
- rsize, udata);
+
+ /* Don't bother zerocopy form small IO (< 1024) */
+ if (((clnt->trans_mod->pref & P9_TRANS_PREF_PAYLOAD_MASK) ==
+ P9_TRANS_PREF_PAYLOAD_SEP) && (rsize > 1024)) {
+ req = p9_client_rpc(clnt, P9_TWRITE, "dqE", fid->fid, offset,
+ rsize, data, udata);
+ } else {
+
+ if (data)
+ req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid,
+ offset, rsize, data);
+ else
+ req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid,
+ offset, rsize, udata);
+ }
if (IS_ERR(req)) {
err = PTR_ERR(req);
goto error;
--
1.6.5.2
next prev parent reply other threads:[~2011-02-14 1:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-14 2:21 [net/9p] ZeroCopy patch series Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` [PATCH 1/7] [net/9p] Preparation and helper functions for zero copy Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` [PATCH 2/7] [net/9p] Assign type of transaction to tc->pdu->id which is otherwise unsed Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` [PATCH 3/7] [net/9p] Add gup/zero_copy support to VirtIO transport layer Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` [PATCH 4/7] [net/9p] Add preferences to " Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` [PATCH 5/7] [net/9p] Read side zerocopy changes for 9P2000.L protocol Venkateswararao Jujjuri (JV)
2011-02-14 2:21 ` Venkateswararao Jujjuri (JV) [this message]
2011-02-14 2:21 ` [PATCH 7/7] [net/9p] Handle TREAD/RERROR case in !dotl case 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=1297650093-10508-7-git-send-email-jvrao@linux.vnet.ibm.com \
--to=jvrao@linux.vnet.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--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).