MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_dev_mempool_subscribe

Function mlx5_dev_mempool_subscribe

dpdk/drivers/common/mlx5/mlx5_common.c:586–607  ·  view source on GitHub ↗

* Primary and secondary processes share the `cdev` pointer. * Callbacks addresses are local in each process. * Therefore, each process can register private callbacks. */

Source from the content-addressed store, hash-verified

584 * Therefore, each process can register private callbacks.
585 */
586int
587mlx5_dev_mempool_subscribe(struct mlx5_common_device *cdev)
588{
589 int ret = 0;
590
591 if (!cdev->config.mr_mempool_reg_en)
592 return 0;
593 rte_rwlock_write_lock(&cdev->mr_scache.mprwlock);
594 /* Callback for this device may be already registered. */
595 ret = rte_mempool_event_callback_register(mlx5_dev_mempool_event_cb,
596 cdev);
597 /* Register mempools only once for this device. */
598 if (ret == 0 && rte_eal_process_type() == RTE_PROC_PRIMARY) {
599 rte_mempool_walk(mlx5_dev_mempool_register_cb, cdev);
600 goto exit;
601 }
602 if (ret != 0 && rte_errno == EEXIST)
603 ret = 0;
604exit:
605 rte_rwlock_write_unlock(&cdev->mr_scache.mprwlock);
606 return ret;
607}
608
609static void
610mlx5_dev_mempool_unsubscribe(struct mlx5_common_device *cdev)

Callers 4

mlx5_crypto_dev_startFunction · 0.85
mlx5_compress_dev_startFunction · 0.85
mlx5_regex_startFunction · 0.85

Calls 3

rte_eal_process_typeFunction · 0.85
rte_mempool_walkFunction · 0.85

Tested by

no test coverage detected