Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2127921rdb; Tue, 3 Oct 2023 11:01:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmLJ5ZrQir073szPISsrRtRe9grYwBCE6/c0+GU5An/73dWQ6Pb+5Lg6C3iavdbIUriEJo X-Received: by 2002:a17:902:8649:b0:1c6:15fc:999 with SMTP id y9-20020a170902864900b001c615fc0999mr284786plt.45.1696356119107; Tue, 03 Oct 2023 11:01:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696356119; cv=pass; d=google.com; s=arc-20160816; b=W2CLcG/dcCBAFn1uLh2H5K8pWrt3/q4Y8DV8yqN8IVOJtXNA60mQqqtTuw7pFqyi4H 9voomhkaqT8BuB756Is7JU15TUPu7ei+OnchzJwwY9xUoFCggDOI6HJ7yd13fhLqFQk/ odoA0gZYYRRKofrjII1oehsCCdkbgARVWpwGaXU5FIcT2rl2OVVZ7E3gysh67HsvwBqx JOE+/RweWI9iaoOKt4gXgZNRcEXY3v9ux0EwlnGuHY/HlOzSW7B8HMzC/BvQrGcd6a7+ JLbbkwVme2tKNihyYyEP3kom+IkFaYcp0ys7BysXzf3O73NYV8iK523eQf6QttPwsZFp 3t9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=d3P8MilSpAh72/noE2wcNK9afu51CWDfE52TdGH39Tw=; fh=0D39/cFBn4nJ+Pn2hiD5IS192WxRS+Wo2nFzNqa87S0=; b=xEyPCuOJfdqsFTOma6W9i8Qoyj6dXD+2Th9qsXGAl4/vjodCNc8Ik2ntXPC5my9Hqq MPgW83ZPUPrnzNm4VhBlcifnI93TgYv1x4c7mfyURrtiTXlmKZrh07mhX4Wx+N5d7aOr kxcbWqyMsKeoGEt5hg10kfTlV+kWmpOV503drYxHmNuEKkxT7ZuYg2si+d7izfd+KHX9 nshItmVOPs/azN0uQsVQKIhvNpBqgXi2POLN2mScVm98Gl21K6BcYhLgxXoZ2NcopFQZ gaqPC0Z7WT1x8TfaSPPWgHjIc6jc37o9qn69wrnbpBOcDhWlWxZCFXCs40Dhlp66KLcx hNsQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=xkFI0TmM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l18-20020a170902e2d200b001c72d694ec7si1725618plc.328.2023.10.03.11.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=xkFI0TmM; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C99B980D88DD; Tue, 3 Oct 2023 11:01:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbjJCSBe (ORCPT + 99 others); Tue, 3 Oct 2023 14:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240706AbjJCSB3 (ORCPT ); Tue, 3 Oct 2023 14:01:29 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2071.outbound.protection.outlook.com [40.107.237.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CAB88E; Tue, 3 Oct 2023 11:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mg54kfLFP4ARELyr5Jm9EALIzbXr97N5oKYWWxq3PjtOKAoDe0RW7DBrDpNEyhUTrTMDJi8gL4jqdik/f/SyvrITQP0lFLFZnLX7/1dkmmBfSBOgIMgkVPvIEh0lPrxdXF4viovRbcwssqNYRXqUHpGfCL8g/IdqQ8lQldatVW4Co4r+wvlipXNtaCY/jt8nl7txBq4/ecqNdPkVdsdwJsti5dY7UmEjjcociatR58x4IyFw/dS9QMnJZIJvYkKNPFpI8sdOyn2zq+5T77HpiM8qbnjaBJI4W4+dV+jX+uApSjfBUDG9ItTLtM0dI8MmsPMv8W7EXmupWrOTvyiWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d3P8MilSpAh72/noE2wcNK9afu51CWDfE52TdGH39Tw=; b=HcGgKXXFe7BcEhbbJV7giR9SwduZS3Ta/6uunNIsTEVWhUgPyz+gRidshfNlTAD8tIdXGViwzhWUBkyrWIUw8W0ilDILbu7RaLGGO33/rPVERcHDKTyOrYnV236t1DNDR9n1/S4oiTZW2FPWDgoh3h4EAYPNtvGQKSgdUuaaMGLcNx7IXmnVa503yZgK9SJ1KQ9IB+FAGWR0ORv33gmegQlxIgz03XW23T5o6x8mC6xhkFQ+sn7C1mITjJFykaOw0pjSaTyFhqZyNwdeufJxxXIHrh1aIdZPm3WXTX8XKegLkiNyrYdjBwYOByUGFXnXAtDdI/koYi76WUhnX0nQMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d3P8MilSpAh72/noE2wcNK9afu51CWDfE52TdGH39Tw=; b=xkFI0TmMSIRKHEsV7sJP6J2A2ZF8kOjom1VXOuCQsmKqU8EEAKN6wJBcKVrOImE0T56ZacT4P4jvHQlgnqRrLZuY5y//YrfUxv/AEPthQH9wswAKk0I14NGBHCSc7mtvP5aBQrkzU7fE8UfgMfNMKobWJfMyc7zTBieoRkrXW+g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BY5PR12MB3683.namprd12.prod.outlook.com (2603:10b6:a03:1a5::16) by PH7PR12MB6884.namprd12.prod.outlook.com (2603:10b6:510:1ba::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30; Tue, 3 Oct 2023 18:01:21 +0000 Received: from BY5PR12MB3683.namprd12.prod.outlook.com ([fe80::8304:46bd:5017:3dcb]) by BY5PR12MB3683.namprd12.prod.outlook.com ([fe80::8304:46bd:5017:3dcb%7]) with mapi id 15.20.6838.033; Tue, 3 Oct 2023 18:01:21 +0000 Message-ID: Date: Tue, 3 Oct 2023 13:01:16 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] rpmsg: virtio: Make buffer size and number configurable Content-Language: en-US To: Divin Raj , Bjorn Andersson , Mathieu Poirier Cc: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Peter Hoyes References: <20230928153825.151948-1-divin.raj@arm.com> <20230928153825.151948-2-divin.raj@arm.com> <8ed6d9f6-918f-46aa-a2b7-a30c99dcce7f@amd.com> <45db1e0a-4f60-4fcc-bf30-06630a712ccc@arm.com> From: Tanmay Shah In-Reply-To: <45db1e0a-4f60-4fcc-bf30-06630a712ccc@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR06CA0041.namprd06.prod.outlook.com (2603:10b6:a03:14b::18) To BY5PR12MB3683.namprd12.prod.outlook.com (2603:10b6:a03:1a5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB3683:EE_|PH7PR12MB6884:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d9b91b9-237f-448e-d706-08dbc43ac007 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5LNVZpdt+HmK3SdfKgXWZZE2i6dJzjghaKD7wO2+hDRyyBkJTLzIy30dT0QuOtgVwPSNlg7n/h6dqs6BmhSNx1IYYIBhx63NRMZPEYrn0k5vuwnR51jr6Cho4IvYet5sIp0tPrHR95/PwZH/lncjESFUbc4qSiCXJ1gaZRA3ZPfEan77uAxaHNGBRjxa7Rb4vKxT5t7Ms5acXw5FikW6pUGF3Qn1Vm8MO+QjApe2B20omQwnPWzcwv9gZJmtUvmRrWQJRwZgwE7w5XXTYne3stfK2BIlz2j2X5mqP1p6gMRHdHalpJ54OgRxGBewdf5Arp80+3Ld2qzwZN0wcsmuVETafBFEMDR2ULusLN/vo/DMKuFmWLb/89iP7TGEwvxkCZo2jY5ldJNemyezHegjdH283WO0ICSwbI6ppOotsF30awq2JY4SzX1s/FhEobp9unpH6gM5FqCaJOV9MtFZdCo/sPXmppP09ZcWm04klRSKVMKXw/fnBBVTvygrTg7QkV4aWS+mPKvBe14OfY75pJwUf3GKosoyDOeaoXsaLY9sB5zLvcq0JshQn/xyfmKoknF4BGFfkmKOy2GirQ6RirdP0phsleHiYqWwFEjq1qWVtklutZYSjxvc5shxmx6YuJUYSxKDsDZ0fjIcdw1/9A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB3683.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(376002)(136003)(39860400002)(396003)(346002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(6512007)(26005)(31696002)(86362001)(36756003)(38100700002)(83380400001)(66476007)(6506007)(478600001)(66556008)(316002)(31686004)(2616005)(66946007)(5660300002)(44832011)(966005)(6486002)(8936002)(4326008)(110136005)(8676002)(41300700001)(53546011)(6666004)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MFRldW5yZUhLYWZzRUk1ZktGSE1KNnNoTG1Hb1FteWlDSE5PQ1d3ZHVWMkJs?= =?utf-8?B?WmRaNk9rUitYRldkTVQrTkdjeTlDanFKK2tjNTZpMUhIMTNRZFN4eEg5OTNh?= =?utf-8?B?QzRqUVpEM0tSWG1mb29Xd3FKVnhQRTd2SGdFMUwwT2hBNmNIK2p6dW8zeTZs?= =?utf-8?B?cStPSzh2S3VES2NOdGJjQUloaWowSGx2NE1PT045c1NPSTc5NU1JMU53bGRH?= =?utf-8?B?SlNIV29VNzNSMjMrTWJSVEpJclI5V2ZtMEdmeVh0S09HWThCR1hQNlhLMk1Q?= =?utf-8?B?d2lCMDByRjNPT1dlMTl3ODRncENQQ2haNVdnY3dUdjVMT2RBQUpQUXVUaUh4?= =?utf-8?B?QndUdm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Exchange-CrossTenant-Network-Message-Id: 1d9b91b9-237f-448e-d706-08dbc43ac007 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB3683.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 18:01:21.3848 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PMov4Lcs9zCLHT3UttBKkD2Ues80wiNoIiqq9vNL0nTS+gyDu3AiFZjotqLYMDUo X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6884 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 11:01:54 -0700 (PDT) On 10/3/23 10:28 AM, Divin Raj wrote: > Hello, > > Thanks for all review comments. > It makes sense to incorporate a variable-length buffer size. However, we still require an implementation that can successfully achieve this objective. > > We will be investigating this matter and will return with a feasible solution. Thanks. Here is the previous effort: Series: "Enhance virtio rpmsg bus driver buffer allocation" https://lore.kernel.org/all/1548949280-31794-1-git-send-email-xiaoxiang@xiaomi.com/ There was discussion to revive the patch and the activity is still pending. This can be good start if we want to achieve it. Thanks, Tanmay > > Thanks, > > On 9/28/23 5:10 PM, Tanmay Shah wrote: > > Hello, > > Thanks for your patch. > > Instead of having this in Kconfig, It's better to have buffer size decided dynamically. Probably by resource-table. > > We still need implementation that achieves that goal. Meanwhile I think it's best to keep buffer size fixed. > > Thanks. > > On 9/28/23 10:38 AM, Divin Raj wrote: > > > > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. > > > From: Peter Hoyes > > Replace the MAX_RPMSG_BUF_SIZE and MAX_RPMSG_NUM_BUFS #define in > virtio_rpmsg_bus.c with the Kconfig parameters CONFIG_RPMSG_VIRTIO_BUF_SIZE > and CONFIG_RPMSG_VIRTIO_MAX_NUM_BUFS, allowing user-provided customization. > > Making both the number of buffers and size configurable facilitates aligning > memory requirements between vdev-buffer and vdev-vrings for client drivers > that require larger buffer sizes, for example. > > Signed-off-by: Peter Hoyes > Signed-off-by: Divin Raj > --- > drivers/rpmsg/Kconfig | 23 +++++++++++++++++++++++ > drivers/rpmsg/virtio_rpmsg_bus.c | 27 +++------------------------ > 2 files changed, 26 insertions(+), 24 deletions(-) > > diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig > index d3795860f5c0..677f4a1ac8bb 100644 > --- a/drivers/rpmsg/Kconfig > +++ b/drivers/rpmsg/Kconfig > @@ -81,4 +81,27 @@ config RPMSG_VIRTIO > select RPMSG_NS > select VIRTIO > > +config RPMSG_VIRTIO_MAX_BUF_SIZE > + int "Virtio RPMSG max buffer size (in bytes)" > + default 512 > + depends on RPMSG_VIRTIO > + help > + This option allows you to configure the maximum buffer size (in bytes) > + for Virtio RPMSG communications. The number of buffers will be computed > + based on the number of buffers (CONFIG_RPMSG_VIRTIO_MAX_NUM_BUFS) > + supported by the vring. By default, it supports up to a maximum of 512 > + buffers (256 in each direction). Each buffer consists of 16 bytes for the > + message header and the remaining bytes for the payload.The default values > + will utilize a maximum total space of 256KB for the buffers. > + > +config RPMSG_VIRTIO_MAX_NUM_BUFS > + int "Virtio RPMSG max buffer count (even number for TX and Rx)" > + default 512 > + depends on RPMSG_VIRTIO > + help > + This option allows you to configure the maximum number of buffers used > + for Virtio RPMSG communication. By default, it supports up to a maximum > + of 512 buffers (256 in each direction). Please note that this value > + should be an even number, as it accounts for both transmit (TX) and > + receive (Rx) buffers. > endmenu > diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c > index 905ac7910c98..87a9a4fa30e0 100644 > --- a/drivers/rpmsg/virtio_rpmsg_bus.c > +++ b/drivers/rpmsg/virtio_rpmsg_bus.c > @@ -109,27 +109,6 @@ struct virtio_rpmsg_channel { > #define to_virtio_rpmsg_channel(_rpdev) \ > container_of(_rpdev, struct virtio_rpmsg_channel, rpdev) > > -/* > - * We're allocating buffers of 512 bytes each for communications. The > - * number of buffers will be computed from the number of buffers supported > - * by the vring, upto a maximum of 512 buffers (256 in each direction). > - * > - * Each buffer will have 16 bytes for the msg header and 496 bytes for > - * the payload. > - * > - * This will utilize a maximum total space of 256KB for the buffers. > - * > - * We might also want to add support for user-provided buffers in time. > - * This will allow bigger buffer size flexibility, and can also be used > - * to achieve zero-copy messaging. > - * > - * Note that these numbers are purely a decision of this driver - we > - * can change this without changing anything in the firmware of the remote > - * processor. > - */ > -#define MAX_RPMSG_NUM_BUFS (512) > -#define MAX_RPMSG_BUF_SIZE (512) > - > /* > * Local addresses are dynamically allocated on-demand. > * We do not dynamically assign addresses from the low 1024 range, > @@ -902,12 +881,12 @@ static int rpmsg_probe(struct virtio_device *vdev) > virtqueue_get_vring_size(vrp->svq)); > > /* we need less buffers if vrings are small */ > - if (virtqueue_get_vring_size(vrp->rvq) < MAX_RPMSG_NUM_BUFS / 2) > + if (virtqueue_get_vring_size(vrp->rvq) < CONFIG_RPMSG_VIRTIO_MAX_NUM_BUFS / 2) > vrp->num_bufs = virtqueue_get_vring_size(vrp->rvq) * 2; > else > - vrp->num_bufs = MAX_RPMSG_NUM_BUFS; > + vrp->num_bufs = CONFIG_RPMSG_VIRTIO_MAX_NUM_BUFS; > > - vrp->buf_size = MAX_RPMSG_BUF_SIZE; > + vrp->buf_size = CONFIG_RPMSG_VIRTIO_MAX_BUF_SIZE; > > total_buf_space = vrp->num_bufs * vrp->buf_size; > > -- > 2.25.1 > > > > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. >