src/dpdk/drivers/common/octeontx2/otx2_common.c
int otx2_npa_lf_obj_ref(void)
{
	struct otx2_idev_cfg *idev;
	uint16_t cnt;
	int rc;

	idev = otx2_intra_dev_get_cfg();

	/* Check if ref not possible */
	if (idev == NULL)
		return -EINVAL;


	/* Get ref only if > 0 */
	cnt = rte_atomic16_read(&idev->npa_refcnt);
	while (cnt != 0) {
		rc = rte_atomic16_cmpset(&idev->npa_refcnt_u16, cnt, cnt + 1);
		if (rc)
			break;

		cnt = rte_atomic16_read(&idev->npa_refcnt);
	}

	return cnt ? 0 : -EINVAL;
}
/*
 * @internal
 * Gets reference only to existing NPA LF object.
 */
@internal
Gets reference only to existing NPA LF object.
@internal Gets reference only to existing NPA LF object .
int otx2_npa_lf_obj_ref(void)
{
	struct otx2_idev_cfg *idev;
	uint16_t cnt;
	int rc;
	idev = otx2_intra_dev_get_cfg();
	if (idev == NULL)
		return -EINVAL;
	cnt = rte_atomic16_read(&idev->npa_refcnt);
	while (cnt != 0) {
		rc = rte_atomic16_cmpset(&idev->npa_refcnt_u16, cnt, cnt + 1);
		if (rc)
			break;
		cnt = rte_atomic16_read(&idev->npa_refcnt);
	}
	return cnt ? 0 : -EINVAL;
}
int otx2_npa_lf_obj_ref ( void ) { struct otx2_idev_cfg * idev ; uint16_t cnt ; int rc ; idev = otx2_intra_dev_get_cfg ( ) ; if ( idev == NULL ) return - EINVAL ; cnt = rte_atomic16_read ( & idev -> npa_refcnt ) ; while ( cnt != 0 ) { rc = rte_atomic16_cmpset ( & idev -> npa_refcnt_u16 , cnt , cnt + 1 ) ; if ( rc ) break ; cnt = rte_atomic16_read ( & idev -> npa_refcnt ) ; } return cnt ? 0 : - EINVAL ; }
@internal
 Gets reference only to existing NPA LF object.
@internal Gets reference only to existing NPA LF object .
/* Check if ref not possible */ /* Get ref only if > 0 */