Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3399283rdh; Thu, 28 Sep 2023 10:24:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnLfwy3/85RcRG0VzICdxvio+yHJyhM66xftgOjAgoYcXW+4VI1R2g3m7nDDEo4PzITkkV X-Received: by 2002:a05:6870:2102:b0:1d0:f5bd:6cf with SMTP id f2-20020a056870210200b001d0f5bd06cfmr1998418oae.43.1695921854643; Thu, 28 Sep 2023 10:24:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695921854; cv=pass; d=google.com; s=arc-20160816; b=OZIasOJ6FD3pAFkRtm9CmAmV1IN/o7OnhRytM/odkQehYAm1gR9sNuZ2Vfw3cBp4Eq kHyzyFuTGN539GByEF/jPKqpSIrGd6FQpFChoLaj5dPRz7aRFpG2GpXki1+2cOJxx2Kw pDuw3Y3wB/oJLVJnTNrwmwNHc3IDb0kI9//7rJr1+C8cYQJQfoFUr1bHKbCZC3oruEVE eo72QROmS2pTlRLQyrR1RDKkGEtP9NZYlAZyIaWzu7boOyFmtCI15LnA5ZUOxLQTgRHM RJpb188rdPMhznU6GoO5aqLmva9Tpzoovy4b3y1eLEaTNM/KpImhGPzBMrDK+eYn4P6n IEgw== 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=mPfLkQr5e8DhPVJgYgigehL/oNd6W6ueL5IQFC3hnG0=; fh=0D39/cFBn4nJ+Pn2hiD5IS192WxRS+Wo2nFzNqa87S0=; b=Xb6PPBj9xu2MgJxFs5dM3e2cDFad84/BQAC5uSQZ2Hqu/KpuCZRk6CEuOBauGiitI1 kLo9aMOZYFmINcN6ttP7QIQGguFMnQwXM5czYEBVk2D/+4r/CIrs+IAsC/1V9u2EAW9Z IrpiUAApAvzOpf6tq6JsEE4UPnBAz+aaa57L9+Q9KpX7b4c04nKoyZcp7nzXWPCjSWn0 8jbrn3f6+4OhFNtIP3eiUifa3bH7rO9xl3YBeTlzVcC29i03IySEM38ccfa2455R02l9 ax2zfDIGKikEIwNng51RkVowVi/0C7eCHTUTMKIaBVsEZNDpc1bXKIgtXIWtOwkaPd8k LJ/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WQPd9Sok; 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:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id x32-20020a634860000000b0056a36ac322fsi18331307pgk.514.2023.09.28.10.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:24:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WQPd9Sok; 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:1 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 morse.vger.email (Postfix) with ESMTP id 021FA831D2CA; Thu, 28 Sep 2023 09:10:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjI1QKM (ORCPT + 99 others); Thu, 28 Sep 2023 12:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjI1QKJ (ORCPT ); Thu, 28 Sep 2023 12:10:09 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F242D6; Thu, 28 Sep 2023 09:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CglpReCmXDhk/FI5cAkVU+u0frrPpH0N/H2D6YBb6btDFi7Qt4ddQKXqp9kzNO+jU9XuJk6ax9N+ACIlXsyOkV2Bv06y25ixyABxxM7WW+zlEq3JRNcqfAthkghoxR5/BJMvCUPUjcN+pTbWL2aK+CIj4483aHsuphX3AowhwBDFLyUHomulyWfUdJSsOmL8oBYTSHn4EJTDaLx4QbIjr5giLzanymhxddPPKPtOuz/NEOP282ev75pnOXdDsoh1HocmRN2qze0EF/dmMmneigQ+JK8R947QSG9qigPEuUlRKeQNyXbwdj5BY8jCCXl8KOaoRBuDo1sycloCdoCXnw== 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=mPfLkQr5e8DhPVJgYgigehL/oNd6W6ueL5IQFC3hnG0=; b=GHl3rZEOBliAfXajM24BGuSPshG7u+Lb/ZAiGu7Meb0Jwj5O9gatDHw6MU2pVlJnth1z+kb67QRAPnAW8v2RDdQ+QyoN7AGMJAwDu3ogwT96Xy/xqqF4UpS2YmkHsMNyhE1ULFXnomTUTGbw+4iOKspXBA1pTeQc1BkeITKcG0kjZ2XzcsqKYXaaGS6FXJbUuJbRPswu6jWt68Qftse2UHT/ATdlCWLBksqIYc/39/AkiCi38LycyyJDE6gLHQK19PFTaOWNzWmxHgq2730HTcW+nfzN8w8l6mJ3IftBR3qtTDvOEJLX2UnOmHcTVPYUT5CQG7+Hh60jpD21/xKUew== 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=mPfLkQr5e8DhPVJgYgigehL/oNd6W6ueL5IQFC3hnG0=; b=WQPd9SokDK54fckyYWMmrSw9zMRIseqVOEpTgNKmw+lb77pSW1H/A5xZDyuObnQWcuEjHJiaWxQ6vQNROV26Vx03Rv7SMY1mBkiby4OWHFy5xF0SQVaR1kiTTVuBpZJgVDkZ4KjLHO3Xa/+pjGABQQVpM2LdOpQBKv69wl+dpXQ= 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 CYXPR12MB9441.namprd12.prod.outlook.com (2603:10b6:930:dc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21; Thu, 28 Sep 2023 16:10:05 +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.6813.035; Thu, 28 Sep 2023 16:10:05 +0000 Message-ID: <8ed6d9f6-918f-46aa-a2b7-a30c99dcce7f@amd.com> Date: Thu, 28 Sep 2023 11:10:02 -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> From: Tanmay Shah In-Reply-To: <20230928153825.151948-2-divin.raj@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BY5PR03CA0004.namprd03.prod.outlook.com (2603:10b6:a03:1e0::14) To BY5PR12MB3683.namprd12.prod.outlook.com (2603:10b6:a03:1a5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB3683:EE_|CYXPR12MB9441:EE_ X-MS-Office365-Filtering-Correlation-Id: 39fab851-173f-4dca-79d4-08dbc03d6088 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fTCcCRobEb4AYjecB9pyDAK+EaRgWh0ict9Hifwu0c5mwO3bEbLQ6lXHxNgSMClXfdHbp8b+u9Bz670IjIBWBKxHwro2qf68ZPggWcv6G9es3/qwevhmmw+xfbZxxzN1ohvArhPWwMliqEPeulMPGKra6FbFACfqI6/57p6yCOFFsL7+ejufwNfIHbHp72o7QmAemgexGuhah+D30I41QkKLSbzdJpckQW7SJDVL3GsA7ZOWJjaQCsBor4YvzO+0O/cs8bpxGJwn0uU37zljPmSdQJ+W4XT/+f4vmHHDfqxUGUTxGJsKsW3pb6HeNfURrUVdlCB+IOKSfNAPDuNbYVBqKhMcA1HwYBAPGvBwaTrwrBmOBuT5KryUyfZPZc2o4Rv/d3rBHZXGxntPYpZaMMiShogIVRom1s5Lb9PYmF9x+ael79o+LPMOH2TmvyK7rUPTY4pKOgx+jcrnClyI9ZBbk0ogWm3JxyUnzMb2mM6RHQKosMbziuBVLVupLk7fdKODj5MfO0cubQqshV9u12Fx0CYXXzPIntHUhxUCKoUqH3Ue8V820fTF9sQpRTbXZbAqdcN6w2kzv1NTBAIgYTJvFMJcVfWegNZiaNKYqmtg7zZxzMtxBPKgx0ShLXN5QE/i6h/kqfR+aCPEoDHfFw== 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)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(31686004)(6486002)(53546011)(6506007)(6666004)(478600001)(38100700002)(31696002)(2616005)(41300700001)(44832011)(83380400001)(2906002)(6512007)(26005)(110136005)(86362001)(36756003)(66556008)(316002)(66476007)(8936002)(5660300002)(66946007)(4326008)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?emYzcHRMQUxjZ1E1c3QwNDBIT1lucEZIMnpRa1pPYzVIdmpCV1l6RmE2UWFI?= =?utf-8?B?eTRQWkJBSzVqS2RnZzRvQ0NmVm5DRVl0bnBvdjViZldtclhFQnJlTmVvNE4y?= =?utf-8?B?QjA3RDBIZVFzdWJhQVF6eSthcGx4bWxITi9WSzdXRkZpSnhuc2o1dVU0N0U3?= =?utf-8?B?Y3VCcTdTRHVQa2JmUzUzVkF2WWJtd1NoM0V4U3VWcnN4dWhRRjlCRzhpWXh1?= =?utf-8?B?aU5IQnF4MmFtOTBraFlwUHlTUjFaQ0M4Z2twc1FTLy9TVTVhWDFSelI2Zjhi?= =?utf-8?B?akp0TWhjaWJmS3d2VWlGSlBtaHZqNlYyQ2FKV0oydTVqNnlQVnRLMXYyaUJH?= =?utf-8?B?RzRRUEpjNUtMdW5JSzVDNllzT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ant-Network-Message-Id: 39fab851-173f-4dca-79d4-08dbc03d6088 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB3683.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 16:10:04.9726 (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: 72tdwvAXIMuUXCKBUpiWWtaHHZJ55T60vDwuUrx34SLGDLWpnziZ55XX1I2YINhq X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9441 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 09:10:21 -0700 (PDT) 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 >