mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
@ 2026-09-23  4:20 Ing. Alfonso Kuen Arroyo
  2026-09-23  7:39 ` Maurizio Lombardi
  0 siblings, 1 reply; 3+ messages in thread
From: Ing. Alfonso Kuen Arroyo @ 2026-09-23  4:20 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 said 16M.
Use SZ_4M instead of a value and a comment that can drift out of sync
with each other, as suggested by Christoph Hellwig.

Noticed by Maurizio Lombardi while reviewing "nvmet-tcp: report a
bounded MDTS instead of "no limit"".

v2: use SZ_4M instead of the raw hex value + comment (Christoph
    Hellwig). The file did not pull in linux/sizes.h yet and had no
    other SZ_ user, so the include is added.

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
index e598101..000000 100644
--- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-25  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23  4:20 [PATCH v2] nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA Ing. Alfonso Kuen Arroyo
2026-09-23  7:39 ` Maurizio Lombardi
2026-09-25  6:57   ` Christoph Hellwig

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®