* Initialize process private data structure. * * @param dev * Pointer to Ethernet device structure. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */
| 196 | * 0 on success, a negative errno value otherwise and rte_errno is set. |
| 197 | */ |
| 198 | int |
| 199 | mlx4_proc_priv_init(struct rte_eth_dev *dev) |
| 200 | { |
| 201 | struct mlx4_proc_priv *ppriv; |
| 202 | size_t ppriv_size; |
| 203 | |
| 204 | mlx4_proc_priv_uninit(dev); |
| 205 | /* |
| 206 | * UAR register table follows the process private structure. BlueFlame |
| 207 | * registers for Tx queues are stored in the table. |
| 208 | */ |
| 209 | ppriv_size = sizeof(struct mlx4_proc_priv) + |
| 210 | dev->data->nb_tx_queues * sizeof(void *); |
| 211 | ppriv = rte_zmalloc_socket("mlx4_proc_priv", ppriv_size, |
| 212 | RTE_CACHE_LINE_SIZE, dev->device->numa_node); |
| 213 | if (!ppriv) { |
| 214 | rte_errno = ENOMEM; |
| 215 | return -rte_errno; |
| 216 | } |
| 217 | ppriv->uar_table_sz = dev->data->nb_tx_queues; |
| 218 | dev->process_private = ppriv; |
| 219 | return 0; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Un-initialize process private data structure. |
no test coverage detected