src/dpdk/drivers/net/mlx5/mlx5_devx.c
static int
mlx5_devx_modify_sq(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type,
		    uint8_t dev_port)
{
	struct mlx5_devx_modify_sq_attr msq_attr = { 0 };
	int ret;

	if (type != MLX5_TXQ_MOD_RST2RDY) {
		/* Change queue state to reset. */
		if (type == MLX5_TXQ_MOD_ERR2RDY)
			msq_attr.sq_state = MLX5_SQC_STATE_ERR;
		else
			msq_attr.sq_state = MLX5_SQC_STATE_RDY;
		msq_attr.state = MLX5_SQC_STATE_RST;
		ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr);
		if (ret) {
			DRV_LOG(ERR, "Cannot change the Tx SQ state to RESET"
				" %s", strerror(errno));
			rte_errno = errno;
			return ret;
		}
	}
	if (type != MLX5_TXQ_MOD_RDY2RST) {
		/* Change queue state to ready. */
		msq_attr.sq_state = MLX5_SQC_STATE_RST;
		msq_attr.state = MLX5_SQC_STATE_RDY;
		ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr);
		if (ret) {
			DRV_LOG(ERR, "Cannot change the Tx SQ state to READY"
				" %s", strerror(errno));
			rte_errno = errno;
			return ret;
		}
	}
	/*
	 * The dev_port variable is relevant only in Verbs API, and there is a
	 * pointer that points to this function and a parallel function in verbs
	 * intermittently, so they should have the same parameters.
	 */
	(void)dev_port;
	return 0;
}
/**
 * Modify SQ using DevX API.
 *
 * @param txq_obj
 *   DevX Tx queue object.
 * @param type
 *   Type of change queue state.
 * @param dev_port
 *   Unnecessary.
 *
 * @return
 *   0 on success, a negative errno value otherwise and rte_errno is set.
 */
Modify SQ using DevX API.

@return
0 on success, a negative errno value otherwise and rte_errno is set.
Modify SQ using DevX API . @return 0 on success a negative errno value otherwise and rte_errno is set .
static int
mlx5_devx_modify_sq(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type,
		    uint8_t dev_port)
{
	struct mlx5_devx_modify_sq_attr msq_attr = { 0 };
	int ret;
	if (type != MLX5_TXQ_MOD_RST2RDY) {
		if (type == MLX5_TXQ_MOD_ERR2RDY)
			msq_attr.sq_state = MLX5_SQC_STATE_ERR;
		else
			msq_attr.sq_state = MLX5_SQC_STATE_RDY;
		msq_attr.state = MLX5_SQC_STATE_RST;
		ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr);
		if (ret) {
			DRV_LOG(ERR, "Cannot change the Tx SQ state to RESET"
				" %s", strerror(errno));
			rte_errno = errno;
			return ret;
		}
	}
	if (type != MLX5_TXQ_MOD_RDY2RST) {
		msq_attr.sq_state = MLX5_SQC_STATE_RST;
		msq_attr.state = MLX5_SQC_STATE_RDY;
		ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr);
		if (ret) {
			DRV_LOG(ERR, "Cannot change the Tx SQ state to READY"
				" %s", strerror(errno));
			rte_errno = errno;
			return ret;
		}
	}
	(void)dev_port;
	return 0;
}
static int mlx5_devx_modify_sq ( struct mlx5_txq_obj * obj , enum mlx5_txq_modify_type type , uint8_t dev_port ) { struct mlx5_devx_modify_sq_attr msq_attr = { 0 } ; int ret ; if ( type != MLX5_TXQ_MOD_RST2RDY ) { if ( type == MLX5_TXQ_MOD_ERR2RDY ) msq_attr . sq_state = MLX5_SQC_STATE_ERR ; else msq_attr . sq_state = MLX5_SQC_STATE_RDY ; msq_attr . state = MLX5_SQC_STATE_RST ; ret = mlx5_devx_cmd_modify_sq ( obj -> sq_obj . sq , & msq_attr ) ; if ( ret ) { DRV_LOG ( ERR , " " " " , strerror ( errno ) ) ; rte_errno = errno ; return ret ; } } if ( type != MLX5_TXQ_MOD_RDY2RST ) { msq_attr . sq_state = MLX5_SQC_STATE_RST ; msq_attr . state = MLX5_SQC_STATE_RDY ; ret = mlx5_devx_cmd_modify_sq ( obj -> sq_obj . sq , & msq_attr ) ; if ( ret ) { DRV_LOG ( ERR , " " " " , strerror ( errno ) ) ; rte_errno = errno ; return ret ; } } ( void ) dev_port ; return 0 ; }
Modify SQ using DevX API.
Modify SQ using DevX API .
/* Change queue state to reset. */ /* Change queue state to ready. */ /*
	 * The dev_port variable is relevant only in Verbs API, and there is a
	 * pointer that points to this function and a parallel function in verbs
	 * intermittently, so they should have the same parameters.
	 */