Re: [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA

From: Maurizio Lombardi

Date: Tue Sep 22 2026 - 02:23:55 EST


On Mon Sep 21, 2026 at 3:42 PM CEST, Ing. Alfonso Kuen Arroyo wrote:
> On Sun Sep 20, 2026, Christoph Hellwig wrote:
>> Maybe use SZ_4M instead of having a value and a comment that can get
>> out of sync?
>
> Good call - that also gets rid of the case Maurizio flagged (a value and
> a human-maintained comment that describe the same number and can drift
> independently). v2 below; the file doesn't pull in linux/sizes.h yet
> (checked, no other SZ_ user in it), so it needs the include.
>
> Signed-off-by: Alfonso Kuen
> ---
> drivers/nvme/target/tcp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -18,12 +18,13 @@
> #include <net/handshake.h>
> #include <linux/inet.h>
> #include <linux/llist.h>
> +#include <linux/sizes.h>
> #include <trace/events/sock.h>
>
> #include "nvmet.h"
>
> #define NVMET_TCP_DEF_INLINE_DATA_SIZE (4 * PAGE_SIZE)
> -#define NVMET_TCP_MAXH2CDATA 0x400000 /* 16M arbitrary limit */
> +#define NVMET_TCP_MAXH2CDATA SZ_4M
> #define NVMET_TCP_BACKLOG 128
>
> static int param_store_val(const char *str, int *val, int min, int max)
> --


Looks good to me, but you should formally submit it with subject "PATCH V2"
and proper commit message.

Maurizio