* DPDK callback to configure a TX queue. * * @param dev * Pointer to Ethernet device structure. * @param idx * TX queue index. * @param desc * Number of descriptors to configure in queue. * @param socket * NUMA socket on which memory must be allocated. * @param[in] conf * Thresholds parameters. * * @return * 0 on success, a negative errno value otherwise and rte_errno is
| 391 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 392 | */ |
| 393 | int |
| 394 | mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, |
| 395 | unsigned int socket, const struct rte_eth_txconf *conf) |
| 396 | { |
| 397 | struct mlx5_priv *priv = dev->data->dev_private; |
| 398 | struct mlx5_txq_data *txq = (*priv->txqs)[idx]; |
| 399 | struct mlx5_txq_ctrl *txq_ctrl = |
| 400 | container_of(txq, struct mlx5_txq_ctrl, txq); |
| 401 | int res; |
| 402 | |
| 403 | res = mlx5_tx_queue_pre_setup(dev, idx, &desc); |
| 404 | if (res) |
| 405 | return res; |
| 406 | txq_ctrl = mlx5_txq_new(dev, idx, desc, socket, conf); |
| 407 | if (!txq_ctrl) { |
| 408 | DRV_LOG(ERR, "port %u unable to allocate queue index %u", |
| 409 | dev->data->port_id, idx); |
| 410 | return -rte_errno; |
| 411 | } |
| 412 | DRV_LOG(DEBUG, "port %u adding Tx queue %u to list", |
| 413 | dev->data->port_id, idx); |
| 414 | (*priv->txqs)[idx] = &txq_ctrl->txq; |
| 415 | return 0; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * DPDK callback to configure a TX hairpin queue. |
nothing calls this directly
no test coverage detected