From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: [RFC] [PATCH 5/7] [net/9p] Add preferences to transport layer. Date: Sun, 06 Feb 2011 22:57:22 -0800 Message-ID: <4D4F97D2.3010000@linux.vnet.ibm.com> References: <1297063283-2180-1-git-send-email-jvrao@linux.vnet.ibm.com> <1297063283-2180-6-git-send-email-jvrao@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: "Venkateswararao Jujjuri (JV)" Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:54883 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572Ab1BGG51 (ORCPT ); Mon, 7 Feb 2011 01:57:27 -0500 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e34.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p176k9Cw028584 for ; Sun, 6 Feb 2011 23:46:09 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p176vRAF121972 for ; Sun, 6 Feb 2011 23:57:27 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p176vQwR027143 for ; Sun, 6 Feb 2011 23:57:26 -0700 In-Reply-To: <1297063283-2180-6-git-send-email-jvrao@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 2/6/2011 11:21 PM, Venkateswararao Jujjuri (JV) wrote: > This patch adds preferences field to the p9_trans_module. > Through this, now transport layer can express its preference about the > payload. i.e if payload neds to be part of the PDU or it prefers it > to be sent sepearetly so that the transport layer can handle it in > a better way. > > Signed-off-by: Venkateswararao Jujjuri > --- > include/net/9p/transport.h | 9 +++++++++ > net/9p/trans_virtio.c | 1 + > 2 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h > index 6d5886e..13c01a8 100644 > --- a/include/net/9p/transport.h > +++ b/include/net/9p/transport.h > @@ -26,11 +26,19 @@ > #ifndef NET_9P_TRANSPORT_H > #define NET_9P_TRANSPORT_H > > +#define P9_TRANS_PREF_PAYLOAD_MASK 0x1 > + > +/* Default. Add Payload to PDU before sending it down to transport layer */ > +#define P9_TRANS_PREF_PAYLOAD_DEF 0x0 > +/* Send pay load seperately to transport layer along with PDU.*/ > +#define P9_TRANS_PREF_PAYLOAD_SEP 0x1 > + > /** > * struct p9_trans_module - transport module interface > * @list: used to maintain a list of currently available transports > * @name: the human-readable name of the transport > * @maxsize: transport provided maximum packet size > + * @pref: Preferences of this transport > * @def: set if this transport should be considered the default > * @create: member function to create a new connection on this transport > * @request: member function to issue a request to the transport > @@ -47,6 +55,7 @@ struct p9_trans_module { > struct list_head list; > char *name; /* name of transport */ > int maxsize; /* max message size of transport */ > + int pref; /* Preferences of this transport */ > int def; /* this transport should be default */ > struct module *owner; > int (*create)(struct p9_client *, const char *, char *); > diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c > index 607f064..c76ace6 100644 > --- a/net/9p/trans_virtio.c > +++ b/net/9p/trans_virtio.c > @@ -521,6 +521,7 @@ static struct p9_trans_module p9_virtio_trans = { > .request = p9_virtio_request, > .cancel = p9_virtio_cancel, > .maxsize = PAGE_SIZE*16, > + .pref = P9_TRANS_PREF_PAYLOAD_DEF, > .def = 0, > .owner = THIS_MODULE, > };