Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp310829rdb; Sat, 30 Sep 2023 05:38:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFY4sWlT3grJxL0LCEBtum9LVU2A7A57QNcCNtkmQ+mwUOLBeYJQvfSNTcb66zxczNJqKIC X-Received: by 2002:a05:6808:1a10:b0:3a8:43d5:878b with SMTP id bk16-20020a0568081a1000b003a843d5878bmr9402673oib.2.1696077527215; Sat, 30 Sep 2023 05:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696077527; cv=none; d=google.com; s=arc-20160816; b=G0Zl9YIu9ngMosr9w0uY9nGzZGB53Lc1D5dbg5X1T0A1HTwrUz/gk5aljGzOHibXR7 MchZe90hbI8NI4dhCWGfXeqcI0Qvi7vHcJbChucRz29jTlFDFalBMHf7tYHu026kQzdi vz+Us/yLVMkb+lv1MSlo1ctQYPurRjtN+dMxT50zfDDlZVMdlpxrusu4H0Z6zolLxkzg gKzeuPQLXmMIaf9TObLFPrygdu1/4Nn9WBvN7WBTqPl9MkLnuoMvwFbX7a8bdQSMJCKJ EwvBUfK+YZok8kTjtr1tppxcoILqylOTGOvrhiFnwd0HECawcD5OlHFo8AD4pVjV+zAv 0pQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hPdcYpQxen4e8NFhKYxy/N6WYUJPUeudEMjsy2z2FAk=; fh=0D39/cFBn4nJ+Pn2hiD5IS192WxRS+Wo2nFzNqa87S0=; b=AjjTEgm0YGI+kJxsMK13gagc/Qr6eWSaZciScZx/OOgs3dMo/oflPqrnYsOV5Ryzra NyjXsZYrfOqXvxpHZ5nSXEyMaTZ7wdMCf/qgNIkrjfZr2GPP29UYVt4pq7bi47QToNvj fvOltljZfKajcdMkBpnRrIrjiEDdCLhlYhm6c00xjyj6zX2UUneGWGnWuf9WjFxiqsm3 YNHt9GYxUmkYBpd9KTJW3zB3XVn585FkHwFpXfwk4BfcE06Emjq2WwybWRL/uaPjDCSs QDk1ynFaIYTMkrFVZSy/6wj7AWRo91OGGrWBAHIOyyVWZRDY2OUjfLfxeOjWwEVESJFP REOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xJblSmwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s69-20020a637748000000b00578b63123desi12032472pgc.789.2023.09.30.05.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 05:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xJblSmwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1D16E82CAC1F; Thu, 28 Sep 2023 08:52:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232046AbjI1PwE (ORCPT + 99 others); Thu, 28 Sep 2023 11:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbjI1PwD (ORCPT ); Thu, 28 Sep 2023 11:52:03 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F497EB; Thu, 28 Sep 2023 08:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=hPdcYpQxen4e8NFhKYxy/N6WYUJPUeudEMjsy2z2FAk=; b=xJblSmwhfFiZwjwjM8gAPI32nK oaUlR6BGSVk8o6MC4wcNckcbpC4UmpOHFKiLF+zvGOW2MXofxJ5UeiwyKTj8RwneEo1Wg1fo21eVF dAPiFOoCrn4Q0N9uwcGM2pgi2lhJlW8uai0OtWXlQFrpy184lci0/HNAe9dY3R8IQlmO6Su9RxXg6 SleSDay8zy8xKVwQQvXSF3/6DXuZWYzff1YJkzFDiLwyjtWk7wCWqrURaCbRPqVjDmYfdEw1QwPDE EN5JtPtPM/Z1JrEwzs0gSIwbkKYvitLoiwPv796eTcDxry0sxIuQmHoBy22Rxc8sUKYAoBGUoYsUl Mij7O5fA==; Received: from [50.53.46.231] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qltIz-005fIC-06; Thu, 28 Sep 2023 15:51:57 +0000 Message-ID: Date: Thu, 28 Sep 2023 08:51:54 -0700 MIME-Version: 1.0 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: Randy Dunlap In-Reply-To: <20230928153825.151948-2-divin.raj@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:52:23 -0700 (PDT) Hi, On 9/28/23 08:38, Divin Raj wrote: > 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 Looks to me like you need to: (a) use the "range" kconfig keyword (Documentation/kbuild/kconfig-language.rst) and/or (b) change the source code (driver) to check that both of these new config variables' values make sense. As is (in this patch), I could enter a value of 1 for each of them and see what happens. > + 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 payload. The > + 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)" 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 -- ~Randy