* DPDK callback for Ethernet device configuration. * * @param dev * Pointer to Ethernet device structure. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */
| 244 | * 0 on success, negative errno value otherwise and rte_errno is set. |
| 245 | */ |
| 246 | static int |
| 247 | mlx4_dev_configure(struct rte_eth_dev *dev) |
| 248 | { |
| 249 | struct mlx4_priv *priv = dev->data->dev_private; |
| 250 | struct rte_flow_error error; |
| 251 | int ret; |
| 252 | |
| 253 | /* Prepare internal flow rules. */ |
| 254 | ret = mlx4_flow_sync(priv, &error); |
| 255 | if (ret) { |
| 256 | ERROR("cannot set up internal flow rules (code %d, \"%s\")," |
| 257 | " flow error type %d, cause %p, message: %s", |
| 258 | -ret, strerror(-ret), error.type, error.cause, |
| 259 | error.message ? error.message : "(unspecified)"); |
| 260 | goto exit; |
| 261 | } |
| 262 | ret = mlx4_intr_install(priv); |
| 263 | if (ret) { |
| 264 | ERROR("%p: interrupt handler installation failed", |
| 265 | (void *)dev); |
| 266 | goto exit; |
| 267 | } |
| 268 | ret = mlx4_proc_priv_init(dev); |
| 269 | if (ret) { |
| 270 | ERROR("%p: process private data allocation failed", |
| 271 | (void *)dev); |
| 272 | goto exit; |
| 273 | } |
| 274 | exit: |
| 275 | return ret; |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * DPDK callback to start the device. |
nothing calls this directly
no test coverage detected