allowing limited driver type-checking and ABI compatibility.
* rawdev: Changed the return type of the function ``rte_dev_info_get()``
+ and the function ``rte_rawdev_queue_conf_get()``
from ``void`` to ``int`` allowing the return of error codes from drivers.
}
}
-static void
+static int
ntb_queue_conf_get(struct rte_rawdev *dev,
uint16_t queue_id,
rte_rawdev_obj_t queue_conf,
struct ntb_hw *hw = dev->dev_private;
if (conf_size != sizeof(*q_conf))
- return;
+ return -EINVAL;
q_conf->tx_free_thresh = hw->tx_queues[queue_id]->tx_free_thresh;
q_conf->nb_desc = hw->rx_queues[queue_id]->nb_rx_desc;
q_conf->rx_mp = hw->rx_queues[queue_id]->mpool;
+
+ return 0;
}
static void
return 0;
}
-static void skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev,
- uint16_t queue_id,
- rte_rawdev_obj_t queue_conf,
- size_t conf_size)
+static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev,
+ uint16_t queue_id,
+ rte_rawdev_obj_t queue_conf,
+ size_t conf_size)
{
struct skeleton_rawdev *skeldev;
struct skeleton_rawdev_queue *skelq;
if (!dev || !queue_conf ||
conf_size != sizeof(struct skeleton_rawdev_queue))
- return;
+ return -EINVAL;
skeldev = skeleton_rawdev_get_priv(dev);
skelq = &skeldev->queues[queue_id];
if (queue_id < SKELETON_MAX_QUEUES)
rte_memcpy(queue_conf, skelq,
sizeof(struct skeleton_rawdev_queue));
+
+ return 0;
}
static void
dev = &rte_rawdevs[dev_id];
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_def_conf, -ENOTSUP);
- (*dev->dev_ops->queue_def_conf)(dev, queue_id, queue_conf,
+ return (*dev->dev_ops->queue_def_conf)(dev, queue_id, queue_conf,
queue_conf_size);
- return 0;
}
int
* @param[out] queue_conf
* Raw device queue configuration structure
*
+ * @return
+ * Returns 0 on success, negative errno on failure
*/
-typedef void (*rawdev_queue_conf_get_t)(struct rte_rawdev *dev,
+typedef int (*rawdev_queue_conf_get_t)(struct rte_rawdev *dev,
uint16_t queue_id,
rte_rawdev_obj_t queue_conf,
size_t queue_conf_size);