* [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
@ 2026-09-19 3:02 Ing. Alfonso Kuen Arroyo
2026-09-21 6:54 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Ing. Alfonso Kuen Arroyo @ 2026-09-19 3:02 UTC (permalink / raw)
To: hch, sagi, kch; +Cc: linux-nvme, linux-kernel, mlombard
The constant is 0x400000, 4 MiB, but the comment next to it still says
16M. Noticed by Maurizio Lombardi while reviewing "nvmet-tcp: report a
bounded MDTS instead of "no limit"".
Signed-off-by: Alfonso Kuen <gerencia@idkmanager.com>
---
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 e598101..726e05b 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -23,7 +23,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 /* 4M arbitrary limit */
#define NVMET_TCP_BACKLOG 128
static int param_store_val(const char *str, int *val, int min, int max)
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
2026-09-19 3:02 [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA Ing. Alfonso Kuen Arroyo
@ 2026-09-21 6:54 ` Christoph Hellwig
2026-09-21 13:42 ` Ing. Alfonso Kuen Arroyo
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2026-09-21 6:54 UTC (permalink / raw)
To: Ing. Alfonso Kuen Arroyo
Cc: hch, sagi, kch, linux-nvme, linux-kernel, mlombard
On Fri, Sep 18, 2026 at 10:02:33PM -0500, Ing. Alfonso Kuen Arroyo wrote:
> #define NVMET_TCP_DEF_INLINE_DATA_SIZE (4 * PAGE_SIZE)
> -#define NVMET_TCP_MAXH2CDATA 0x400000 /* 16M arbitrary limit */
> +#define NVMET_TCP_MAXH2CDATA 0x400000 /* 4M arbitrary limit */
Maybe use SZ_4M instead of having a value and a comment that can get
out of sync?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
2026-09-21 6:54 ` Christoph Hellwig
@ 2026-09-21 13:42 ` Ing. Alfonso Kuen Arroyo
2026-09-22 6:23 ` Maurizio Lombardi
0 siblings, 1 reply; 4+ messages in thread
From: Ing. Alfonso Kuen Arroyo @ 2026-09-21 13:42 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: hch, sagi, kch, linux-nvme, linux-kernel, mlombard
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)
--
2.53.0
Alfonso
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
2026-09-21 13:42 ` Ing. Alfonso Kuen Arroyo
@ 2026-09-22 6:23 ` Maurizio Lombardi
0 siblings, 0 replies; 4+ messages in thread
From: Maurizio Lombardi @ 2026-09-22 6:23 UTC (permalink / raw)
To: Ing. Alfonso Kuen Arroyo, Christoph Hellwig
Cc: sagi, kch, linux-nvme, linux-kernel, mlombard
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-22 6:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 3:02 [PATCH] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA Ing. Alfonso Kuen Arroyo
2026-09-21 6:54 ` Christoph Hellwig
2026-09-21 13:42 ` Ing. Alfonso Kuen Arroyo
2026-09-22 6:23 ` Maurizio Lombardi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®