Re: [PATCH 1/2] nvmet-tcp: match the MAXH2CDATA comment to its byte value

From: Maurizio Lombardi

Date: Sat Dec 05 2026 - 05:09:59 EST


On Thu Dec 3, 2026 at 11:32 AM CET, Kenta Akagi wrote:
> NVMET_TCP_MAXH2CDATA is 0x400000, or 4 MiB. Update its comment to match
> the existing value. The constant and its users are unchanged.
>
> Signed-off-by: Kenta Akagi <kenta.akagi@xxxxxxxxxxxx>
> ---
> drivers/nvme/target/tcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 8a2e0e056131..c70804efb853 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -24,7 +24,7 @@
> #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 0x400000 /* 4 MiB arbitrary limit */
> #define NVMET_TCP_BACKLOG 128
>
> static int param_store_val(const char *str, int *val, int min, int max)

Thanks for the patch,

I would suggest to use SZ_4M:

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)
--
2.53.0

Maurizio