Commit 26232872 authored by Max Gurtovoy's avatar Max Gurtovoy Committed by Jason Gunthorpe

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent c6c2c03a
...@@ -2114,10 +2114,13 @@ isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs) ...@@ -2114,10 +2114,13 @@ isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs)
return -EINVAL; return -EINVAL;
} }
sig_attrs->check_mask = if (se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD)
(se_cmd->prot_checks & TARGET_DIF_CHECK_GUARD ? 0xc0 : 0) | sig_attrs->check_mask |= IB_SIG_CHECK_GUARD;
(se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG ? 0x30 : 0) | if (se_cmd->prot_checks & TARGET_DIF_CHECK_APPTAG)
(se_cmd->prot_checks & TARGET_DIF_CHECK_REFTAG ? 0x0f : 0); 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment