Re: [PATCH v2 03/31] tty: caif: do not use N_TTY_BUF_SIZE

From: Simon Horman
Date: Thu Mar 20 2025 - 07:17:13 EST


On Mon, Mar 17, 2025 at 08:00:18AM +0100, Jiri Slaby (SUSE) wrote:
> N_TTY_BUF_SIZE -- as the name suggests -- is the N_TTY's buffer size.
> There is no reason to couple that to caif's tty->receive_room. Use 4096
> directly -- even though, it should be some sort of "SKB_MAX_ALLOC" or
> alike. But definitely not N_TTY_BUF_SIZE.

Hi Jiri,

My 2c worth is that 4096 seems like an arbitrary value.
Which is fine, but perhaps a comment is warranted.

>
> N_TTY_BUF_SIZE is private and will be moved to n_tty.c later.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
> Acked-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: Andrew Lunn <andrew+netdev@xxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> Cc: Paolo Abeni <pabeni@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx
> ---
> drivers/net/caif/caif_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
> index ed3a589def6b..e7d1b9301fde 100644
> --- a/drivers/net/caif/caif_serial.c
> +++ b/drivers/net/caif/caif_serial.c
> @@ -344,7 +344,7 @@ static int ldisc_open(struct tty_struct *tty)
> ser->tty = tty_kref_get(tty);
> ser->dev = dev;
> debugfs_init(ser, tty);
> - tty->receive_room = N_TTY_BUF_SIZE;
> + tty->receive_room = 4096;
> tty->disc_data = ser;
> set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
> rtnl_lock();
> --
> 2.49.0
>
>