From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: [PATCH 4/7] [net/9p] Add preferences to transport layer. Date: Sun, 13 Feb 2011 18:21:30 -0800 Message-ID: <1297650093-10508-5-git-send-email-jvrao@linux.vnet.ibm.com> References: <1297650093-10508-1-git-send-email-jvrao@linux.vnet.ibm.com> Cc: linux-fsdevel@vger.kernel.org, "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Return-path: Received: from e4.ny.us.ibm.com ([32.97.182.144]:58498 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755386Ab1BNBnN (ORCPT ); Sun, 13 Feb 2011 20:43:13 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1E1ORIu026577 for ; Sun, 13 Feb 2011 20:24:31 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 1617A4DE803F for ; Sun, 13 Feb 2011 20:42:14 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1E1hBml463120 for ; Sun, 13 Feb 2011 20:43:12 -0500 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 p1E1hBfr017060 for ; Sun, 13 Feb 2011 18:43:11 -0700 In-Reply-To: <1297650093-10508-1-git-send-email-jvrao@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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..82868f1 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 f11358f..ad47285 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -565,6 +565,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_SEP, .def = 0, .owner = THIS_MODULE, }; -- 1.6.5.2