| 376 | } |
| 377 | |
| 378 | static inline struct pp2_hif* |
| 379 | mrvl_get_hif(struct mrvl_priv *priv, int core_id) |
| 380 | { |
| 381 | int ret; |
| 382 | |
| 383 | if (likely(hifs[core_id] != NULL)) |
| 384 | return hifs[core_id]; |
| 385 | |
| 386 | rte_spinlock_lock(&priv->lock); |
| 387 | |
| 388 | ret = mrvl_init_hif(core_id); |
| 389 | if (ret < 0) { |
| 390 | MRVL_LOG(ERR, "Failed to allocate hif %d", core_id); |
| 391 | goto out; |
| 392 | } |
| 393 | |
| 394 | if (core_id < mrvl_lcore_first) |
| 395 | mrvl_lcore_first = core_id; |
| 396 | |
| 397 | if (core_id > mrvl_lcore_last) |
| 398 | mrvl_lcore_last = core_id; |
| 399 | out: |
| 400 | rte_spinlock_unlock(&priv->lock); |
| 401 | |
| 402 | return hifs[core_id]; |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Set tx burst function according to offload flag |
no test coverage detected