Print this page
5255 uts shouldn't open-code ISP2
*** 315,329 ****
* to round the requested size up to the next highest power-of-2
*/
attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
! if ((attr_p->qp_sizes.cs_sq & (attr_p->qp_sizes.cs_sq - 1)) == 0) {
log_qp_sq_size = log_qp_sq_size - 1;
}
log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
! if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
log_qp_rq_size = log_qp_rq_size - 1;
}
/*
* Next we verify that the rounded-up size is valid (i.e. consistent
--- 315,329 ----
* to round the requested size up to the next highest power-of-2
*/
attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
! if (ISP2(attr_p->qp_sizes.cs_sq)) {
log_qp_sq_size = log_qp_sq_size - 1;
}
log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
! if (ISP2(attr_p->qp_sizes.cs_rq)) {
log_qp_rq_size = log_qp_rq_size - 1;
}
/*
* Next we verify that the rounded-up size is valid (i.e. consistent
*** 801,815 ****
* to round the requested size up to the next highest power-of-2
*/
attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
! if ((attr_p->qp_sizes.cs_sq & (attr_p->qp_sizes.cs_sq - 1)) == 0) {
log_qp_sq_size = log_qp_sq_size - 1;
}
log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
! if ((attr_p->qp_sizes.cs_rq & (attr_p->qp_sizes.cs_rq - 1)) == 0) {
log_qp_rq_size = log_qp_rq_size - 1;
}
/*
* Next we verify that the rounded-up size is valid (i.e. consistent
--- 801,815 ----
* to round the requested size up to the next highest power-of-2
*/
attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, TAVOR_QP_MIN_SIZE);
attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, TAVOR_QP_MIN_SIZE);
log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq);
! if (ISP2(attr_p->qp_sizes.cs_sq)) {
log_qp_sq_size = log_qp_sq_size - 1;
}
log_qp_rq_size = highbit(attr_p->qp_sizes.cs_rq);
! if (ISP2(attr_p->qp_sizes.cs_rq)) {
log_qp_rq_size = log_qp_rq_size - 1;
}
/*
* Next we verify that the rounded-up size is valid (i.e. consistent
*** 1989,1999 ****
* (while guaranteeing that the descriptor size is a
* power-of-2 cachelines).
*/
max_size = (TAVOR_QP_WQE_MLX_SND_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if ((max_size & (max_size - 1)) == 0) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
--- 1989,1999 ----
* (while guaranteeing that the descriptor size is a
* power-of-2 cachelines).
*/
max_size = (TAVOR_QP_WQE_MLX_SND_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if (ISP2(max_size)) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
*** 2006,2016 ****
/*
* Same as above (except for Recv WQEs)
*/
max_size = (TAVOR_QP_WQE_MLX_RCV_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if ((max_size & (max_size - 1)) == 0) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
--- 2006,2016 ----
/*
* Same as above (except for Recv WQEs)
*/
max_size = (TAVOR_QP_WQE_MLX_RCV_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if (ISP2(max_size)) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
*** 2026,2036 ****
* "inline" packet headers. (This is smaller than for QP1
* below because QP0 is not allowed to send packets with a GRH.
*/
max_size = (TAVOR_QP_WQE_MLX_QP0_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if ((max_size & (max_size - 1)) == 0) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
--- 2026,2036 ----
* "inline" packet headers. (This is smaller than for QP1
* below because QP0 is not allowed to send packets with a GRH.
*/
max_size = (TAVOR_QP_WQE_MLX_QP0_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if (ISP2(max_size)) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
*** 2048,2058 ****
* introduces an alignment issue that causes us to consume
* an additional 8 bytes).
*/
max_size = (TAVOR_QP_WQE_MLX_QP1_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if ((max_size & (max_size - 1)) == 0) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);
--- 2048,2058 ----
* introduces an alignment issue that causes us to consume
* an additional 8 bytes).
*/
max_size = (TAVOR_QP_WQE_MLX_QP1_HDRS + (num_sgl << 4));
log2 = highbit(max_size);
! if (ISP2(max_size)) {
log2 = log2 - 1;
}
/* Make sure descriptor is at least the minimum size */
log2 = max(log2, TAVOR_QP_WQE_LOG_MINIMUM);