src/dpdk/drivers/mempool/octeontx/octeontx_fpavf.c
static int
fpavf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
{
	uint8_t *idreg;
	int res;
	struct fpavf_res *fpa = NULL;

	RTE_SET_USED(pci_drv);
	RTE_SET_USED(fpa);

	/* For secondary processes, the primary has done all the work */
	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return 0;

	if (pci_dev->mem_resource[0].addr == NULL) {
		fpavf_log_err("Empty bars %p ", pci_dev->mem_resource[0].addr);
		return -ENODEV;
	}
	idreg = pci_dev->mem_resource[0].addr;

	octeontx_fpavf_setup();

	res = octeontx_fpavf_identify(idreg);
	if (res < 0)
		return -1;

	fpa = &fpadev.pool[res];
	fpadev.total_gpool_cnt++;
	rte_wmb();

	fpavf_log_dbg("total_fpavfs %d bar0 %p domain %d vf %d stk_ln_ptr 0x%x",
		       fpadev.total_gpool_cnt, fpa->bar0, fpa->domain_id,
		       fpa->vf_id, (unsigned int)fpa->stack_ln_ptr);

	return 0;
}
/* FPAVF pcie device aka mempool probe */
FPAVF pcie device aka mempool probe
FPAVF pcie device aka mempool probe
static int
fpavf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
{
	uint8_t *idreg;
	int res;
	struct fpavf_res *fpa = NULL;
	RTE_SET_USED(pci_drv);
	RTE_SET_USED(fpa);
	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return 0;
	if (pci_dev->mem_resource[0].addr == NULL) {
		fpavf_log_err("Empty bars %p ", pci_dev->mem_resource[0].addr);
		return -ENODEV;
	}
	idreg = pci_dev->mem_resource[0].addr;
	octeontx_fpavf_setup();
	res = octeontx_fpavf_identify(idreg);
	if (res < 0)
		return -1;
	fpa = &fpadev.pool[res];
	fpadev.total_gpool_cnt++;
	rte_wmb();
	fpavf_log_dbg("total_fpavfs %d bar0 %p domain %d vf %d stk_ln_ptr 0x%x",
		       fpadev.total_gpool_cnt, fpa->bar0, fpa->domain_id,
		       fpa->vf_id, (unsigned int)fpa->stack_ln_ptr);
	return 0;
}
static int fpavf_probe ( struct rte_pci_driver * pci_drv , struct rte_pci_device * pci_dev ) { uint8_t * idreg ; int res ; struct fpavf_res * fpa = NULL ; RTE_SET_USED ( pci_drv ) ; RTE_SET_USED ( fpa ) ; if ( rte_eal_process_type ( ) != RTE_PROC_PRIMARY ) return 0 ; if ( pci_dev -> mem_resource [ 0 ] . addr == NULL ) { fpavf_log_err ( " " , pci_dev -> mem_resource [ 0 ] . addr ) ; return - ENODEV ; } idreg = pci_dev -> mem_resource [ 0 ] . addr ; octeontx_fpavf_setup ( ) ; res = octeontx_fpavf_identify ( idreg ) ; if ( res < 0 ) return -1 ; fpa = & fpadev . pool [ res ] ; fpadev . total_gpool_cnt ++ ; rte_wmb ( ) ; fpavf_log_dbg ( " " , fpadev . total_gpool_cnt , fpa -> bar0 , fpa -> domain_id , fpa -> vf_id , ( unsigned int ) fpa -> stack_ln_ptr ) ; return 0 ; }
FPAVF pcie device aka mempool probe
FPAVF pcie device aka mempool probe
/* For secondary processes, the primary has done all the work */