Re: [PATCH rdma-core 2/3] ibverbs: Add support for packet pacing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 08, 2017 at 06:32:27PM +0200, Yishai Hadas wrote:
> +int ibv_cmd_modify_qp_ex(struct ibv_qp *qp, struct ibv_qp_attr *attr,
> +			 int attr_mask, struct ibv_modify_qp_ex *cmd,
> +			 size_t cmd_core_size, size_t cmd_size,
> +			 struct ibv_modify_qp_resp_ex *resp,
> +			 size_t resp_core_size, size_t resp_size)
> +{
> +	if (resp_core_size < offsetof(struct ibv_modify_qp_resp_ex,
> +			     response_length) + sizeof(resp->response_length))
> +		return EINVAL;
> +
> +	IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP_EX,
> +			       resp, resp_core_size, resp_size);
> +
> +	copy_modify_qp_fields(qp, attr, attr_mask, &cmd->base);
> +
> +	if (attr_mask & IBV_QP_RATE_LIMIT) {
> +		if (cmd_size >= offsetof(struct ibv_modify_qp_ex, rate_limit) +
> +		    sizeof(cmd->rate_limit))
> +			cmd->rate_limit = attr->rate_limit;
> +		else
> +			return EINVAL;
> +	}

cmd->rate_limit is not being 0'd if it isn't set

> @@ -829,7 +829,8 @@ enum ibv_qp_attr_mask {
>  	IBV_QP_MAX_DEST_RD_ATOMIC	= 1 << 17,
>  	IBV_QP_PATH_MIG_STATE		= 1 << 18,
>  	IBV_QP_CAP			= 1 << 19,
> -	IBV_QP_DEST_QPN			= 1 << 20
> +	IBV_QP_DEST_QPN			= 1 << 20,
> +	IBV_QP_RATE_LIMIT		= 1 << 25,
>  };

Why 25? 21 I think.

>  enum ibv_qp_state {
> @@ -875,6 +876,7 @@ struct ibv_qp_attr {
>  	uint8_t			rnr_retry;
>  	uint8_t			alt_port_num;
>  	uint8_t			alt_timeout;
> +	uint32_t		rate_limit;
>  };

Nope, this is returned by query_qp so you cannot just extend it.

You are supporting query_qp, right?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux