mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
IB/isert: use T10-PI check mask definitions from core layer
No reason to use hard-coded protection information checks in ib_isert driver. Use check masks from RDMA core driver. Also, while we here, reduce the number of instructions made for setting the check mask (no need to do bitwise or with 0 since we zero the mask in the beginning of the function). Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Signed-off-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
c6c2c03a66
commit
26232872b1
1 changed files with 7 additions and 4 deletions
|
|
@ -2114,10 +2114,13 @@ isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
sig_attrs->check_mask =
|
||||
(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD ? 0xc0 : 0) |
|
||||
(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG ? 0x30 : 0) |
|
||||
(se_cmd->prot_checks & TARGET_DIF_CHECK_REFTAG ? 0x0f : 0);
|
||||
if (se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD)
|
||||
sig_attrs->check_mask |= IB_SIG_CHECK_GUARD;
|
||||
if (se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG)
|
||||
sig_attrs->check_mask |= IB_SIG_CHECK_APPTAG;
|
||||
if (se_cmd->prot_checks & TARGET_DIF_CHECK_REFTAG)
|
||||
sig_attrs->check_mask |= IB_SIG_CHECK_REFTAG;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue