drbd: Introduce protocol version 100 headers
The 8 byte header finally becomes too small. With the protocol 100 header we
have 16 bit for the volume number, proper 32 bit for the data length, and
32 bit for further extensions in the future.
Previous versions of drbd are using version 80 headers for all packets
short enough for protocol 80. They support both header versions in
worker context, but only version 80 headers in asynchronous context.
For backwards compatibility, continue to use version 80 headers for
short packets before protocol version 100.
From protocol version 100 on, use the same header version for all
packets.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 60d3088..fe8d6ba 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -341,6 +341,7 @@
#define DRBD_MAGIC 0x83740267
#define DRBD_MAGIC_BIG 0x835a
+#define DRBD_MAGIC_100 0x8620ec20
/* how I came up with this magic?
* base64 decode "actlog==" ;) */
diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h
index 938e856..10144d5 100644
--- a/include/linux/drbd_genl.h
+++ b/include/linux/drbd_genl.h
@@ -95,8 +95,6 @@
* and/or the replication group (aka resource) name,
* and the volume id within the resource. */
GENL_struct(DRBD_NLA_CFG_CONTEXT, 2, drbd_cfg_context,
- /* currently only 256 volumes per group,
- * but maybe we still change that */
__u32_field(1, GENLA_F_MANDATORY, ctx_volume)
__str_field(2, GENLA_F_MANDATORY, ctx_conn_name, 128)
)
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 659a8eb..7f5149b 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -19,6 +19,8 @@
#define DRBD_MINOR_COUNT_MAX 256
#define DRBD_MINOR_COUNT_DEF 32
+#define DRBD_VOLUME_MAX 65535
+
#define DRBD_DIALOG_REFRESH_MIN 0
#define DRBD_DIALOG_REFRESH_MAX 600