]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net/smc: fix valid DMBE buffer sizes
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 14 Oct 2020 17:43:28 +0000 (19:43 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 15 Oct 2020 16:54:43 +0000 (09:54 -0700)
The SMCD_DMBE_SIZES should include all valid DMBE buffer sizes, so the
correct value is 6 which means 1MB. With 7 the registration of an ISM
buffer would always fail because of the invalid size requested.
Fix that and set the value to 6.

Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_core.c

index a406627b1d552949f39611d02aee96da243862ac..7c0e4fac9748db06fe05e7b1c2af8b1e1642dfe0 100644 (file)
@@ -1597,7 +1597,7 @@ out:
        return rc;
 }
 
-#define SMCD_DMBE_SIZES                7 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */
+#define SMCD_DMBE_SIZES                6 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */
 
 static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr,
                                                bool is_dmb, int bufsize)