From patchwork Tue Feb 8 08:43:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 539901 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p188hd2m028137 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 8 Feb 2011 08:44:01 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1PmjAJ-0002NK-67; Tue, 08 Feb 2011 08:43:15 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1PmjAI-0002NE-Eu for v9fs-developer@lists.sourceforge.net; Tue, 08 Feb 2011 08:43:14 +0000 X-ACL-Warn: Received: from e28smtp09.in.ibm.com ([122.248.162.9]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.74) id 1PmjAF-0007Ts-MB for v9fs-developer@lists.sourceforge.net; Tue, 08 Feb 2011 08:43:14 +0000 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp09.in.ibm.com (8.14.4/8.13.1) with ESMTP id p187sCdD025127 for ; Tue, 8 Feb 2011 13:24:12 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p188h31o4157650 for ; Tue, 8 Feb 2011 14:13:03 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p188h3Ys012650 for ; Tue, 8 Feb 2011 19:43:03 +1100 Received: from skywalker.linux.vnet.ibm.com (drishya-009124035079.in.ibm.com [9.124.35.79]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p188h2gA012639; Tue, 8 Feb 2011 19:43:02 +1100 From: "Aneesh Kumar K. V" To: "Venkateswararao Jujjuri \(JV\)" In-Reply-To: <4D50E747.3030006@linux.vnet.ibm.com> References: <1297146866-17187-1-git-send-email-jvrao@linux.vnet.ibm.com> <1297146866-17187-4-git-send-email-jvrao@linux.vnet.ibm.com> <877hdbhvw7.fsf@linux.vnet.ibm.com> <4D50E747.3030006@linux.vnet.ibm.com> User-Agent: Notmuch/0.5-64-gc3ae51d (http://notmuchmail.org) Emacs/23.1.1 (i486-pc-linux-gnu) Date: Tue, 08 Feb 2011 14:13:02 +0530 Message-ID: <8739nyj4rt.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 X-Spam-Score: 0.9 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.9 AWL AWL: From: address is in the auto white-list X-Headers-End: 1PmjAF-0007Ts-MB Cc: V9FS Developers Subject: Re: [V9fs-developer] [PATCH 4/7] [net/9p] Add gup/zero_copy support to VirtIO transport layer. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 08 Feb 2011 08:44:01 +0000 (UTC) diff --git a/net/9p/client.c b/net/9p/client.c index a05673b..a6164ff 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -583,7 +583,15 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) goto reterr; p9pdu_finalize(req->tc); - err = c->trans_mod->request(c, req); + /* try to zero copy request for few of the operations */ + if (zero_copy(request)) { + err = c->trans_mode->zc_request(c, req); + if (err == EAGAIN) { + err = c->trans_mode->request(c, req); + } + + } else + err = c->trans_mod->request(c, req); if (err < 0) { if (err != -ERESTARTSYS) c->status = Disconnected; diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 078eb16..91b5a47 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -1012,6 +1012,7 @@ static struct p9_trans_module p9_tcp_trans = { .create = p9_fd_create_tcp, .close = p9_fd_close, .request = p9_fd_request, + .zc_request = p9_no_zero_copy_request, .cancel = p9_fd_cancel, .owner = THIS_MODULE, }; diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index c8f3f72..576da62 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -446,6 +446,7 @@ static struct p9_trans_module p9_virtio_trans = { .create = p9_virtio_create, .close = p9_virtio_close, .request = p9_virtio_request, + .zc_request = p9_virtio_zero_copy_request, .cancel = p9_virtio_cancel, .maxsize = PAGE_SIZE*16, .def = 0,