#include "roc_api.h"
#include "roc_priv.h"
+static roc_npa_lf_init_cb_t lf_init_cb;
+
+int
+roc_npa_lf_init_cb_register(roc_npa_lf_init_cb_t cb)
+{
+ if (lf_init_cb != NULL)
+ return -EEXIST;
+
+ lf_init_cb = cb;
+ return 0;
+}
+
void
roc_npa_aura_op_range_set(uint64_t aura_handle, uint64_t start_iova,
uint64_t end_iova)
npa_stack_dma_alloc(struct npa_lf *lf, char *name, int pool_id, size_t size)
{
const char *mz_name = npa_stack_memzone_name(lf, pool_id, name);
+ size = PLT_ALIGN_CEIL(size, ROC_ALIGN);
return plt_memzone_reserve_aligned(mz_name, size, 0, ROC_ALIGN);
}
if (__atomic_fetch_add(&idev->npa_refcnt, 1, __ATOMIC_SEQ_CST) != 0)
return 0;
+ if (lf_init_cb) {
+ rc = (*lf_init_cb)(pci_dev);
+ if (rc)
+ goto fail;
+ }
+
rc = npa_attach(dev->mbox);
if (rc)
goto fail;