lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3d4f630-9725-4ed0-a844-2d370cd67af5@infradead.org>
Date:   Thu, 28 Sep 2023 08:51:54 -0700
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Divin Raj <divin.raj@....com>,
        Bjorn Andersson <andersson@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>
Cc:     linux-kernel@...r.kernel.org, linux-remoteproc@...r.kernel.org,
        Peter Hoyes <Peter.Hoyes@....com>
Subject: Re: [PATCH 1/1] rpmsg: virtio: Make buffer size and number
 configurable

Hi,

On 9/28/23 08:38, Divin Raj wrote:
> From: Peter Hoyes <Peter.Hoyes@....com>
> 
> 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 <Peter.Hoyes@....com>
> Signed-off-by: Divin Raj <divin.raj@....com>
> ---
>  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ