diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-04-30 09:26:20 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:22:11 -0400 |
commit | 0ced55a3bed25b0e30dcb3c7dce9634ce3c60cf2 (patch) | |
tree | 7c5770c396588432619ecd2af5793a04ca7080b5 /drivers/block/drbd/drbd_int.h | |
parent | 5223671bb0315d83f9ad7becbbb9e703aa735bbe (diff) |
drbd: Receiving of delay_probes
Delay_probes are new packets in the DRBD protocol, which allow
DRBD to know the current delay packets have on the data socket.
(relative to the meta data socket)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 2409de12f013..fd7615f1e526 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -209,8 +209,11 @@ enum drbd_packets { | |||
209 | P_RS_IS_IN_SYNC = 0x22, /* meta socket */ | 209 | P_RS_IS_IN_SYNC = 0x22, /* meta socket */ |
210 | P_SYNC_PARAM89 = 0x23, /* data socket, protocol version 89 replacement for P_SYNC_PARAM */ | 210 | P_SYNC_PARAM89 = 0x23, /* data socket, protocol version 89 replacement for P_SYNC_PARAM */ |
211 | P_COMPRESSED_BITMAP = 0x24, /* compressed or otherwise encoded bitmap transfer */ | 211 | P_COMPRESSED_BITMAP = 0x24, /* compressed or otherwise encoded bitmap transfer */ |
212 | /* P_CKPT_FENCE_REQ = 0x25, * currently reserved for protocol D */ | ||
213 | /* P_CKPT_DISABLE_REQ = 0x26, * currently reserved for protocol D */ | ||
214 | P_DELAY_PROBE = 0x27, /* is used on BOTH sockets */ | ||
212 | 215 | ||
213 | P_MAX_CMD = 0x25, | 216 | P_MAX_CMD = 0x28, |
214 | P_MAY_IGNORE = 0x100, /* Flag to test if (cmd > P_MAY_IGNORE) ... */ | 217 | P_MAY_IGNORE = 0x100, /* Flag to test if (cmd > P_MAY_IGNORE) ... */ |
215 | P_MAX_OPT_CMD = 0x101, | 218 | P_MAX_OPT_CMD = 0x101, |
216 | 219 | ||
@@ -540,6 +543,18 @@ struct p_compressed_bm { | |||
540 | u8 code[0]; | 543 | u8 code[0]; |
541 | } __packed; | 544 | } __packed; |
542 | 545 | ||
546 | struct p_delay_probe { | ||
547 | struct p_header head; | ||
548 | u32 seq_num; /* sequence number to match the two probe packets */ | ||
549 | u32 offset; /* usecs the probe got sent after the reference time point */ | ||
550 | } __packed; | ||
551 | |||
552 | struct delay_probe { | ||
553 | struct list_head list; | ||
554 | int seq_num; | ||
555 | struct timeval time; | ||
556 | }; | ||
557 | |||
543 | /* DCBP: Drbd Compressed Bitmap Packet ... */ | 558 | /* DCBP: Drbd Compressed Bitmap Packet ... */ |
544 | static inline enum drbd_bitmap_code | 559 | static inline enum drbd_bitmap_code |
545 | DCBP_get_code(struct p_compressed_bm *p) | 560 | DCBP_get_code(struct p_compressed_bm *p) |
@@ -1028,6 +1043,9 @@ struct drbd_conf { | |||
1028 | u64 ed_uuid; /* UUID of the exposed data */ | 1043 | u64 ed_uuid; /* UUID of the exposed data */ |
1029 | struct mutex state_mutex; | 1044 | struct mutex state_mutex; |
1030 | char congestion_reason; /* Why we where congested... */ | 1045 | char congestion_reason; /* Why we where congested... */ |
1046 | struct list_head delay_probes; /* protected by peer_seq_lock */ | ||
1047 | int data_delay; /* Delay of packets on the data-sock behind meta-sock */ | ||
1048 | atomic_t delay_seq; /* To generate sequence numbers of delay probes */ | ||
1031 | }; | 1049 | }; |
1032 | 1050 | ||
1033 | static inline struct drbd_conf *minor_to_mdev(unsigned int minor) | 1051 | static inline struct drbd_conf *minor_to_mdev(unsigned int minor) |