If the target actually has T10PI support, we prefer to use that
T10 checksum even it's not the fastest on the client, given
checksum_type is not explicitly set.
Change-Id: If91217881fcadbc84d1e360e65648344f5ac2447
Test-Parameters: trivial
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/44657
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
if (preferred & cksum_types)
return preferred;
+ /*
+ * Server reporting a single T10 checksum type
+ * means the target actually supports T10-PI.
+ */
+ if (hweight32(cksum_types & OBD_CKSUM_T10_ALL) == 1)
+ return cksum_types & OBD_CKSUM_T10_ALL;
+
flag = obd_cksum_type_pack(obd_name, cksum_types);
return obd_cksum_type_unpack(flag);