Print this page
5255 uts shouldn't open-code ISP2

*** 402,418 **** * now, calculate the alloc size, taking into account * the headroom for the sq */ log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes); /* if the total is a power of two, reduce it */ ! if (((attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes) & ! (attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes - 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 --- 402,417 ---- * now, calculate the alloc size, taking into account * the headroom for the sq */ log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes); /* if the total is a power of two, reduce it */ ! if (ISP2(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes)) { 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
*** 919,933 **** attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, HERMON_QP_MIN_SIZE); attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, HERMON_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 --- 918,932 ---- attr_p->qp_sizes.cs_sq = max(attr_p->qp_sizes.cs_sq, HERMON_QP_MIN_SIZE); attr_p->qp_sizes.cs_rq = max(attr_p->qp_sizes.cs_rq, HERMON_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
*** 1519,1535 **** * now, calculate the alloc size, taking into account * the headroom for the sq */ log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes); /* if the total is a power of two, reduce it */ ! if (((attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes) & ! (attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes - 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 --- 1518,1533 ---- * now, calculate the alloc size, taking into account * the headroom for the sq */ log_qp_sq_size = highbit(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes); /* if the total is a power of two, reduce it */ ! if (ISP2(attr_p->qp_sizes.cs_sq + qp->qp_sq_hdrmwqes)) { 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
*** 2829,2839 **** * (while guaranteeing that the descriptor size is a * power-of-2 cachelines). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM); --- 2827,2837 ---- * (while guaranteeing that the descriptor size is a * power-of-2 cachelines). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM);
*** 2849,2859 **** * (while guaranteeing that the descriptor size is a * power-of-2 cachelines). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM); --- 2847,2857 ---- * (while guaranteeing that the descriptor size is a * power-of-2 cachelines). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM);
*** 2866,2876 **** /* * Same as above (except for Recv WQEs) */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM); --- 2864,2874 ---- /* * Same as above (except for Recv WQEs) */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM);
*** 2886,2896 **** * "inline" packet headers. (This is smaller than for QP1 * below because QP0 is not allowed to send packets with a GRH. */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM); --- 2884,2894 ---- * "inline" packet headers. (This is smaller than for QP1 * below because QP0 is not allowed to send packets with a GRH. */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM);
*** 2908,2918 **** * introduces an alignment issue that causes us to consume * an additional 8 bytes). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM); --- 2906,2916 ---- * introduces an alignment issue that causes us to consume * an additional 8 bytes). */ max_size = (HERMON_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, HERMON_QP_WQE_LOG_MINIMUM);