net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module
authorChristian Schoenebeck <linux_oss@crudebyte.com>
Fri, 15 Jul 2022 21:33:09 +0000 (23:33 +0200)
committerDominique Martinet <asmadeus@codewreck.org>
Tue, 4 Oct 2022 22:05:41 +0000 (07:05 +0900)
This is a preparatory change for the subsequent patch: the RDMA
transport pulls the buffers for its 9p response messages from a
shared pool. [1] So this case has to be considered when choosing
an appropriate response message size in the subsequent patch.

Link: https://lore.kernel.org/all/Ys3jjg52EIyITPua@codewreck.org/
Link: https://lkml.kernel.org/r/79d24310226bc4eb037892b5c097ec4ad4819a03.1657920926.git.linux_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
include/net/9p/transport.h
net/9p/trans_fd.c
net/9p/trans_rdma.c
net/9p/trans_virtio.c
net/9p/trans_xen.c

index ff842f9630718bb8ee6885385775badaef700906..766ec07c95999dcc686432b12d480ff86217984e 100644 (file)
  * @list: used to maintain a list of currently available transports
  * @name: the human-readable name of the transport
  * @maxsize: transport provided maximum packet size
+ * @pooled_rbuffers: currently only set for RDMA transport which pulls the
+ *                   response buffers from a shared pool, and accordingly
+ *                   we're less flexible when choosing the response message
+ *                   size in this case
  * @def: set if this transport should be considered the default
  * @create: member function to create a new connection on this transport
  * @close: member function to discard a connection on this transport
@@ -38,6 +42,7 @@ struct p9_trans_module {
        struct list_head list;
        char *name;             /* name of transport */
        int maxsize;            /* max message size of transport */
+       bool pooled_rbuffers;
        int def;                /* this transport should be default */
        struct module *owner;
        int (*create)(struct p9_client *client,
index 60fcc6b30b4688eb1f8a6e92836b91dc7b0b3438..25d422c473e8a556157a4792cad9c84fad16bbb8 100644 (file)
@@ -1083,6 +1083,7 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
 static struct p9_trans_module p9_tcp_trans = {
        .name = "tcp",
        .maxsize = MAX_SOCK_BUF,
+       .pooled_rbuffers = false,
        .def = 0,
        .create = p9_fd_create_tcp,
        .close = p9_fd_close,
index d817d3745238b4c9a22f60125799253015b42dd6..6ff706760676e02995514199f5a575840c85831a 100644 (file)
@@ -739,6 +739,7 @@ error:
 static struct p9_trans_module p9_rdma_trans = {
        .name = "rdma",
        .maxsize = P9_RDMA_MAXSIZE,
+       .pooled_rbuffers = true,
        .def = 0,
        .owner = THIS_MODULE,
        .create = rdma_create_trans,
index b84d35cf68994631483f2be687ddfbe88739bd0d..e757f0601304361d31d9e0b00166278fb2c0e3ae 100644 (file)
@@ -802,6 +802,7 @@ static struct p9_trans_module p9_virtio_trans = {
         * page in zero copy.
         */
        .maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3),
+       .pooled_rbuffers = false,
        .def = 1,
        .owner = THIS_MODULE,
 };
index 227f89cc7237ca9105d3fa4842aebf756ab9dacf..41c57d40efb69367086bc958a76e82d959c5cbc0 100644 (file)
@@ -246,6 +246,7 @@ static irqreturn_t xen_9pfs_front_event_handler(int irq, void *r)
 static struct p9_trans_module p9_xen_trans = {
        .name = "xen",
        .maxsize = 1 << (XEN_9PFS_RING_ORDER + XEN_PAGE_SHIFT - 2),
+       .pooled_rbuffers = false,
        .def = 1,
        .create = p9_xen_create,
        .close = p9_xen_close,