nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
Subsystems (2)
PATCH 1/1 nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA
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"".
--- drivers/nvme/target/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/tcp.c +1 -1
@@ -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 128static int param_store_val (const char *str,int *val,int min,int max)
--
2.53.0
Christoph Hellwig
maintainerdrivers/nvme/target/tcp.c line 26
Quoted 3 lines · Ing. Alfonso Kuen Arroyo
#define
NVMET_TCP_DEF_INLINE_DATA_SIZE(4 *PAGE_SIZE)drivers/nvme/target/tcp.c +1
-1-#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?
Quoted 2 lines · Christoph Hellwig
Maybe use
SZ_4Minstead 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.
--- drivers/nvme/target/tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/target/tcp.c +2 -1
@@ -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 128static int param_store_val (const char *str,int *val,int min,int max)
--
2.53.0
Alfonso
Quoted 23 lines · Ing. Alfonso Kuen Arroyo
Quoted 2 lines · Christoph Hellwig
Maybe use
SZ_4Minstead 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.hyet (checked, no otherSZ_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(-)drivers/nvme/target/tcp.c +1
-0@@ -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>
drivers/nvme/target/tcp.c
Quoted 10 lines
drivers/nvme/target/tcp.c +1
-2#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 128static 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