Skip to content

Commit 01d205d

Browse files
cschoenebeckmartinetd
authored andcommitted
net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module
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/ [1] 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>
1 parent 1effdbf commit 01d205d

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

include/net/9p/transport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
* @list: used to maintain a list of currently available transports
2020
* @name: the human-readable name of the transport
2121
* @maxsize: transport provided maximum packet size
22+
* @pooled_rbuffers: currently only set for RDMA transport which pulls the
23+
* response buffers from a shared pool, and accordingly
24+
* we're less flexible when choosing the response message
25+
* size in this case
2226
* @def: set if this transport should be considered the default
2327
* @create: member function to create a new connection on this transport
2428
* @close: member function to discard a connection on this transport
@@ -38,6 +42,7 @@ struct p9_trans_module {
3842
struct list_head list;
3943
char *name; /* name of transport */
4044
int maxsize; /* max message size of transport */
45+
bool pooled_rbuffers;
4146
int def; /* this transport should be default */
4247
struct module *owner;
4348
int (*create)(struct p9_client *client,

net/9p/trans_fd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
10831083
static struct p9_trans_module p9_tcp_trans = {
10841084
.name = "tcp",
10851085
.maxsize = MAX_SOCK_BUF,
1086+
.pooled_rbuffers = false,
10861087
.def = 0,
10871088
.create = p9_fd_create_tcp,
10881089
.close = p9_fd_close,

net/9p/trans_rdma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args)
739739
static struct p9_trans_module p9_rdma_trans = {
740740
.name = "rdma",
741741
.maxsize = P9_RDMA_MAXSIZE,
742+
.pooled_rbuffers = true,
742743
.def = 0,
743744
.owner = THIS_MODULE,
744745
.create = rdma_create_trans,

net/9p/trans_virtio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ static struct p9_trans_module p9_virtio_trans = {
802802
* page in zero copy.
803803
*/
804804
.maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3),
805+
.pooled_rbuffers = false,
805806
.def = 1,
806807
.owner = THIS_MODULE,
807808
};

net/9p/trans_xen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ static irqreturn_t xen_9pfs_front_event_handler(int irq, void *r)
246246
static struct p9_trans_module p9_xen_trans = {
247247
.name = "xen",
248248
.maxsize = 1 << (XEN_9PFS_RING_ORDER + XEN_PAGE_SHIFT - 2),
249+
.pooled_rbuffers = false,
249250
.def = 1,
250251
.create = p9_xen_create,
251252
.close = p9_xen_close,

0 commit comments

Comments
 (0)