Commit c0a6cbb9 authored by Israel Rukshin's avatar Israel Rukshin Committed by Jason Gunthorpe

RDMA/core: Rename signature qp create flag and signature device capability

Rename IB_QP_CREATE_SIGNATURE_EN to IB_QP_CREATE_INTEGRITY_EN
and IB_DEVICE_SIGNATURE_HANDOVER to IB_DEVICE_INTEGRITY_HANDOVER.
Signed-off-by: default avatarIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 5a6781a5
...@@ -688,7 +688,7 @@ void rdma_rw_init_qp(struct ib_device *dev, struct ib_qp_init_attr *attr) ...@@ -688,7 +688,7 @@ void rdma_rw_init_qp(struct ib_device *dev, struct ib_qp_init_attr *attr)
* we'll need two additional MRs for the registrations and the * we'll need two additional MRs for the registrations and the
* invalidation. * invalidation.
*/ */
if (attr->create_flags & IB_QP_CREATE_SIGNATURE_EN) if (attr->create_flags & IB_QP_CREATE_INTEGRITY_EN)
factor += 6; /* (inv + reg) * (data + prot + sig) */ factor += 6; /* (inv + reg) * (data + prot + sig) */
else if (rdma_rw_can_use_mr(dev, attr->port_num)) else if (rdma_rw_can_use_mr(dev, attr->port_num))
factor += 2; /* inv + reg */ factor += 2; /* inv + reg */
...@@ -709,7 +709,7 @@ int rdma_rw_init_mrs(struct ib_qp *qp, struct ib_qp_init_attr *attr) ...@@ -709,7 +709,7 @@ int rdma_rw_init_mrs(struct ib_qp *qp, struct ib_qp_init_attr *attr)
u32 nr_mrs = 0, nr_sig_mrs = 0; u32 nr_mrs = 0, nr_sig_mrs = 0;
int ret = 0; int ret = 0;
if (attr->create_flags & IB_QP_CREATE_SIGNATURE_EN) { if (attr->create_flags & IB_QP_CREATE_INTEGRITY_EN) {
nr_sig_mrs = attr->cap.max_rdma_ctxs; nr_sig_mrs = attr->cap.max_rdma_ctxs;
nr_mrs = attr->cap.max_rdma_ctxs * 2; nr_mrs = attr->cap.max_rdma_ctxs * 2;
} else if (rdma_rw_can_use_mr(dev, attr->port_num)) { } else if (rdma_rw_can_use_mr(dev, attr->port_num)) {
......
...@@ -889,7 +889,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, ...@@ -889,7 +889,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
} }
props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
if (MLX5_CAP_GEN(mdev, sho)) { if (MLX5_CAP_GEN(mdev, sho)) {
props->device_cap_flags |= IB_DEVICE_SIGNATURE_HANDOVER; props->device_cap_flags |= IB_DEVICE_INTEGRITY_HANDOVER;
/* At this stage no support for signature handover */ /* At this stage no support for signature handover */
props->sig_prot_cap = IB_PROT_T10DIF_TYPE_1 | props->sig_prot_cap = IB_PROT_T10DIF_TYPE_1 |
IB_PROT_T10DIF_TYPE_2 | IB_PROT_T10DIF_TYPE_2 |
......
...@@ -431,8 +431,7 @@ struct mlx5_ib_qp { ...@@ -431,8 +431,7 @@ struct mlx5_ib_qp {
int create_type; int create_type;
/* Store signature errors */ bool integrity_en;
bool signature_en;
struct list_head qps_list; struct list_head qps_list;
struct list_head cq_recv_list; struct list_head cq_recv_list;
......
...@@ -442,9 +442,9 @@ static int calc_send_wqe(struct ib_qp_init_attr *attr) ...@@ -442,9 +442,9 @@ static int calc_send_wqe(struct ib_qp_init_attr *attr)
} }
size += attr->cap.max_send_sge * sizeof(struct mlx5_wqe_data_seg); size += attr->cap.max_send_sge * sizeof(struct mlx5_wqe_data_seg);
if (attr->create_flags & IB_QP_CREATE_SIGNATURE_EN && if (attr->create_flags & IB_QP_CREATE_INTEGRITY_EN &&
ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB) < MLX5_SIG_WQE_SIZE) ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB) < MLX5_SIG_WQE_SIZE)
return MLX5_SIG_WQE_SIZE; return MLX5_SIG_WQE_SIZE;
else else
return ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB); return ALIGN(max_t(int, inl_size, size), MLX5_SEND_WQE_BB);
} }
...@@ -496,8 +496,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, ...@@ -496,8 +496,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
sizeof(struct mlx5_wqe_inline_seg); sizeof(struct mlx5_wqe_inline_seg);
attr->cap.max_inline_data = qp->max_inline_data; attr->cap.max_inline_data = qp->max_inline_data;
if (attr->create_flags & IB_QP_CREATE_SIGNATURE_EN) if (attr->create_flags & IB_QP_CREATE_INTEGRITY_EN)
qp->signature_en = true; qp->integrity_en = true;
wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size); wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size);
qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB; qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB;
...@@ -1039,7 +1039,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, ...@@ -1039,7 +1039,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
void *qpc; void *qpc;
int err; int err;
if (init_attr->create_flags & ~(IB_QP_CREATE_SIGNATURE_EN | if (init_attr->create_flags & ~(IB_QP_CREATE_INTEGRITY_EN |
IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK |
IB_QP_CREATE_IPOIB_UD_LSO | IB_QP_CREATE_IPOIB_UD_LSO |
IB_QP_CREATE_NETIF_QP | IB_QP_CREATE_NETIF_QP |
...@@ -4714,7 +4714,7 @@ static int set_pi_umr_wr(const struct ib_send_wr *send_wr, ...@@ -4714,7 +4714,7 @@ static int set_pi_umr_wr(const struct ib_send_wr *send_wr,
if (unlikely(send_wr->num_sge != 0) || if (unlikely(send_wr->num_sge != 0) ||
unlikely(wr->access & IB_ACCESS_REMOTE_ATOMIC) || unlikely(wr->access & IB_ACCESS_REMOTE_ATOMIC) ||
unlikely(!sig_mr->sig) || unlikely(!qp->signature_en) || unlikely(!sig_mr->sig) || unlikely(!qp->integrity_en) ||
unlikely(!sig_mr->sig->sig_status_checked)) unlikely(!sig_mr->sig->sig_status_checked))
return -EINVAL; return -EINVAL;
...@@ -4763,7 +4763,7 @@ static int set_sig_umr_wr(const struct ib_send_wr *send_wr, ...@@ -4763,7 +4763,7 @@ static int set_sig_umr_wr(const struct ib_send_wr *send_wr,
if (unlikely(wr->wr.num_sge != 1) || if (unlikely(wr->wr.num_sge != 1) ||
unlikely(wr->access_flags & IB_ACCESS_REMOTE_ATOMIC) || unlikely(wr->access_flags & IB_ACCESS_REMOTE_ATOMIC) ||
unlikely(!sig_mr->sig) || unlikely(!qp->signature_en) || unlikely(!sig_mr->sig) || unlikely(!qp->integrity_en) ||
unlikely(!sig_mr->sig->sig_status_checked)) unlikely(!sig_mr->sig->sig_status_checked))
return -EINVAL; return -EINVAL;
......
...@@ -399,7 +399,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn) ...@@ -399,7 +399,7 @@ static int iser_create_ib_conn_res(struct ib_conn *ib_conn)
init_attr.qp_type = IB_QPT_RC; init_attr.qp_type = IB_QPT_RC;
if (ib_conn->pi_support) { if (ib_conn->pi_support) {
init_attr.cap.max_send_wr = ISER_QP_SIG_MAX_REQ_DTOS + 1; init_attr.cap.max_send_wr = ISER_QP_SIG_MAX_REQ_DTOS + 1;
init_attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; init_attr.create_flags |= IB_QP_CREATE_INTEGRITY_EN;
iser_conn->max_cmds = iser_conn->max_cmds =
ISER_GET_MAX_XMIT_CMDS(ISER_QP_SIG_MAX_REQ_DTOS); ISER_GET_MAX_XMIT_CMDS(ISER_QP_SIG_MAX_REQ_DTOS);
} else { } else {
...@@ -712,7 +712,7 @@ static void iser_addr_handler(struct rdma_cm_id *cma_id) ...@@ -712,7 +712,7 @@ static void iser_addr_handler(struct rdma_cm_id *cma_id)
/* connection T10-PI support */ /* connection T10-PI support */
if (iser_pi_enable) { if (iser_pi_enable) {
if (!(device->ib_device->attrs.device_cap_flags & if (!(device->ib_device->attrs.device_cap_flags &
IB_DEVICE_SIGNATURE_HANDOVER)) { IB_DEVICE_INTEGRITY_HANDOVER)) {
iser_warn("T10-PI requested but not supported on %s, " iser_warn("T10-PI requested but not supported on %s, "
"continue without T10-PI\n", "continue without T10-PI\n",
dev_name(&ib_conn->device->ib_device->dev)); dev_name(&ib_conn->device->ib_device->dev));
......
...@@ -141,7 +141,7 @@ isert_create_qp(struct isert_conn *isert_conn, ...@@ -141,7 +141,7 @@ isert_create_qp(struct isert_conn *isert_conn,
attr.sq_sig_type = IB_SIGNAL_REQ_WR; attr.sq_sig_type = IB_SIGNAL_REQ_WR;
attr.qp_type = IB_QPT_RC; attr.qp_type = IB_QPT_RC;
if (device->pi_capable) if (device->pi_capable)
attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; attr.create_flags |= IB_QP_CREATE_INTEGRITY_EN;
ret = rdma_create_qp(cma_id, device->pd, &attr); ret = rdma_create_qp(cma_id, device->pd, &attr);
if (ret) { if (ret) {
...@@ -317,7 +317,7 @@ isert_create_device_ib_res(struct isert_device *device) ...@@ -317,7 +317,7 @@ isert_create_device_ib_res(struct isert_device *device)
/* Check signature cap */ /* Check signature cap */
device->pi_capable = ib_dev->attrs.device_cap_flags & device->pi_capable = ib_dev->attrs.device_cap_flags &
IB_DEVICE_SIGNATURE_HANDOVER ? true : false; IB_DEVICE_INTEGRITY_HANDOVER ? true : false;
return 0; return 0;
......
...@@ -253,7 +253,7 @@ enum ib_device_cap_flags { ...@@ -253,7 +253,7 @@ enum ib_device_cap_flags {
*/ */
IB_DEVICE_CROSS_CHANNEL = (1 << 27), IB_DEVICE_CROSS_CHANNEL = (1 << 27),
IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29),
IB_DEVICE_SIGNATURE_HANDOVER = (1 << 30), IB_DEVICE_INTEGRITY_HANDOVER = (1 << 30),
IB_DEVICE_ON_DEMAND_PAGING = (1ULL << 31), IB_DEVICE_ON_DEMAND_PAGING = (1ULL << 31),
IB_DEVICE_SG_GAPS_REG = (1ULL << 32), IB_DEVICE_SG_GAPS_REG = (1ULL << 32),
IB_DEVICE_VIRTUAL_FUNCTION = (1ULL << 33), IB_DEVICE_VIRTUAL_FUNCTION = (1ULL << 33),
...@@ -1056,7 +1056,7 @@ enum ib_qp_create_flags { ...@@ -1056,7 +1056,7 @@ enum ib_qp_create_flags {
IB_QP_CREATE_MANAGED_SEND = 1 << 3, IB_QP_CREATE_MANAGED_SEND = 1 << 3,
IB_QP_CREATE_MANAGED_RECV = 1 << 4, IB_QP_CREATE_MANAGED_RECV = 1 << 4,
IB_QP_CREATE_NETIF_QP = 1 << 5, IB_QP_CREATE_NETIF_QP = 1 << 5,
IB_QP_CREATE_SIGNATURE_EN = 1 << 6, IB_QP_CREATE_INTEGRITY_EN = 1 << 6,
/* FREE = 1 << 7, */ /* FREE = 1 << 7, */
IB_QP_CREATE_SCATTER_FCS = 1 << 8, IB_QP_CREATE_SCATTER_FCS = 1 << 8,
IB_QP_CREATE_CVLAN_STRIPPING = 1 << 9, IB_QP_CREATE_CVLAN_STRIPPING = 1 << 9,
......
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