diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-08-23 09:18:33 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-14 12:38:25 -0400 |
commit | d53733893dc43f4ebb5be510863c5debf0f8990b (patch) | |
tree | dbc9bb129b6c4774747be8b1d68dee6d18052637 /drivers | |
parent | 02918be2273a6b086292e0d85b740336eda46e36 (diff) |
drbd: Actually allow BIOs up to 128k (was 32k).
Now we have multiple BIOs per ee, packets with a 32 bit length field,
it gets time to use these goodies.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 5 |
4 files changed, 14 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index db7e65531afa..58dc02bd16c2 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1389,11 +1389,13 @@ struct bm_extent { | |||
1389 | #endif | 1389 | #endif |
1390 | 1390 | ||
1391 | /* Sector shift value for the "hash" functions of tl_hash and ee_hash tables. | 1391 | /* Sector shift value for the "hash" functions of tl_hash and ee_hash tables. |
1392 | * With a value of 6 all IO in one 32K block make it to the same slot of the | 1392 | * With a value of 8 all IO in one 128K block make it to the same slot of the |
1393 | * hash table. */ | 1393 | * hash table. */ |
1394 | #define HT_SHIFT 6 | 1394 | #define HT_SHIFT 8 |
1395 | #define DRBD_MAX_SEGMENT_SIZE (1U<<(9+HT_SHIFT)) | 1395 | #define DRBD_MAX_SEGMENT_SIZE (1U<<(9+HT_SHIFT)) |
1396 | 1396 | ||
1397 | #define DRBD_MAX_SIZE_H80_PACKET (1 << 15) /* The old header only allows packets up to 32Kib data */ | ||
1398 | |||
1397 | /* Number of elements in the app_reads_hash */ | 1399 | /* Number of elements in the app_reads_hash */ |
1398 | #define APP_R_HSIZE 15 | 1400 | #define APP_R_HSIZE 15 |
1399 | 1401 | ||
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index f3f4ea9c5eb9..71c4c261573e 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2447,7 +2447,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) | |||
2447 | dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ? | 2447 | dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ? |
2448 | crypto_hash_digestsize(mdev->integrity_w_tfm) : 0; | 2448 | crypto_hash_digestsize(mdev->integrity_w_tfm) : 0; |
2449 | 2449 | ||
2450 | if (req->size <= (1 << 15)) { | 2450 | if (req->size <= DRBD_MAX_SIZE_H80_PACKET) { |
2451 | p.head.h80.magic = BE_DRBD_MAGIC; | 2451 | p.head.h80.magic = BE_DRBD_MAGIC; |
2452 | p.head.h80.command = cpu_to_be16(P_DATA); | 2452 | p.head.h80.command = cpu_to_be16(P_DATA); |
2453 | p.head.h80.length = | 2453 | p.head.h80.length = |
@@ -2518,7 +2518,7 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd, | |||
2518 | dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ? | 2518 | dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ? |
2519 | crypto_hash_digestsize(mdev->integrity_w_tfm) : 0; | 2519 | crypto_hash_digestsize(mdev->integrity_w_tfm) : 0; |
2520 | 2520 | ||
2521 | if (e->size <= (1 << 15)) { | 2521 | if (e->size <= DRBD_MAX_SIZE_H80_PACKET) { |
2522 | p.head.h80.magic = BE_DRBD_MAGIC; | 2522 | p.head.h80.magic = BE_DRBD_MAGIC; |
2523 | p.head.h80.command = cpu_to_be16(cmd); | 2523 | p.head.h80.command = cpu_to_be16(cmd); |
2524 | p.head.h80.length = | 2524 | p.head.h80.length = |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 6b35d41706e4..97fb2c2a7a57 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1063,7 +1063,9 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp | |||
1063 | mdev->read_cnt = 0; | 1063 | mdev->read_cnt = 0; |
1064 | mdev->writ_cnt = 0; | 1064 | mdev->writ_cnt = 0; |
1065 | 1065 | ||
1066 | drbd_setup_queue_param(mdev, DRBD_MAX_SEGMENT_SIZE); | 1066 | drbd_setup_queue_param(mdev, mdev->state.conn == C_CONNECTED && |
1067 | mdev->agreed_pro_version < 95 ? | ||
1068 | DRBD_MAX_SIZE_H80_PACKET : DRBD_MAX_SEGMENT_SIZE); | ||
1067 | 1069 | ||
1068 | /* If I am currently not R_PRIMARY, | 1070 | /* If I am currently not R_PRIMARY, |
1069 | * but meta data primary indicator is set, | 1071 | * but meta data primary indicator is set, |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index fe308644a63c..4249117f1f67 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -925,6 +925,11 @@ retry: | |||
925 | 925 | ||
926 | drbd_thread_start(&mdev->asender); | 926 | drbd_thread_start(&mdev->asender); |
927 | 927 | ||
928 | if (mdev->agreed_pro_version < 95 && get_ldev(mdev)) { | ||
929 | drbd_setup_queue_param(mdev, DRBD_MAX_SIZE_H80_PACKET); | ||
930 | put_ldev(mdev); | ||
931 | } | ||
932 | |||
928 | if (!drbd_send_protocol(mdev)) | 933 | if (!drbd_send_protocol(mdev)) |
929 | return -1; | 934 | return -1; |
930 | drbd_send_sync_param(mdev, &mdev->sync_conf); | 935 | drbd_send_sync_param(mdev, &mdev->sync_conf); |