Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp988626imw; Fri, 15 Jul 2022 17:43:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPtPXpZoC5iO51PGzGxFi2My9A/v7HXBFdvfK2m4IL0zzAvF4DRyIOpntKCIxux/9xN63G X-Received: by 2002:a05:6402:f08:b0:43a:b202:1f63 with SMTP id i8-20020a0564020f0800b0043ab2021f63mr22704980eda.207.1657932192378; Fri, 15 Jul 2022 17:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657932192; cv=none; d=google.com; s=arc-20160816; b=bHh7rNDAQzORmG9wzAL4D/EfSWuB4nQGZOf+9nsNQi+L01a2YlxPoe6YiYJMH361p/ znOTFsPsJ3fo4ZHCZCoLQBbhAhXpQ61qETPnmeWGeGpddhCQVkqzhSlXDR5PZaNFzuFo sVFCUNCES3yylY4KiN6Un9utoNrTBOpbhFXtrj5A4Q1idCZ1lFaS9xqgeK5pNBg31wXy shgpxf/mfjejw0AJiXVCQdNSPpfl8hf3LBZgnyc+sDByBOjKLYMG0ODBVxli9S3gKHtH ZVymxM3vzjH3mJ2hqohF85P/SZT6jNRuP5SE1odDGQDKW1yeOy+et8Ky+cVlCXcPVXUE KJFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:date:from:references:in-reply-to :message-id:dkim-signature; bh=l7nuWYxWUVjm0xFc+FYu5FtE4ko865NXIUjDmd1KE7k=; b=i3zy5rYgySVBX5edZw5/5DnNyUNC36gSusdP6IBLZtdFyQoigqBxhCZlKPlRPKIW90 VvNU/Jppn17kxprpTwfdi/bPfT1dhzM4QPhnh6ne0/pdY4II6fk3old2vFg2LFcaBizn fPsejXbeLkNWUIykEVc05eW0QI7gxLT4Kpu8ncvPq289DHphZwJMrQWt9KJ3Gj4vGZOb rqFkAotxDyZUF3jPFqb7i3veZRQrIhJENE7iadqzf+upWtPjGDU4p7OZVUlY+xd68URS HHAq5tD+RYc8iezg9BKLHco4UBuJwlcHe4k3INXYlqmCQ03zBr1Krgx3fRNqulo+M/N4 O+dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=lizzy header.b=Xjhw3PWf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz19-20020a0564021d5300b0043a9041dd22si9489383edb.297.2022.07.15.17.42.46; Fri, 15 Jul 2022 17:43:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crudebyte.com header.s=lizzy header.b=Xjhw3PWf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231698AbiGOXzz (ORCPT + 99 others); Fri, 15 Jul 2022 19:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiGOXzn (ORCPT ); Fri, 15 Jul 2022 19:55:43 -0400 X-Greylist: delayed 1798 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 15 Jul 2022 16:55:41 PDT Received: from lizzy.crudebyte.com (lizzy.crudebyte.com [91.194.90.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71438951FE; Fri, 15 Jul 2022 16:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=l7nuWYxWUVjm0xFc+FYu5FtE4ko865NXIUjDmd1KE7k=; b=Xjhw3 PWfy8PH+g/wF6G0m0ESFeDBNMWHRfUUJZz3snzevmakUa5jsGmyrWCJjSvo84gJrzlTsmFp7LR73V d3SPyxmTMJ6ZRvJqyrHp+cKXZjd5sMCKOKN5RoAdiR+liKNPdk2N9THnK4BQuscMeCdSmXK+1y+ji OMw3Umg47NTppEhX8V3lpAmIRPs0zooGDeOJ3Hj+Vfpn7RTDMp2vVEwkVWmTO0rNEkknGFVVcSLra hKaU8WERWqpXJSr2tqqnOCG4VznQMOKmyjWQm0snDDgP2xqPxU1XkWJNlfjZG9RuB/KKZUQzzH/0E XqYdCA4krtoSqxTfEc0wTdRDyFI3Q==; Message-Id: <79d24310226bc4eb037892b5c097ec4ad4819a03.1657920926.git.linux_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Fri, 15 Jul 2022 23:33:09 +0200 Subject: [PATCH v6 10/11] net/9p: add 'pooled_rbuffers' flag to struct p9_trans_module To: v9fs-developer@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dominique Martinet , Eric Van Hensbergen , Latchesar Ionkov , Nikolay Kichukov X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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] Signed-off-by: Christian Schoenebeck --- include/net/9p/transport.h | 5 +++++ net/9p/trans_fd.c | 1 + net/9p/trans_rdma.c | 1 + net/9p/trans_virtio.c | 1 + net/9p/trans_xen.c | 1 + 5 files changed, 9 insertions(+) diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h index ff842f963071..766ec07c9599 100644 --- a/include/net/9p/transport.h +++ b/include/net/9p/transport.h @@ -19,6 +19,10 @@ * @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, diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 8f8f95e39b03..eecbb5332bea 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -1081,6 +1081,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, diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 88e563826674..24f287baee70 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -739,6 +739,7 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args) 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, diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 52d00cb3c105..d47b28b3f02a 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -1011,6 +1011,7 @@ static struct p9_trans_module p9_virtio_trans = { */ .maxsize = PAGE_SIZE * ((VIRTQUEUE_SG_NSGL_DEFAULT * SG_USER_PAGES_PER_LIST) - 3), + .pooled_rbuffers = false, .def = 1, .owner = THIS_MODULE, }; diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index 833cd3792c51..3434a080abfa 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -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, -- 2.30.2